目的
下載安裝包
如果用sudo apt-get remove gcc-arm-none-eabi
安裝的交交叉編程工具,是沒有含GDB工具的,所以需要卸載后才能安裝。
sudo apt-get remove gcc-arm-none-eabi
就可以完成卸載,如果還有在/usr/bin/arm-none-eabi-下面的文件有沖突的,先要刪除才能安裝成功。
安裝包下載網址:Downloads | GNU Arm Embedded Toolchain Downloads – Arm Developer
我的虛擬機是x86的,所以下載以下文件。下載速度很慢的,可以復制鏈接,用下載工具下載。
安裝
我試著按其人的安裝教程,想把文件解壓到/usr/share/目錄下,但是好象不能成功。我所以在/opt/下面新建了gdb文件夾,并修改權限。
然后解壓到這個文件夾下面:
tar -jxvf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 -C /opt/gdb/
最后創建軟件連接到/usr/bin/目錄下面:
sudo ln -s /opt/gdb/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-objcopy /usr/bin/arm-none-eabi-objcopy
sudo ln -s /opt/gdb/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-objdump /usr/bin/arm-none-eabi-objdump
sudo ln -s /opt/gdb/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc
sudo ln -s /opt/gdb/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-g++ /usr/bin/arm-none-eabi-g++
sudo ln -s /opt/gdb/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-gdb /usr/bin/arm-none-eabi-gdb
sudo ln -s /opt/gdb/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-szie /usr/bin/arm-none-eabi-size
sudo ln -s /opt/gdb/gcc-arm-none-eabi-10.3-2021.10/bin/arm-none-eabi-as /usr/bin/arm-none-eabi-as
vscode配置文件
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Cortex Debug",
"cwd": "${workspaceFolder}",
"executable": "./build/AC7802_UART.elf",
"request": "launch",
"type": "cortex-debug",
"configFiles": [
"stlink-v2.cfg",
],
"runToEntryPoint": "main",
"servertype": "pyocd",
"targetId":"ac78022mbqa",
"cmsisPack": "./pack/AutoChips.AC7802x_DFP.1.0.0.pack"
}
]
}
執行調試:
總結
我前面因為gdb沒有安裝成功,后面去下載源碼進行編譯,花了很長的時間,最后在Downloads | GNU Arm Embedded Toolchain Downloads – Arm Developer下載包進行直接解壓,快速方便。
審核編輯:湯梓紅
-
芯片
+關注
關注
453文章
50387瀏覽量
421783 -
ARM
+關注
關注
134文章
9045瀏覽量
366799 -
Linux
+關注
關注
87文章
11225瀏覽量
208911 -
編程
+關注
關注
88文章
3591瀏覽量
93592 -
Ubuntu
+關注
關注
5文章
560瀏覽量
29559
發布評論請先 登錄
相關推薦
評論