目的
在linux下面安裝arm交叉編譯工具,實(shí)現(xiàn)下載、調(diào)試
下載安裝包
如果用sudo apt-get remove gcc-arm-none-eabi
安裝的交交叉編程工具,是沒有含GDB工具的,所以需要卸載后才能安裝。
sudo apt-get remove gcc-arm-none-eabi
就可以完成卸載,如果還有在/usr/bin/arm-none-eabi-下面的文件有沖突的,先要刪除才能安裝成功。
安裝包下載網(wǎng)址:Downloads | GNU Arm Embedded Toolchain Downloads – Arm Developer
我的虛擬機(jī)是x86的,所以下載以下文件。下載速度很慢的,可以復(fù)制鏈接,用下載工具下載。
安裝
我試著按其人的安裝教程,想把文件解壓到/usr/share/目錄下,但是好象不能成功。我所以在/opt/下面新建了gdb文件夾,并修改權(quán)限。
然后解壓到這個文件夾下面:
tar -jxvf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 -C /opt/gdb/
最后創(chuàng)建軟件連接到/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"
}
]
}
執(zhí)行調(diào)試:
總結(jié)
我前面因?yàn)間db沒有安裝成功,后面去下載源碼進(jìn)行編譯,花了很長的時間,最后在Downloads | GNU Arm Embedded Toolchain Downloads – Arm Developer下載包進(jìn)行直接解壓,快速方便。
審核編輯:湯梓紅
-
芯片
+關(guān)注
關(guān)注
455文章
50714瀏覽量
423138 -
ARM
+關(guān)注
關(guān)注
134文章
9084瀏覽量
367382 -
Linux
+關(guān)注
關(guān)注
87文章
11292瀏覽量
209326 -
編程
+關(guān)注
關(guān)注
88文章
3614瀏覽量
93686 -
Ubuntu
+關(guān)注
關(guān)注
5文章
563瀏覽量
29704
發(fā)布評論請先 登錄
相關(guān)推薦
評論