当前位置:网站首页>Establish a j-link GDB cross debugging environment for Px4
Establish a j-link GDB cross debugging environment for Px4
2022-06-26 00:50:00 【Blue sky】
Version Description
1. Self driving instrument :Holybro Of Pixhawk 4.
2. PX4 edition :1.13
3. The host machine :Thinkpad The notebook +Ubuntu 20.04.2 LTS
4. J-Link Software :V760
5. J-Link Hardware :J-Link EDU mini. You can buy it on Taobao ,170 yuan , The things you buy are shown in the figure below :

One . Hardware interface
1.1 J-Link EDU mini Interface and Pixhawk 4 Debug Definition of mouth
Reference resources px4 Official website :
SWD (JTAG) Hardware Debugging Interface | PX4 User Guide
1.1.1 J-Link EDU mini Of 10 Pin interface definition

1.1.2 J-Link EDU mini And SWD Connection diagram
SWD yes ARM A defined debugging interface ,Serial Wire Debug (SWD)

1.1.3 Pixhawk 4 Yes IO Debug Interface and FMU Debug Definition of interface
PIXHAWK 4 There are two Debug Port, One is IO Debug Port, The other is FMU Debug Port. Both ports provide Pixhawk standard 6-Pin SH Debug Port.(6 The needle )

1.2 Pixhawk 4 Of IO Debug Port And J-Link EDU mini Mouth connection
Connection sequence description :
Refer to the official website :
SWD (JTAG) Hardware Debugging Interface | PX4 User Guide
Compare with the above 1,J-Link EDU mini10 Needle mouth definition and PIXHAWK 4 IO debug mouth 6 The connection of the needle is as follows :
IO Debug Port | J-Link Mini |
|---|---|
1 Vtref | 1 |
2 TX | - |
3 NC | - |
4 SWDIO | 2 |
5 SWDCLK | 4 |
6 GND | 3 perhaps 5 |
Cable description :
Pixhawk 4 Of debug port have 6 The pin socket is shown in the figure below :

Need to adopt 6 The pin cable is connected to it ,Pixhawk 4 There is this wire in the wire package , You can do two , One used in IO debug mouth , The other is used in FMU Debug mouth . In addition, you can also buy from Dejie , website : Dejie Electronics
A06SR06SR30K152A JST Sales America Inc. | Cable Assemblies | DigiKey

End to end pixhawk, The other end needs to be connected J-Link
J-Link Terminal 10 The pin sockets are as follows :

The outgoing cable is connected by J-Link The manufacturer provides . Need to put J-Link EDU mini Outgoing 10 Pin The arrangement of wires shall be in accordance with the above line sequence Pixhawk 4 Provided 6 The pin cable is welded together ( Just connect 4 Root line ), Due to the small spacing , So welding is a delicate job . The appearance after welding is shown in the figure , The solder joint is wrapped with green electrical tape .

Two . Software part
2.1 install SEGGER JLink Software
Open the following page
SEGGER - The Embedded Experts - Downloads - J-Link / J-Trace
stay Linux Select download... From the options 64-bit DEB Installer software package , The package will be downloaded to Downloads Directory ,
The downloaded file name is as follows JLink_Linux_V760h_x86_64.deb, Install this .deb software package :
sudo dpkg -i ~/Downloads/JLink_Linux_V760h_x86_64.deb
After executing this order , The contents of the software package will be stored in /usr/bin Directory . This is a global installation , That is to say, it can be executed anywhere JLink The supplied is installed on /usr/bin Binary program in .
2.2 function JLink GDB Server
Carry out orders :JLinkGDBServerExe, The graphical interface will pop up :

In this interface, you need to fill in ,
Connection to J-Link:USB(Pixhawk It's through USB Connected to the host )
Target device:STM32F765II( This is you Pixhawk In board FMU The use of CPU model )
Target interface:SWD(Pixhawk The connection mode with the host is SWD)
speed:Auto Selection
And then click OK Button .
Accept the requirements of the copyright statement , Don't forget , This is a very cheap debugging tool for Education .

The interface is GDB Server Interface , so :
GDB: Waiting for connection( explain GDB Server Is waiting for GDB Connection of the client )
J-Link:Connected( explain J-Link The hardware connection between the host and the target has been established )
2.3 function GDB, debugging px4 Software
Open a new window , Enter into PX4-Autopilot Catalog , Run the following command :
arm-none-eabi-gdb build/px4_fmu-v5_default/px4_fmu-v5_default.elf
stay gdb At the prompt , Carry out orders :
gdb>target remote localhost:2331
At this time can be in JLink GDB Server You can see it in the interface GDB Server And GDB The client has established a connection . stay gdb Client interface ,gdb take PX4 The program stops somewhere , Waiting for execution gdb command , You can execute continue Order to let PX4 Run up , use CTRL-C To interrupt the operation of a program ,PX4 The operating status of the can be found in JLink GDB Server Observation in the interface .
边栏推荐
- Display unassigned virtual address after easyconnect connection
- Solution to component stele in SMT chip processing
- idea设置mapper映射文件的模板
- Middle order clue binary tree
- Law and self-regulation in the meta universe
- 实现异步的方法
- 渗透工具-Burpsuite
- Compile the telegraph desktop side (tdesktop) using vs2022
- 86. (cesium chapter) cesium overlay surface receiving shadow effect (gltf model)
- SSL unresponsive in postman test
猜你喜欢

idea设置mapper映射文件的模板

Preordered clue binary tree

After being trapped by the sequelae of the new crown for 15 months, Stanford Xueba was forced to miss the graduation ceremony. Now he still needs to stay in bed for 16 hours every day: I should have e

机器视觉:照亮“智”造新“视”界

leetcode.14 --- 最长公共前缀

Core ideas of SQL optimization

Anaconda beginner's notes

86. (cesium chapter) cesium overlay surface receiving shadow effect (gltf model)

Daily question brushing record (IV)

Camkiia et gcamp6f sont - ils les mêmes?
随机推荐
Learn to identify follow-up questions in dialogue Q & A
Atlas200dk brush machine
"Method not allowed", 405 problem analysis and solution
Qt之自定义带游标的QSlider
Mining pit record of modified field information in Dameng database
认识map
1-10Vmware构建自定义的网络架构
Qt优秀开源项目之九:qTox
Penetration tool -burpsuite
MySQL custom function instance
“Method Not Allowed“,405问题分析及解决
QT custom QSlider with cursor
How to bypass SSL authentication
Preordered clue binary tree
Causes and solutions to the phenomenon of PCBA monument in SMT patch processing
Idea kotlin version upgrade
CaMKIIa和GCaMP6f是一样的嘛?
1-11Vmware虚拟机常见的问题解决
性能领跑云原生数据库市场!英特尔携腾讯共建云上技术生态
Why do we need to make panels and edges in PCB production