place prameter in fix flash address

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

place prameter in fix flash address

732 Views
AsafTv
Contributor II

Hi,

My device is MK64fn1m0xx12

i use MCUXpresso IDE

what is the way to place prameters in fix flash Adrres i use this code but it not work

advice

const Configuration_Device_Information_t __attribute__((section(".ARM.__at_0x3000"))) Configuration_DeviceInformationFactoryParam = {
DEVICE_ID ,
{(SOFTWARE_VERSION & 0xFF0000) >> 16, (SOFTWARE_VERSION & 0x00FF00) >> 8, (SOFTWARE_VERSION & 0x0000FF) >> 0} ,
};

0 Kudos
Reply
1 Reply

727 Views
bobpaddock
Senior Contributor III

"(section(".ARM.__at_0x3000)..."

That is a format I've never seen before, which isn't to say it is not valid.
That could mean it is offset 0x3000 bytes into the .ARM section, and not from absolute zero.


Take a look at these:

https://mcuoneclipse.com/2021/05/26/placing-code-in-sections-with-managed-gnu-linker-scripts/

https://mcuoneclipse.com/2014/10/06/putting-code-of-files-into-special-section-with-the-gnu-linker/

The AT directive is probably not what you are after here.

/*
* The AT directive tells the linker to load a section's data somewhere
* other than the address at which it's actually located.
*
* By supplying an AT directive for .data sections during linking, we
* tell the linker to assign a_global an address in one location
* (typically RAM), but place its initial value somewhere else (
* __text_end , usually ROM ).
*
* Symbols _text_end, _data_start , and _data_end to find the initial
* value, determine its size, and place it at its proper place in RAM.
*
* ADDR(section): Return the absolute address (the VMA) of the named
* section. The script must previously have defined the location of that
* section.
*
* ALIGN(exp):Return the location counter (.) aligned to the next exp
* boundary. ALIGN doesn't change the value of the location
* counter--it just does arithmetic on it.
*
* SIZEOF(section):Return the size in bytes of the named section, if
* that section has been allocated. If the section has not been
* allocated when this is evaluated, the linker will report an
* error.
*
* Initialized data will be placed at the end of the .text section:
*/
.flash_command : AT (__FLASH_AT)
{
. = ALIGN(4);
__flash_cmd_start__ = .;

KEEP(*(.flash_cmd)) /* Section to program Flash, that can not be in Flash when the Flash is being programmed */

__flash_cmd_end = .;
. = ALIGN(4);
} > RAM

0 Kudos
Reply