Hi, in my project on a Cortex-M4 with an external sdram I declare a large amount of data (63 arrays of 1MByte) placed in a dedicated section using scatter file.
The data are declared all in a separate module.
I noticed that the linking process is very slow and depends on the amount of data declared, is there a workaround?
Thank you, kind regards.
John
How slow is "very slow" ?
About one minute if I use the form:
unsigned char buffer[64][1048576] __attribute__((section("SDRAM"))); (where SDRAM is a (+RW) section in scatter file)
and few seconds if i use:
unsigned char buffer[64][1048576] __attribute__((section(".ARM.__at_0x60000000")));
If the size of the generated image (.axf file) is over 64MB, then the delay is the linker taking time to compress 64MB of data into the image. You'll see the linker output claim RW-data is over 64MB. The key is to put the data into a zero-initialized section so that it won't compress it into the final image.
If you're using ARMCLANG, name the section .bss.name.
LR_m_sdram 0x80000000 0x10000000 { ER_sdram 0x80000000 NOCOMPRESS UNINIT 0x10000000 { .ANY (.bss.m_sdram) } }
Then place the data with an attribute:
unsigned char buffer[64][1048576] __attribute__((section(".bss.m_sdram")));
I tested the ARMCLANG approach. If you're using ARMCC, try adding zero_init after the section attribute. You wouldn't modify your scatter file in this case. I didn't test this case, but the linker manual
unsigned char buffer[64][1048576] __attribute__((section("SDRAM"),zero_init));
Hi Adam, excuse me for the late answer.
I've tried both ARMCLANG and ARMCC and it works perfectly.