yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
MSPM0G3519 Development Board📖
1. Introduction to MSPM0
  • 1. Introduction to MSPM0
2. Development environment construction
  • 1. CCS Theia Development
  • 2. MDK Arm Development
  • 3. UniFlash Downloader
  • 4. DAP-LINK download program
  • 5. Program Simulation and Debugging
  • 6. 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-K230Vision module application
  • 1. K230 Color Recognition
  • 2. K230 Barcode Recognition
  • 3. K230 QR Code Recognition
  • 4. K230 Apriltag Code Recognition
  • 5. K230 DM 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. K230 OCR 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. K210 Prerequisites For Making A Coprocessor - Must-see
  • 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 case
  • 1. Autonomous Driving Car
  • 2. Vehicle-mounted Balance Ball Motion Control System
Download
  • Code
  • Hardware_Info
  • Software_Tools
Download ZIP

Welcome to MSPM0G3519 Development Board repository

5. Program Simulation and Debugging

Program Simulation and Debugging

Program Simulation and DebuggingSoftware ConfigurationDebug OperationsDebug Tools IntroductionCommon Debugging Operations

Keil, as a simulation software with great potential, can quickly solve code execution problems through debug, locate the position where problems occur, and view many hardware-related registers. By observing changes in these register values, you can determine if the code is running normally. This avoids frequent program downloads and extends the microcontroller Flash lifespan.

This tutorial uses DAP-LINK for simulation. If you do not have hardware, you need to purchase it yourself.

Keil5 basic simulation and debugging operations are divided into two steps:

Software Configuration

The configuration process is the same as using DAP-LINK for flashing.

 

Debug Operations

Click the debug icon to enter the debugging interface.

image-20241118194204770

 

Debug Tools Introduction

From left to right

img

1: Reset

As the name suggests, reset means starting over from the beginning. Its function is equivalent to pressing the hardware reset button, essentially performing a hard reset. After pressing this button, the code will start executing from the beginning.

2: Run to Breakpoint

Press this button to quickly execute to the breakpoint. Sometimes you don't need to watch how each step executes - you just want to quickly execute to a certain point in the program to see the results. Pressing this button can fulfill your wish, of course, the prerequisite is that a breakpoint has been set at the location you want to view.

3: Stop Running

This button only becomes effective when the program is continuously executing. It can stop the program and enter single-step debugging mode. Instantly puts the program in a stopped state.

4: Single-Step Debugging (Step Into)

Simply put, this button is used to step into a function. Of course, if there is no function, it is equivalent to the step-over button.

5: Step Over (Skip Function)

When encountering a function, you can use this button to single-step through the function without entering the function for single-step execution. In short, skip the function without executing it.

6: Step Out (Exit Function)

This button is used when you are in function single-step debugging. Sometimes you may not need to execute the remaining part of the function. By pressing this button, you can directly execute the remaining part of the function in one step and exit the function back to where the function was called.

7: Run to Cursor

This button can quickly run the program to the cursor position, similar to the Run to Breakpoint button.

8: Show Currently Executing Code Line

The following are debugging mode added menus

9: Command Display Window

10: Disassembly Window

Through this button, you can view assembly code, which is very useful for analyzing programs.

11: Module Window

12: Register Window

13: Called Function Stack Window

Through this button, you can display the Call Stack+Locals window, showing local variables of the current function and their values for easy viewing.

14: Watch (Variables) Window

MDK5 provides 2 watch windows (dropdown selection). Pressing this button pops up a window for displaying variables. Enter the variable or expression you want to watch to view its value. This is a commonly used debugging window.

15: Memory Window

MDK5 provides 4 memory viewing windows. Press the button to pop up a memory viewing window. You can enter the memory address you want to view, then observe changes in this memory area.

16: Serial UART Window

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

17: Logic Analyzer Window

This icon has 3 options below. The first one is usually used, which is the logic analyzer window. Through the SETUP button, you can create some IO pins, so you can observe level changes on these IO pins and display them in various forms, which is quite intuitive.

18: Trace Window

19: System (Peripheral IO, USART, TIM, etc.) Window

This button can provide various peripheral register viewing windows (selected through dropdown). Select the corresponding peripheral to bring up the relevant register table for that peripheral and display the values of these registers for easy viewing to confirm if settings are correct.

20: Toolbox Window

 

Common Debugging Operations

  1. Add Watch Window

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

img

  1. Set Breakpoint

After setting a breakpoint, you can single-step debug and observe the program execution result.

img

Generally, if the program runs without errors but the expected effect is not observed after downloading, you can set a breakpoint from the beginning of the main function to see if it executes as expected, and whether variable changes match expectations. For more debugging methods, you can search and learn online.

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/中文