Hi,
I just modify the demo code .
see attached,
in ld file, i define a section called my_const:
| my_const | | | (RX) : ORIGIN = 0x00000410, LENGTH = 0x00000100 |
.my_const :
{
KEEP(*(.myconst))
} > my_const
in C code, define structure as
const config_params __attribute__((section(".myconst"))) params_to_myconst=
{
0x12345678, //local IP address
0xabcd, //local port No. 7727
};
in memory window you will see the params_to_myconst allocated from 0x410.
can this help?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------