Debugging method under flash:
1. Open the project to be debugged, right-click options for target on the left column. Enter debug and select jlink.
2. Select jlink in utility.
3. Use JLINK to connect the PC and the development board, and turn on the power of the development board. Enter the settings next to it and add the flash burning method.
4. Go back and rebuild, press ctrl+F5 to enter debugging, you can single-step and breakpoint. According to ST's reference manual 2.3.3 embedded flash, the address of flash starts from 0x0800 0000. In the debugging window, you can see that the address of the assembly starts with 0x0800, which means that the code segment is burned into the flash.
Debugging method under SRAM:
1. Copy the ram.ini file D:\Keil\ARM\Boards\Keil\MCBSTM32\STLIB_Blinky in the Keil installation directory to the project directory to be debugged, and change the file to be loaded to the location and name of the AXF file of the project to be debugged. Here, the project is GPIO.
2. According to reference manual 2.3.1, the starting address of SRAM is 0x2000 0000. To put the code segment into SRAM, you must set the program read-only segment to start from the beginning of SRAM, and after a certain length (here set to 0X4000), the data segment RAM starts. Note that the length at both ends cannot exceed the total size of SRAM.
3. Follow the same steps 1 and 2 as in flash debugging, but select jlink.
4. Add ram.ini under debug page.
5. Choose not to erase the flash and modify the location and size of the code and data segments.
6. OK all the way, rebuild, ctrl+F5 to enter debugging. You can single-step, step in and breakpoint. Look at the location of the assembly code, it starts with 0x2000, indicating that the program is running in SRAM.
In addition, check the .sct file in the project directory as follows.
LR_IROM1 0x20000000 0x00004000 { ; load region size_region
ER_IROM1 0x20000000 0x00004000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_IRAM1 0x20004000 0x00004000 { ; RW data
.ANY (+RW +ZI)
}
}
This indicates that the program has indeed been configured into the SRAM space.
Previous article:Why do we need to add PRESERVE8 before the ARM assembler?
Next article:STM32 RTC Summary
Recommended ReadingLatest update time:2024-11-16 21:27
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 4 termination methods to teach you how to perfectly solve signal termination confusion
- Next, let's discuss whether the polished chips are real or fake.
- Miscellaneous thoughts at home
- How to Make DSP Digital Oscillator Generate Phase-Shifted Sine Wave
- Newbie asks for advice on STC89c54RD+, RAM access value application
- The problem of sensor sampling value software returning to zero
- SPI receive and send function program
- Teardown of fake Macbook charger: Convincing on the outside, dangerous on the inside
- A comprehensive look at Sub-6Ghz massive MIMO infrastructure
- Detailed explanation of the schematic diagram of each part of the flyback switching power supply UC3842 protection circuit