This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Linking process very slow when declaring large amount of data

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

Parents
  • 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));
    

Reply
  • 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));
    

Children