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

2019-07-20 11:43发布

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...
..OBJTemplate.axf: Error: L6266E: RWPI Section anon$$obj.o(PDT$$ptr) cannot be assigned to non-PI Exec region RW_IRAM1.
..OBJTemplate.axf: Error: L6266E: RWPI Section libspace.o(.bss) cannot be assigned to non-PI Exec region RW_IRAM1.
..OBJTemplate.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.
..OBJTemplate.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.
..OBJTemplate.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.
..OBJTemplate.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.
..OBJTemplate.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.
..OBJTemplate.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.
..OBJTemplate.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.
..OBJTemplate.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.
..OBJTemplate.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.
..OBJTemplate.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.
..OBJTemplate.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.
"..OBJTemplate.axf" - 13 Error(s), 1 Warning(s).
Target not created

明明按着视频一步一步来却出现这样的错误,求解答!!
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
4条回答
已解决,在魔术棒C/C++区域把 One ELF Section per Function 和 Read-Write osition independent这两项不勾选,并把在Warings选项里选第一个即可.
zc123
2楼-- · 2019-07-20 18:42
 精彩回答 2  元偷偷看……
embert_solo
3楼-- · 2019-07-20 20:49
回复【3楼】我就知道我的会员名已被使用:
---------------------------
请问这是一个什么错误呢?我也遇到了同样问题
TinyLight
4楼-- · 2019-07-20 23:17
多谢楼主,在移植FreeRTOS时也遇到这样的错误。个人理解“RWPI”应该是Read-Write Position Independent的简写,所以去掉这个就没问题了。

一周热门 更多>