Häufig gestellte Fragen

FAQ

How to put data in the Flash fixed address when compiling the program?  Issue Date:2016-08-29

  • In the Keil development environment 

    Use the following:

    const uint32_t Buf[1] __attribute__((at(0x1000))) = {0x12345678};

    Write data byte 0x12345678 into the address 0x1000. 

  • In the IAR development environment

    First, declare the constant SIG, and put the constant content 0x12345678 at the address specified by “Flash_Address”:

    /* Declaration of signature. Location of it is specified in scatter file. */

    const uint32_t SIG @ "Flash_Address";

    /* Definition of SIG signature. */

    const uint32_t SIG = 0x12345678;

    In the link file(*.scf) declare the address specified by Flash_Address. In the following example, specify 

    "Flash_Address" as 0x1000:

    place at address mem:0x1000  {section Flash_Address }; 

     

     

Products: Microcontrollers ,Arm Cortex-M0 MCUs ,M051 Base Series ,M0518 Series ,M0519 Series ,Mini51 Base Series ,Nano100/102 Base Series ,Nano103 Base Series ,Nano110/112 LCD Series ,Nano120 USB Series ,Nano130 Advanced Series ,NUC029 Series ,NUC100/200 Advanced Series ,NUC120/122/123/220 USB Series ,NUC130/230 CAN Series ,NUC131/NUC1311 CAN Series ,NUC140/240 Connectivity Series ,Arm Cortex-M4 MCUs ,M451 Base Series ,M451M Series ,M452 USB Series ,M453 CAN Series ,M4TK Touch Key Series ,NUC442/472 Series ,NUC505 Series
Applications:
Function: Peripherals,Memory,APROM,Data Flash,LDROM,Software and Tools,Development-Environment,IAR,Keil