yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
MSPM0G3507 Development Board📖
1. Introduction to MSPM0
  • 1. Introduction to MSPM0
2. Development environment construction
  • 01.CCS Theia Development
  • 02.MDK Arm Development
  • 03.UniFlash Downloader
  • 04.DAP-LINK download program
  • 05.Program simulation and debugging
  • 06.Engineering transplantation
3. Keil basic case
  • 1. Turn on the LED light
  • 2. System delay
  • 3. Button control
  • 4. External interruption
  • 5. Serial communication
  • 6. Timer
  • 7. PWM breathing light
  • 8. ADC acquisition
  • 9. DMA transfer
  • 10. Get MPU6050 data (I2C)
  • 11. LCD Display (SPI)
4. CCS basic case
  • 1. Turn on the LED light
  • 2. System delay
  • 3. Button control
  • 4. External interruption
  • 5. Serial communication
  • 6. Timer
  • 7. PWM breathing light
  • 8. ADC acquisition
  • 9. DMA transfer
  • 10. Get MPU6050 data (I2C)
  • 11. LCD Display (SPI)
5. MSPM0 Robot Expansion Board
  • 1. MSPM0 Robot Expansion Board Introduction
  • 2. Custom Buttons
  • 3. Drive Buzzer
6.MSPM0-K230 Vision Application Module
  • 1.k230 color recognition
  • 2.k230 barcode recognition
  • 3.k230 QR code recognition
  • 4.k230Apriltag code recognition
  • 5.k230DM code recognition
  • 6.k230 face detection
  • 7.k230 gaze direction
  • 8.k230 face recognition
  • 9.k230 human body detection
  • 10.k230 fall detection
  • 11.k230 palm detection
  • 12.k230 gesture recognition
  • 13.k230OCR character recognition
  • 14.k230 object detection
  • 15.k230 target tracking
  • 16.k230 self-learning object recognition
  • 17.k230 license plate recognition
7. MSPM0-K210Vision module application
  • 0.Prerequisites for K210 as a coprocessor
  • 1.MSPM0_K210 color recognition
  • 2.MSPM0_K210 barcode recognition
  • 3.MSPM0_K210 QR code recognition
  • 4.MSPM0_K210 mechanical code recognition
  • 5.MSPM0_K210 face detection
  • 6.MSPM0_K210 facial feature detection
  • 7.MSPM0_K210 mask detection
  • 8.MSPM0_K210 face recognition
  • 9.MSPM0_K210 Object Detection
  • 10.MSPM0_K210 Self-study classification
  • 11.MSPM0_K210 handwritten digit recognition
8. Expansion casenew
  • 1.Autonomous driving car
  • 2.Vehicle-mounted balance ball motion control system
Download
  • Code
  • Hareware_Info
  • Software_Tools
  • Communication Protocol
Download ZIP

Welcome to MSPM0G3507 Development Board repository

05.Program simulation and debugging

Program simulation and debugging

Program simulation and debuggingSoftware configurationDebug operationDebug tool introductionCommon debugging operations

Keil is a simulation software with great potential. You can quickly solve the problems in code running and determine the location of the problem through debugging. You can check many hardware-related registers and observe the changes in the values ​​of these registers to know whether the code is running normally. This can avoid frequent downloading of programs and extend the life of the microcontroller Flash.

This tutorial uses DAP-LINK for simulation. If you don’t have hardware equipment, you need to buy it yourself.

The basic simulation debugging operation is divided into two steps:

Software configuration

The configuration process is the same as using DAP-LINK to burn.

Debug operation

Click the debug icon to enter the debugging interface.

image-20241118194204770

Debug tool introduction

From left to right

img

1: Reset

As the name suggests, reset means to start over again from the beginning. Its function is equivalent to pressing the reset button on the hardware, which is equivalent to a hard reset. After pressing the button, the code will be executed again from the beginning.

2: Execute to breakpoint

Press this button to quickly execute to the breakpoint. Sometimes you don’t need to watch how each step is executed. You just want to quickly execute to a certain place in the program to see the result. Pressing this button can satisfy your wish. Of course, the premise is that the breakpoint has been set at the viewing location.

3: Stop running

This button becomes valid only when the program is executed all the time, and it can stop the program and enter the single-step debugging state. Instantly stop the program.

4: Single-step debugging (enter function)

In simple terms, this button enters a function. Of course, if there is no function, it is equivalent to the execute button.

5: Step-by-step debugging (skip function)

When you encounter a function, you can use this button to step through the function without entering it. In short, it skips the function and does not execute it.

6: Jump out of debugging (jump out of function)

When you enter the single-step debugging of the function, sometimes you may not need to execute the rest of the function. Through this button, you can directly execute the rest of the function in one step and jump out of the function to the location where the function is called.

7: Execute to cursor

This button can quickly run the program to the cursor, which is similar to the function of the execute to breakpoint button.

8: Display the line of code being executed

The following is a menu added to the debug mode

9: Command display window

10: Disassembly window

This button can view the assembly code, which is very useful for analyzing the program.

11: Module Window

12: Register Window

13: Called Function Stack Window

This button can be used to display the Call Stack+Locals window, which displays the local variables and their values ​​of the current function for easy viewing.

14: View (Variable) Window

MDK5 provides 2 observation windows (pull-down selection). When this button is pressed, a window showing variables pops up. Enter the variable or expression you want to observe to view its value. It is a very commonly used debugging window.

15: Memory Window

MDK5 provides 4 memory viewing windows. When the button is pressed, a memory viewing window pops up. You can enter the memory address you want to view in it, and then observe the changes in this piece of memory.

16: Serial UART Window

MDK5 provides 4 serial port printing windows. Press this button to pop up a window similar to the serial port debugging assistant interface to display the content printed from the serial port.

17: Logic Analyzer Window

There are 3 options under this icon. Generally, the first one, which is the logic analysis window, is used. Use the SETUP button to create some new IO ports, so you can observe the level changes of these IOs and display them in various forms, which is more intuitive.

18: Tracking window

19: System (peripheral IO, USART, TIM, etc.) window

This button can provide a viewing window for various peripheral registers (selected by pull-down). Select the corresponding peripheral to call up the relevant register table of the peripheral and display the values ​​of these registers, so that you can easily check whether the settings are correct.

20: Toolbox window

Common debugging operations

  1. Add an observation window

Add an observation window for the observed variable (position the cursor on the variable, right-click and select Add "start_flag to..."------>Watch1)

img

  1. Set breakpoints

After setting breakpoints, you can debug step by step and observe the program running results

img

Generally, the program runs without errors, but the corresponding effect is not observed after downloading. You can set breakpoints from the beginning of the main function to see if the expected effect is achieved, execute to the corresponding function, and whether the changes in variables are consistent with expectations. For more debugging methods, you can learn from Baidu.

DAP-LINK download program
Engineering transplantation

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文