未解之谜-暂时走到这里

#ifndef _XMODEM_H_
#define _XMODEM_H_

#include <stdint.h>


//#pragma section ="__component_init" 
// unrecognized #pragma KEIL不支持!
// mdk有自己定义栈的方式!你百度下stm32的启动代码,了解下就明白了!
// http://www.keil.com/support/docs/2053.htm

//http://bbs.21ic.com/icview-393406-1-1.html?fromuser=
//http://bbs.21ic.com/icview-1722624-1-1.html
//https://www.cnblogs.com/qiyuexin/p/9026365.html
//uint16_t RmtCtrlCodeBuf[2048]__attribute__((at(0x20004000),used,zero_init));
#define SELECT  __attribute__ ((unused,section("u_boot_cmd")))
//可以编译通过但是 如何定下section("u_boot_cmd")呢?
int xmodemReceive(unsigned char *dest, int destsz)  ;
#endif


https://blog.csdn.net/olishutong/article/details/78816408
此文牛逼
可以在.C中成功
int value __attribute__((section(".ARM.__at_0x20000000"))) = 0x33;
const char ziku[] __attribute__((section(".ARM.__at_0x00001000")))   = {0x1, 0x2, 0x3};
void func (void) __attribute__((section(".ARM.__at_0x00000100")));

https://blog.csdn.net/zczx29/article/details/81300514
此文牛逼
#pragma arm section code=".ARM.__at_0x8100000"

void task(void)

{

}

#pragma arm section

这样函数 task 会被链接到 0x8100000 地址.

按照这个思路做:
每个模块最后
#pragma arm section code=".ARM.__at_0x8100000"
XXXX
#pragma arm section

猜你喜欢

转载自blog.csdn.net/weixin_42381351/article/details/89182370