在Ubntu16.04_64位下建立STM32F4在Eclipse中的开发环境 (Beta1.0)
核心工具:CMSIS-DAP+OpenOCD+ARM-NONE-EABI+ORACLE-JDK8+Eclipse(CDT+GNU-ARM-Plugin)
方法多种多样,大家可以参考下文,利用其它方式配置环境:
OpenOCD+GDB Makefile STlink Jlink 都是可以的~
注意事项:
1.这份教程是1.0版本的,有诸多细节需要完善,发布的目的是想大家共同完善它!该教程配置的环境仅有debug功能,最终计划是能够在Eelipse中完成:编译、下载、调试、运行于目标板。
2.This tutorial have a problem about how to bulid Reg View Window for debugger.
3.Note your folder/files path when you configuration your environment.
4.I will continue to improve my tutorial,i hope you can help me!
5.如果有什么地方不正确请帮助我纠正.
6.If you have any questions,please contact me!
From:UltraFire
本文最终完成感谢:秉火论坛“大山一座”,在前期开工时找到他的文章,但是未能成功,随后在他指点下,自行Google了大部分内容,完善了细节,完成了本指南。
因为需求问题原版是英文,没空再译回中文,希望大家自行翻译回去,语法如有错误请见谅。衷心希望大伙一起努力完善它,造福下一代!
Step 1:
arm-none-eabi(ARM
Toolchains For Linux) Install:
URL:
【The official complete package contains the GDB tools that do not need to be installed separately】
https://launchpad.net/gcc-arm-embedded/+download
https://launchpad.net/gcc-arm-embedded
Download the “gcc-arm-none-eabi-version-linux.tar.bz2”package.
2.uncompress“gcc-arm-none-eab_Version” folder【Folder name is:ARMToolchains】
3.Configuration the system environment variable:
Command:
echo PATH=$PATH:/opt/ARMToolchains/gcc-arm-none-eabi-5_4-2016q3/bin
echo PATH=$PATH:/opt/ARMToolchains/gcc-arm-none-eabi-5_4-2016q3/bin >> $HOME/.bashrc
Update the configuration:
Command:
source $HOME/.bashrc
4.when the configuration is complete.
run this Command:”arm-none-eabi-gcc -version”
when you see the version number in terminal,it’s working!
Step 2:
Ubuntu16.04 install the Oracle-openjdk(for eclipse):
Command:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
Command:
sudo apt-get install oracle-java8-installer
3.Select the jdk version you need.Command:
sudo update-alternatives --config java
sudo update-alternatives --config javac
Select the correct version.
Step 3:
Ubuntu16.04_64bit
install 32bit support:
Command:
dpkg --print-architecture
You will see this message in terminal:
amd64
it prove you have 64bit architecture Kernel.
2.Now you need open multi architecture support:
(multi architecture support can let you use 32bit lib in 64bit lib)
Command:
dpkg --print-foreign-architectures
You will see this message in terminal:
i386
if you don’t have this message you need open the multi architecture.
Command:
sudo dpkg --add-architecture i386
sudo apt -get update
Then Command:
sudo apt-get dist-upgrade
it will check the architecture.if you already have i386 it will ask you update,otherwise install i386 architecture.
Step 4:
Configuration the Eclipse in Ubuntu64_bit:
In folder,creat eclipse.sh flie and input these Command:
#!/bin/bash
export UBUNTU_MENUPROXY=0
/pwd/eclipse/eclipse
Command:
Sh eclipse.sh(tips:Note the file permissions)
2.Install the ARM plugin in Eclipse:Open Eclipse,and find “HELP”in menu bar and open the Eclipse Marketplace and search plugin:”GNU ARM Eclipse Plugin”install it.
3.Check Out:When you finishd step 3,open Eclipse click File -> new -> c project -> you will see this picture:
Install onpenocd:
URL:
http://sourceforge.net/projects/openocd/files/openocd/
☆☆☆ Recommend use the apt-get install openocd ☆☆☆
(Auto install have a little different,but more convinient then manual -i)
6.Install the standard configuration uses libusb and ftdl:Command:
sudo apt-get install libusb-dev libusb-1.0-0-dev libftdi-dev libftdi1
7.When you installed you need do some test.This step need you connect your debug device with stm32f4 board.(My device is:CMSIS-DAP+STM32F407ZET6)
Connect Command:
Sudo openocd –f /user/share/openpcd/scripts/interface/cmsis-dap.cfg –f /user/share/openpcd/scripts/target/stm32f4x.cfg
If you see this message in your terminal:
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
It prove your connect is successful!
8.Click your menu bar:
Run → External Tools → External Tools configurations..
When you configuration is complete,
click Apply → Run.
If you set successful,you will see the red message like this:
9.Debug Configurations
Creat a new menu under “GDB Hardware Debug”,and reference these picture to configuratopm:
In main menu:
In Debugger menu:
In starup menu:
In common menu:
Future start-up
steps should be:
1.Use External
Tools.
2.Debug
Configuration → Run GDB Hardware Debugging
This image shows the success of the boot information,and then you can use Eclipse to debug on STM32F4 board:
Step 5:
Install the regview:
(something wrong with this step,maybe the VPN configuration,please help to solve this problem)
http://embsysregview.sourceforge.net/update-beta
Final Step:
Now you already Build The Eclipse Development Environment For STM32F4 On Ubuntu16.04_64bit
Jone 2017/01/20