Häufig gestellte Fragen

常見問答

如何在程式編譯時,將資料放置在Flash固定的位址呢?  日期:2016-08-29

  • 在Keil開發環境中

    可以使用以下的語法:

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

    將資料字節0x12345678寫入到位址0x1000。 

     

  • 在IAR開發環境中

    首先程式必須先宣告常數SIG,常數內容0x12345678放置在” 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;

    在link file(*.scf)必須宣告Flash_Address指定的位址。以下列為例,指定"Flash_Address"的位址在0x1000:

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

     

     

     

產品: 微控制器 ,Arm Cortex-M0 微控制器 ,M051 系列 ,M0518 系列 ,M0519 系列 ,Mini51 系列 ,Nano100 / 102 系列 ,Nano103 Base 系列 ,Nano110 / 112 LCD 系列 ,Nano120 USB 系列 ,Nano130 USB+LCD 系列 ,NUC029 系列 ,NUC100 / 200 系列 ,NUC120 / 122 / 123 / 220 USB 系列 ,NUC130 / 230 CAN 系列 ,NUC131/NUC1311 CAN 系列 ,NUC140 / 240 USB+CAN 系列 ,Arm Cortex-M4 微控制器 ,M451 Base 系列 ,M451M 系列 ,M452 USB 系列 ,M453 CAN 系列 ,M4TK 觸控 IC 系列 ,NUC442 / 472 系列 ,NUC505 系列
應用:
功能: Peripherals,Memory,APROM,Data Flash,LDROM,Software and Tools,Development-Environment,IAR,Keil
本網站使用cookie作為與網站互動時識別瀏覽器之用,瀏覽本網站即表示您同意本網站對cookie的使用及相關隱私權政策
OK