Hi,
I am using the TM4C123GH6PGE micro controller, with css 5.4
I need to place some data (lets call it factory data) of some elements in my project. And the user will have an ability to change the factory settings which I want to store in a diffrent location on the flash.
the reason to do that is to be able if needed to restore the device to the initial configuration.
I manged to declare memory sections in the flash for that.
My question is if there is a way to store my data in the flash when I program the micro controller (jtag or dfu).
the memory sections:
MEMORY
{
FLASH (RX) : origin = 0x00000000, length = 0x00036000
FACTORY_DATA (RX) : origin = 0x00036000, length = 0x00002000
USER_DATA (RX) : origin = 0x00038000, length = 0x00002000
SRAM (RWX) : origin = 0x20000000, length = 0x00008000
}
/* Section allocation in memory */
SECTIONS
{
.intvecs: > 0x00000000
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.machineFactoryData : > FACTORY_DATA
.machineUserData : > USER_DATA
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
}
I tried, just for the example to store array with the value of 5 in the flash with no success.
#pragma DATA_SECTION(_MachineFactoryData, ".machineUserData")
#pragma RETAIN (_MachineFactoryData)
#pragma DATA_SECTION(_MachineUserData, ".machineFactoryData")
#pragma RETAIN (_MachineUserData)
uint32_t _MachineFactoryData[2048] = {5} ;
uint32_t _MachineUserData[2048] ;
but all the values are 0xffffffff
what am I doing wrong?
thanks Asi.