|
尝试在Ubuntu中使用gcc-arm-none-eabi和标准库开发stm32单片机,但是报错了。使用的工具有gcc-arm-none-eabi,cmake,openocd。启动文件和链接脚本是在stm32f10x固件库里面随便找的,不知道是否是这里出了问题。在stm32f103c8t6最小系统板烧录了一个点亮pc13引脚的led的程序,烧录成功但是灯没亮,在gdb调试一直卡在0x20000004。我自己觉得还有一个可能是在编译时出了问题,因为在使用cmake时也报了一些错误,是文件找不到之类的,但是我后来加上了,然后也没有报错。
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0x20000004 in completed ()
(gdb) n
Single stepping until exit from function completed.1,
which has no line number information.
halted: PC: 0x20000004
halted: PC: 0x20000004
halted: PC: 0x20000004
halted: PC: 0x20000004
halted: PC: 0x20000004
halted: PC: 0x20000004
halted: PC: 0x20000004 (gdb) load STM32Project.elf
Loading section .text, size 0x174 lma 0x8000000
Loading section .init_array, size 0x8 lma 0x8000174
Loading section .fini_array, size 0x4 lma 0x800017c
Loading section .data, size 0x4 lma 0x8000180
Start address 0x08000000, load size 388
Transfer rate: 1 KB/sec, 97 bytes/write.
(gdb) info registers pc
pc 0x8000000 0x8000000 <deregister_tm_clones>
(gdb) n
warning: Invalid state, unable to determine sp alias, assuming msp.
Single stepping until exit from function deregister_tm_clones,
which has no line number information.
halted: PC: 0x08000002
halted: PC: 0x08000004
halted: PC: 0x08000006
halted: PC: 0x0800000e
halted: PC: 0x20000004
0x20000004 in completed () 编译成功后有警告
[ 96%] Building C object CMakeFiles/STM32Project.elf.dir/src/system_stm32f10x.c.o
[100%] Linking C executable STM32Project.elf
/home/cien/桌面/gcc-arm-tool/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: warning: cannot find entry symbol Reset_Handler; defaulting to 08000000
/home/cien/桌面/gcc-arm-tool/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: warning: STM32Project.elf has a LOAD segment with RWX permissions 工程压缩包附上了。希望有懂的人能够不吝赐教,我对这方面不太了解,感谢你们的回复与帮助。
led.7z
(226.13 KB, 下载次数: 2)
|
|