找回密碼
 立即注冊(cè)

QQ登錄

只需一步,快速開始

搜索
查看: 324|回復(fù): 1
打印 上一主題 下一主題
收起左側(cè)

嘗試在Ubuntu中使用gcc-arm-none-eabi和標(biāo)準(zhǔn)庫開發(fā)stm32單片機(jī),但是出錯(cuò)了

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
ID:1143673 發(fā)表于 2025-3-10 22:59 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
嘗試在Ubuntu中使用gcc-arm-none-eabi和標(biāo)準(zhǔn)庫開發(fā)stm32單片機(jī),但是報(bào)錯(cuò)了。使用的工具有gcc-arm-none-eabi,cmake,openocd。啟動(dòng)文件和鏈接腳本是在stm32f10x固件庫里面隨便找的,不知道是否是這里出了問題。在stm32f103c8t6最小系統(tǒng)板燒錄了一個(gè)點(diǎn)亮pc13引腳的led的程序,燒錄成功但是燈沒亮,在gdb調(diào)試一直卡在0x20000004。我自己覺得還有一個(gè)可能是在編譯時(shí)出了問題,因?yàn)樵谑褂胏make時(shí)也報(bào)了一些錯(cuò)誤,是文件找不到之類的,但是我后來加上了,然后也沒有報(bào)錯(cuò)。
(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


工程壓縮包附上了。希望有懂的人能夠不吝賜教,我對(duì)這方面不太了解,感謝你們的回復(fù)與幫助。 led.7z (226.13 KB, 下載次數(shù): 0)


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復(fù)

使用道具 舉報(bào)

沙發(fā)
ID:827243 發(fā)表于 2025-3-12 16:19 | 只看該作者
有l(wèi)inux版本stm32cubeide可以用,這個(gè)應(yīng)該方便點(diǎn)。
wwwstcomcn/zh/development-tools/stm32cubeide.html
回復(fù)

使用道具 舉報(bào)

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表