OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 6031|回复: 3

stm32f030,设置中断向量表,编译出错,求大神指教,谢谢

[复制链接]

9

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
87
金钱
87
注册时间
2013-4-25
在线时间
10 小时
发表于 2015-5-2 10:58:00 | 显示全部楼层 |阅读模式
5金钱

#define FLASH_BOOTLOADER_SIZE       (uint32_t)(0x3000)
#define APPLICATION_ADDRESS         (uint32_t)(0x08000000+FLASH_BOOTLOADER_SIZE)

#if   (defined ( __CC_ARM ))
  __IO uint32_t VectorTable[48] __attribute__((at(0x20000000)));
#elif (defined (__ICCARM__))
#pragma location = 0x20000000
  __no_init __IO uint32_t VectorTable[48];
#elif defined   (  __GNUC__  )
  __IO uint32_t VectorTable[48] __attribute__((section(".RAMVectorTable")));
#elif defined ( __TASKING__ )
  __IO uint32_t VectorTable[48] __at(0x20000000);
#endif


uint32_t i = 0;
 /* 设置中断向量表地址 */
 /* Relocate by software the vector table to the internal SRAM at 0x20000000 ***/ 
 /* Copy the vector table from the Flash (mapped at the base of the application
 load address 0x08003000) to the base address of the SRAM at 0x20000000. */
 for(i = 0; i < 48; i++)
 {
      VectorTable = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2));
 }

编译之后报错:.\Objects\zxkj501.axf: Error: L6985E: Unable to automatically place AT section app.o(.ARM.__AT_0x20000000) with required base address 0x20000000. Please manually place in the scatter file using the --no_autoat option.Not enough information to list image symbols.

我的CPU是stm32f030C8T6,有那位大神遇到过吗?怎么解决的呢?非常感谢

正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

25

主题

180

帖子

0

精华

高级会员

Rank: 4

积分
596
金钱
596
注册时间
2015-1-14
在线时间
152 小时
发表于 2015-5-2 11:28:04 | 显示全部楼层
贴代码看看,这样不好弄
回复

使用道具 举报

9

主题

23

帖子

0

精华

初级会员

Rank: 2

积分
87
金钱
87
注册时间
2013-4-25
在线时间
10 小时
 楼主| 发表于 2015-5-2 11:40:15 | 显示全部楼层
回复【2楼】Mrjiang:
---------------------------------
int main(void)
{  
uint32_t i = 0;
/* 设置中断向量表地址 */ 
/* Relocate by software the vector table to the internal SRAM at 0x20000000 ***/  
/* Copy the vector table from the Flash (mapped at the base of the application
load address 0x08003000) to the base address of the SRAM at 0x20000000. */
for(i = 0; i < 48; i++)
{
VectorTable = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i<<2));
}

SystemConfigInition(); //系统初始化
GpsConfigInforInition();   //Gps初始化
ProtocolConfigInforInition();   //协议模块初始化
ModemConfigInition();   //modem初始化

  while(1)
  {
if((OSTime - CurSampleTime) > OS_TICKS_PER_SEC)
{
// 1秒中执行一次
CurSampleTime = OSTime;
DeviceInforSample(); //设备信息采样
AlarmStatCheck(); //告警状态检查
}
if((OSTime - CurSysTime) > 60*OS_TICKS_PER_SEC)
{
//60s查询一次Modem的各种状态
CurSysTime = OSTime;
ModemStatusQuery(); //Modem各种状态查询(包括信号状态、SIM卡注册状态、IP连接状态)
}
ClearWatchDog(); //喂狗
}
}
回复

使用道具 举报

25

主题

180

帖子

0

精华

高级会员

Rank: 4

积分
596
金钱
596
注册时间
2015-1-14
在线时间
152 小时
发表于 2015-5-2 11:51:58 | 显示全部楼层
回复【3楼】lvxinkaiandy:
---------------------------------
回复【3楼】lvxinkaiandy:
---------------------------------
我说的是把你工程传上来  不是弄一点代码
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-22 22:04

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表