DSY_SDRAM_DATA stored in SRAM

I just noticed that DSY_SDRAM_DATA seems to not store in SDRAM, it just stores it in SRAM. I’m implementing a FIR filter and storing a bunch of IR arrays. If I do something like:

float DSY_SDRAM_DATA ir_flat[] = {1,2,3....};

it ends up identical to:

float ir_flat[] = {1,2,3....};

if I do

float DSY_SDRAM_BSS ir_flat[] = {1,2,3....};

it is properly allocated in sdram space (though of course not initialized)

ir_flat is a global variable.

Any ideas on this?
Thanks!

You should take a look at this comment

2 Likes

Close, but I’m loading from QSPIFLASH (tried the hack subbing “> QSPIFLASH” for “> FLASH” in the linker, and the usage info looks correct, but it doesn’t initialize the data properly (or at all).

.data section is filled in startup file, so you would have to do the same for variables used in SDRAM section. I.e. add a copy of that section using _esdram in place of _edata and so on.

This obviously can work if SDRAM is already initialized, which can only be done if bootloader did it as firmware can do it only at a later time when main() gets called.

2 Likes

Ah, that did it! Thank you! Maybe this should be part of the next release.

2 Likes