当前位置:网站首页>QEMU STM32 vscode debugging environment configuration
QEMU STM32 vscode debugging environment configuration
2022-07-05 08:11:00 【Nanbolwan】
QEMU learn STM32
One 、qemu Of STM32 Virtualized environment
List of articles
Preface
The front has been built through efforts QEMU Of STM32 Virtual environment and run Demo. meanwhile , Analysis of the Makefile In fact, you can develop and learn STM32 了 . But the command line adds gdb Debugging program is not convenient , If a worker wants to do a good job, he must sharpen his tools first . Let's do it today VSCode debugging .
One 、gdb Debug embedded programs
Read it carefully Demo programmatic Makefile, My surprise discovery Demo The author provides QEMU
Debugging interface of running program .
# QEMU debug targets
$(QEMU_DBG_TARGETS): %_QEMUDBG : %_ALL
-killall -q qemu-system-arm
$(QEMU_ARM_DIR)qemu-system-arm -M stm32-p103 -gdb tcp::3333 -S -kernel demos/$*/main.bin
$(QEMU_DBG_PTY_TARGETS): %_QEMUDBG_PTY : %_ALL
-killall -q qemu-system-arm
$(QEMU_ARM_DIR)qemu-system-arm -M stm32-p103 -gdb tcp::3333 -S -kernel demos/$*/main.bin -serial pty
$(QEMU_DBG_TEL_TARGETS): %_QEMUDBG_TEL : %_ALL
-killall -q qemu-system-arm
$(QEMU_ARM_DIR)qemu-system-arm -M stm32-p103 -gdb tcp::3333 -S -kernel demos/$*/main.bin -serial tcp::7777,server
We found that gdb The debug port of is tcp::3333, After we run the program , On the command line, you only need to pass gdb From your own computer 3333 Port connection debugging , Try it as shown in the figure below :
Run after entering
Input
target remote localhost:3333
You can start debugging , But you need to input commands to end and run . We are used to being in IDE In the way of mouse debugging , So I searched , Find out VSCode That can be done .
Two 、 To configure VSCode
Time is limited ,ubunut install VSCode The method of is not mentioned here , Here is a direct cut to the topic .
Start by opening VSCode, Switch the working directory to the current project directory , Then press CTRL+SHIFT+D Enter the debugging mode as shown below
stay lannch.json Add the following to the file , You can also directly click Add configuration
{
// Use IntelliSense Learn about properties . // Hover to see the description of an existing property . // For more information , Please visit : https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [
{
"name": "(gdb) start-up ", "type": "cppdbg", "request": "launch", // Our STM32 Program path , It could be an absolute path "program": "${
workspaceFolder}/demos/systick/main.elf", "args": [], "stopAtEntry": false, "cwd": "${
workspaceFolder}", "environment": [], "externalConsole": true, "MIMode": "gdb", // Yours arm-none-eabi-gdb Installation path for "miDebuggerPath": "/usr/bin/arm-none-eabi-gdb", // Debugging on this machine is generally localhost: Port number // If the program is running on another computer or development board ( In embedded linux Often encountered in debugging ) It can be //ip: Port number , for example :192.168.1.123:3333 "miDebuggerServerAddress": "localhost:3333", "setupCommands": [
{
"description": " by gdb Enable neat printing ",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
After configuration, you can run debugging .
First, run the following command on the terminal to start QEMU Loader :
make systick_QEMUDBG_PTY
Then click the debug button to start debugging
It can run at full speed or be debugged in one step , Click in front of the code to add breakpoints , It is very convenient to use .
summary
I am a person who likes to toss , However, I'm really busy at work and have no time to write in detail , It's only for casting bricks to attract jade , It's not very detailed . Now the running environment and development debugging tools are ready , Next I will record my study ARM Compilation and Cortex-M3 The process of . Finally, I hope to realize a simple embedded operating system , It can realize multi task scheduling , I hope the interested students can study together . Of course , Implementing the operating system is a little harder than I thought , I am learning and making progress .
边栏推荐
- Talk about the function of magnetic beads in circuits
- Consul installation
- Process communication mode between different hosts -- socket
- Factors affecting the quality of slip rings in production
- Introduction of air gap, etc
- After installing the new version of keil5 or upgrading the JLINK firmware, you will always be prompted about the firmware update
- C WinForm [get file path -- traverse folder pictures] - practical exercise 6
- Bluetooth hc-05 pairing process and precautions
- Network communication model -- Network OSI tcp/ip layering
- [tutorial 19 of trio basic from introduction to proficiency] detailed introduction of trio as a slave station connecting to the third-party bus (anybus PROFIBUS DP...)
猜你喜欢
List of linked lists
Take you to understand the working principle of lithium battery protection board
Soem EtherCAT source code analysis attachment 1 (establishment of communication operation environment)
C # joint configuration with Halcon
Consul安装
Management and use of DokuWiki
[tutorial 19 of trio basic from introduction to proficiency] detailed introduction of trio as a slave station connecting to the third-party bus (anybus PROFIBUS DP...)
Ble encryption details
DokuWiki deployment notes
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
随机推荐
Naming rules for FreeRTOS
Bluetooth hc-05 pairing process and precautions
[trio basic tutorial 17 from getting started to mastering] set up and connect the trio motion controller and input the activation code
Solutions to compilation warnings in Quartus II
Charge pump boost principle - this article will give you a simple understanding
Shape template matching based on Halcon learning [v] find_ cocoa_ packages_ max_ deformation. Hdev routine
About yolov3, conduct map test directly
Step motor generates S-curve upper computer
Record the opening ceremony of Beijing Winter Olympics with display equipment
Network communication process
Altium designer learning (I)
1-stm32 operation environment construction
Sizeof (function name) =?
Adaptive filter
Network port usage
Problem solving: interpreter error: no file or directory
Shell脚本基本语法
动力电池UL2580测试项目包括哪些
Semiconductor devices (III) FET
Detailed explanation of SQL server stored procedures