Keil定位常量、变量到指定地址

发布时间 2023-09-07 15:54:13作者: dreamboy2000

一、常量 - ROM区域

const char Version[] __attribute__((at(0x8001000))) =

{

    'M','V','1','0','0'

};

 

二、变量 - RAM区域

int val __attribute__((section(".ARM.__at_0x20000004"))) = 0x00;

 

三、函数 - ROM区域

#pragma arm section code=".ARM.__at_0x8002000"

void SendInfo(uint8_t data)

{

}

#pragma arm section