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

Assign static library to a specific memory section (using scatter file)

Hi all,

thanks so much for reading my post.

I am using Keil uVision V5.22.0.0, cortex M4 microcontroller. My question is the following

I have a static library that I'd like to include in my project. However, I would like to add it to a specific section of memory through the use of a scatter file. My scatter looks like this:

LR_m_text 0x00000410 0x00010000 { ; load region size_region ER_m_text 0x00000410 0x00010000 { ; load address = execution address * (InRoot$$Sections) .ANY (+RO) } RW_m_data m_data_start m_data_size { ; RW data .ANY (+RW +ZI) }

... rest of scatter <Ignored>
}

I am modifying the original scatter file (above) in the following way, in order to create an execution and storage region for the library (STATIC_LIB):

LR_m_text 0x00000410 0x00010000 { ; load region size_region ER_m_text 0x00000410 0x00010000 { ; load address = execution address * (InRoot$$Sections) .ANY (+RO) }

STATIC_LIB 0x0001A000 0x2000 { .ANY (+RO) }

RW_m_data m_data_start m_data_size { ; RW data .ANY (+RW +ZI) }

... rest of scatter <Ignored>

}

How should I reference this new region (STATIC_LIB) in order for the compiler to place the library there? Could you provide some background as to what the compiler is doing in order to place the library correctly? Please let me know if I am missing any vital information that might help you in helping me figure this out.

Thanks!

Alex