1.定义一个变量在固定的地址:
__ICCARM__ IAR编译器
__CC_ARM Keil编译器
#if defined (__ICCARM__)
unsigned char ucPassword @0x20000004 = 0x01;
#elif defined (__CC_ARM)
unsigned char ucPassword __attribute__((at(0x20000000))) = 0x01;
#endif