I have a large synth project (much too large to post code) that stores many constant arrays containing raw drum samples in FLASH:
FLASH: code:361728, data:7052072, headers:9172 free for files:703492
RAM1: variables:94496, code:358152, padding:2296 free for local variables:69344
RAM2: variables:500224 free for malloc/new:24064
It uses the audio library (with USB and analog I/O) as well as non DMA-based audio processing chain, and includes a touch screen, touch sensors, encoders etc and uses most of RAM2 for a stereo delay line.
I've tried the following with Teensyduino 1.58 and 1.59, and Arduino 1.8.19 and IDE 2.2.1, all on Windows 10 pro (sorry previously said 11).
Teensy loader reports about 91% used. When I try to upload the code to a T4.1 it works fine when the T4.1 had no previous version of this large project in flash. But if I try to do the same when the T4.1 already had a previous version, on the first attempt is shows "erasing" for about 20 sec, and then DOWNLAOD ERROR. But shows "programming" and DOWNLOAD COMPLETE on the second try, every time. The second try can be by either clicking the program button on Teensy loader or via the compiler. Either way the program runs fine after the second try and a reboot.
If I take out the largest drum sample bank to create a smaller version in FLASH, it works first time every time. Except if the larger version was still in the T4.1, then it fails once when erasing the larger old code, but is fine after that, and loads first time every time. So it seems the problem is with erasing the larger version from flash. Is there perhaps some sort of erase time-out in the loader that I'm exceeding?
One thing that puzzles me, is that I wrote a small piece of code that had some vey large dummy arrays, so the loader still reported 95% use, but it didn't have the same problem. It had far fewer arrays - just larger ones. Maybe that matters?
Also, with the problem code, I do need to press the Reboot button on the loader after the second load, which I don't need to do with the smaller version of the code - it boots automatically after the first successful upload. I doubt it makes any difference, but the T4.1 is powered from an external 5V regulator, not USB power. I've tried this both with locked and unlocked T4.1, and get the same result.
If this is something you've seen before, please let me know what the cause was in your case. I know that without code it's just guess work, but I would be grateful for any guesses at this point.
In case it is an erase time-out issue for example, is there a way of changing it's value, or should I be looking for something in my code that could cause this sort of behavior?
Thanks very much.
FLASH: code:361728, data:7052072, headers:9172 free for files:703492
RAM1: variables:94496, code:358152, padding:2296 free for local variables:69344
RAM2: variables:500224 free for malloc/new:24064
It uses the audio library (with USB and analog I/O) as well as non DMA-based audio processing chain, and includes a touch screen, touch sensors, encoders etc and uses most of RAM2 for a stereo delay line.
I've tried the following with Teensyduino 1.58 and 1.59, and Arduino 1.8.19 and IDE 2.2.1, all on Windows 10 pro (sorry previously said 11).
Teensy loader reports about 91% used. When I try to upload the code to a T4.1 it works fine when the T4.1 had no previous version of this large project in flash. But if I try to do the same when the T4.1 already had a previous version, on the first attempt is shows "erasing" for about 20 sec, and then DOWNLAOD ERROR. But shows "programming" and DOWNLOAD COMPLETE on the second try, every time. The second try can be by either clicking the program button on Teensy loader or via the compiler. Either way the program runs fine after the second try and a reboot.
If I take out the largest drum sample bank to create a smaller version in FLASH, it works first time every time. Except if the larger version was still in the T4.1, then it fails once when erasing the larger old code, but is fine after that, and loads first time every time. So it seems the problem is with erasing the larger version from flash. Is there perhaps some sort of erase time-out in the loader that I'm exceeding?
One thing that puzzles me, is that I wrote a small piece of code that had some vey large dummy arrays, so the loader still reported 95% use, but it didn't have the same problem. It had far fewer arrays - just larger ones. Maybe that matters?
Also, with the problem code, I do need to press the Reboot button on the loader after the second load, which I don't need to do with the smaller version of the code - it boots automatically after the first successful upload. I doubt it makes any difference, but the T4.1 is powered from an external 5V regulator, not USB power. I've tried this both with locked and unlocked T4.1, and get the same result.
If this is something you've seen before, please let me know what the cause was in your case. I know that without code it's just guess work, but I would be grateful for any guesses at this point.
In case it is an erase time-out issue for example, is there a way of changing it's value, or should I be looking for something in my code that could cause this sort of behavior?
Thanks very much.
Last edited: