当前位置:网站首页>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 .
边栏推荐
- UEFI development learning 6 - creation of protocol
- C WinForm [help interface - send email] - practice five
- Semiconductor devices (III) FET
- Record the opening ceremony of Beijing Winter Olympics with display equipment
- Sql Server的存储过程详解
- Live555 push RTSP audio and video stream summary (III) flower screen problem caused by pushing H264 real-time stream
- 动力电池UL2580测试项目包括哪些
- Tailq of linked list
- 导电滑环磨损快的原因
- 1-stm32 operation environment construction
猜你喜欢
Soem EtherCAT source code analysis attachment 1 (establishment of communication operation environment)
Record the visual shock of the Winter Olympics and the introduction of the screen 2
Several important parameters of LDO circuit design and type selection
My-basic application 2: my-basic installation and operation
The firmware of the connected j-link does not support the following memory access
Shell脚本基本语法
Arduino uses nrf24l01+ communication
Consul安装
Ble encryption details
Mlperf training v2.0 list released, with the same GPU configuration, the performance of Baidu PaddlePaddle ranks first in the world
随机推荐
IEEE access personal contribution experience record
[cloud native | learn kubernetes from scratch] III. kubernetes cluster management tool kubectl
Shape template matching based on Halcon learning [viii] PM_ multiple_ models. Hdev routine
Summary of SIM card circuit knowledge
Working principle and type selection of common mode inductor
Basic embedded concepts
Classic application of MOS transistor circuit design (2) - switch circuit design
Development tools -- gcc compiler usage
Sql Server的存储过程详解
C, Numerical Recipes in C, solution of linear algebraic equations, LU decomposition source program
[trio basic tutorial 16 from introduction to proficiency] UDP communication test supplement
Summary -st2.0 Hall angle estimation
Soem EtherCAT source code analysis I (data type definition)
C#,数值计算(Numerical Recipes in C#),线性代数方程的求解,LU分解(LU Decomposition)源程序
Problem solving: interpreter error: no file or directory
Record the visual shock of the Winter Olympics and the introduction of the screen 2
Explain task scheduling based on Cortex-M3 in detail (Part 2)
Programming knowledge -- basis of C language
How to excavate and research ideas from the paper
UEFI development learning 6 - creation of protocol