luni
Well-known member
I'm confused about how to place data in the Flash.
What I understood so far:
places 500kB in the flash. The startup code tries to copy this to DTCM which will fail because there is not enough space in DTCM. Compiling this code indeed gives a linker error complaining about an overflow. Here the linker output:
If I add PROGMEM to the buffer definition it should not copy the buffer to the RAM
Which it doesn't, according to the linker output:
So far so good. However, Teensy.exe as well as tyTools complain that the file is too large and don't upload. Any idea what I misunderstood?
Here a snippet from the Teensy.exe log
What I understood so far:
Code:
const char buffer[500*1024] = {0};
void setup()
{
Serial1.println(buffer);
}
void loop(){}
places 500kB in the flash. The startup code tries to copy this to DTCM which will fail because there is not enough space in DTCM. Compiling this code indeed gives a linker error complaining about an overflow. Here the linker output:
Code:
Memory region Used Size Region Size %age Used
ITCM: 6772 B 512 KB 1.29%
DTCM: 524992 B 512 KB 100.13%
RAM: 0 GB 512 KB 0.00%
FLASH: 525012 B 1984 KB 25.84
c:/toolchain/gcc/gcc-arm-none-eabi-5_4-2016q3-20160926-win32/bin/../lib/gcc/arm-none-eabi/5.4.1/../../../../arm-none-eabi/bin/ld.exe: address 0x200802c0 of .vsteensy/build/TestProject.elf section `.bss' is not within region `DTCM'
If I add PROGMEM to the buffer definition it should not copy the buffer to the RAM
Code:
PROGMEM const char buffer[500*1024] = {0};
void setup()
{
Serial1.println(buffer);
}
void loop(){}
Which it doesn't, according to the linker output:
Code:
[LD] .vsteensy/build/TestProject.elf
Memory region Used Size Region Size %age Used
ITCM: 6772 B 512 KB 1.29%
DTCM: 12992 B 512 KB 2.48%
RAM: 0 GB 512 KB 0.00%
FLASH: 525012 B 1984 KB 25.84%
User code built and linked to libraries
[HEX] .vsteensy/build/TestProject.hex
[LST] .vsteensy/build/TestProject.lst
Sucessfully built project
Here a snippet from the Teensy.exe log
Code:
...
21:36:54.542 (post_compile 24): Sending command: comment: Teensyduino 1.48-beta3 - WINDOWS (teensy_post_compile)
21:36:54.638 (loader): File "sketch_sep07a.ino.hex". 525012 bytes, 200% used
21:36:54.638 (loader): File contains data beyond chip size, yikes!
21:36:54.653 (loader): remote cmd from 3772: "dir:C:\Users\lutz\AppData\Local\Temp\arduino_build_879626\"
21:36:54.653 (loader): remote cmd from 3772: "file:sketch_sep07a.ino.hex"
...
Last edited: