OpenEdv-开源电子网

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

创建固件库工程模板时的遇到的错误

[复制链接]

26

主题

64

帖子

0

精华

初级会员

Rank: 2

积分
190
金钱
190
注册时间
2015-7-24
在线时间
0 小时
发表于 2015-7-27 00:02:21 | 显示全部楼层 |阅读模式
5金钱
Build target 'Template'
compiling main.c...
main.c(38): warning:  #1-D: last line of file ends without a newline
  }
main.c: 1 warning, 0 errors
compiling stm32f4xx_it.c...
compiling system_stm32f4xx.c...
compiling misc.c...
compiling stm32f4xx_adc.c...
compiling stm32f4xx_can.c...
compiling stm32f4xx_crc.c...
compiling stm32f4xx_cryp.c...
compiling stm32f4xx_cryp_aes.c...
compiling stm32f4xx_cryp_des.c...
compiling stm32f4xx_cryp_tdes.c...
compiling stm32f4xx_dac.c...
compiling stm32f4xx_dbgmcu.c...
compiling stm32f4xx_dcmi.c...
compiling stm32f4xx_dma.c...
compiling stm32f4xx_dma2d.c...
compiling stm32f4xx_exti.c...
compiling stm32f4xx_flash.c...
compiling stm32f4xx_flash_ramfunc.c...
compiling stm32f4xx_fsmc.c...
compiling stm32f4xx_gpio.c...
compiling stm32f4xx_hash.c...
compiling stm32f4xx_hash_md5.c...
compiling stm32f4xx_hash_sha1.c...
compiling stm32f4xx_i2c.c...
compiling stm32f4xx_iwdg.c...
compiling stm32f4xx_ltdc.c...
compiling stm32f4xx_pwr.c...
compiling stm32f4xx_rcc.c...
compiling stm32f4xx_rng.c...
compiling stm32f4xx_rtc.c...
compiling stm32f4xx_sai.c...
compiling stm32f4xx_sdio.c...
compiling stm32f4xx_spi.c...
compiling stm32f4xx_syscfg.c...
compiling stm32f4xx_tim.c...
compiling stm32f4xx_usart.c...
compiling stm32f4xx_wwdg.c...
assembling startup_stm32f40_41xxx.s...
linking...
..\OBJ\Template.axf: Error: L6266E: RWPI Section anon$$obj.o(PDT$$ptr) cannot be assigned to non-PI Exec region RW_IRAM1.
..\OBJ\Template.axf: Error: L6266E: RWPI Section libspace.o(.bss) cannot be assigned to non-PI Exec region RW_IRAM1.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(RESET) cannot use the address of 'RWPI (R9 used as SB)' function NMI_Handler as the image contains 'USESV6 (R9 used as V6)' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(RESET) cannot use the address of 'RWPI (R9 used as SB)' function HardFault_Handler as the image contains 'USESV6 (R9 used as V6)' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(RESET) cannot use the address of 'RWPI (R9 used as SB)' function MemManage_Handler as the image contains 'USESV6 (R9 used as V6)' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(RESET) cannot use the address of 'RWPI (R9 used as SB)' function BusFault_Handler as the image contains 'USESV6 (R9 used as V6)' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(RESET) cannot use the address of 'RWPI (R9 used as SB)' function UsageFault_Handler as the image contains 'USESV6 (R9 used as V6)' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(RESET) cannot use the address of 'RWPI (R9 used as SB)' function SVC_Handler as the image contains 'USESV6 (R9 used as V6)' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(RESET) cannot use the address of 'RWPI (R9 used as SB)' function DebugMon_Handler as the image contains 'USESV6 (R9 used as V6)' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(RESET) cannot use the address of 'RWPI (R9 used as SB)' function PendSV_Handler as the image contains 'USESV6 (R9 used as V6)' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(RESET) cannot use the address of 'RWPI (R9 used as SB)' function SysTick_Handler as the image contains 'USESV6 (R9 used as V6)' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(.text) cannot use the address of 'RWPI (R9 used as SB)' function SystemInit as the image contains 'USESV6 (R9 used as V6)' functions.
..\OBJ\Template.axf: Error: L6241E: startup_stm32f40_41xxx.o(.text) cannot use the address of 'RWPI (R9 used as SB)' function __main as the image contains 'USESV6 (R9 used as V6)' functions.
Finished: 0 information, 0 warning and 13 error messages.
"..\OBJ\Template.axf" - 13 Error(s), 1 Warning(s).
Target not created

明明按着视频一步一步来却出现这样的错误,求解答!!

最佳答案

查看完整内容[请看2#楼]

已解决,在魔术棒C/C++区域把 One ELF Section per Function 和 Read-Write osition independent这两项不勾选,并把在Warings选项里选第一个即可.
M4小白菜,求各位大牛多多指导
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

26

主题

64

帖子

0

精华

初级会员

Rank: 2

积分
190
金钱
190
注册时间
2015-7-24
在线时间
0 小时
 楼主| 发表于 2015-7-27 00:02:22 | 显示全部楼层
已解决,在魔术棒C/C++区域把 One ELF Section per Function 和 Read-Write osition independent这两项不勾选,并把在Warings选项里选第一个即可.
M4小白菜,求各位大牛多多指导
回复

使用道具 举报

3

主题

400

帖子

1

精华

金牌会员

Rank: 6Rank: 6

积分
1754
金钱
1754
注册时间
2015-6-11
在线时间
310 小时
发表于 2015-7-27 10:17:16 | 显示全部楼层
你这应该是启动文件有错误,你要上传你的文件看看,不然单从错误怎么看
回复

使用道具 举报

0

主题

1

帖子

0

精华

新手入门

积分
21
金钱
21
注册时间
2015-9-19
在线时间
0 小时
发表于 2015-11-8 12:26:39 | 显示全部楼层
回复【3楼】我就知道我的会员名已被使用:
---------------------------
请问这是一个什么错误呢?我也遇到了同样问题
回复

使用道具 举报

0

主题

26

帖子

0

精华

中级会员

Rank: 3Rank: 3

积分
200
金钱
200
注册时间
2017-3-20
在线时间
64 小时
发表于 2017-9-28 22:12:45 | 显示全部楼层
多谢楼主,在移植FreeRTOS时也遇到这样的错误。个人理解“RWPI”应该是Read-Write Position Independent的简写,所以去掉这个就没问题了。
回复

使用道具 举报

0

主题

6

帖子

0

精华

新手上路

积分
28
金钱
28
注册时间
2019-5-14
在线时间
7 小时
发表于 2019-7-27 16:46:12 | 显示全部楼层
如果采用这些方法你都消除不了,那是因为你选用的工程模板的头文件和函数是在库函数文件模板去找出来的,所以需要认真看视频
回复

使用道具 举报

0

主题

6

帖子

0

精华

初级会员

Rank: 2

积分
120
金钱
120
注册时间
2019-12-25
在线时间
22 小时
发表于 2020-8-12 00:00:08 | 显示全部楼层
我也是这样的问题,去掉楼主上面所讲的编译没问题
回复

使用道具 举报

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

本版积分规则



关闭

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

正点原子公众号

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

GMT+8, 2025-4-30 16:48

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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