Hello!
I want to put a constant array into a specified flash memory (address is 0x00007FF0)in S32 Design Studio for ARM.However,"const char flag[10]@0x00007FF0" doesn't work.
So,Should I modify the Flash.ld?
已解决! 转到解答。
Hi,
you need to add custom section into linker file:
/* Specify the memory areas */
MEMORY
{
/* Flash */
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x00007BE0
m_mydata (RX) : ORIGIN = 0x00007FF0, LENGTH = 0x000000FF
/* SRAM_L */
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000
/* SRAM_U */
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00007000
}
/* Define output sections */
SECTIONS
{
.mydata :
{
KEEP(*(.mydata))
} > m_mydata
and define variable by using __attribute__ like this:
__attribute__ ((section(".mydata"))) const char flag[] = {"ABCDEFGHIJ"};
Jiri
Hi,
you need to add custom section into linker file:
/* Specify the memory areas */
MEMORY
{
/* Flash */
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x00007BE0
m_mydata (RX) : ORIGIN = 0x00007FF0, LENGTH = 0x000000FF
/* SRAM_L */
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000
/* SRAM_U */
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00007000
}
/* Define output sections */
SECTIONS
{
.mydata :
{
KEEP(*(.mydata))
} > m_mydata
and define variable by using __attribute__ like this:
__attribute__ ((section(".mydata"))) const char flag[] = {"ABCDEFGHIJ"};
Jiri