1. Programs run in RAM
Key points: (1) Change the download address of the program to the RAM space
(2) Before debugging the program, set the SP and PC pointers to the Ram space.
Create a new project and select the specific model of STM32. I bought Wanli development board and selected stm32f103Vb.
Set the program download address, as shown in the figure below, the address of IROM1 points to the RAM space of STM32.
How to allocate the space depends on your needs. The internal RAM size of this processor is 20K, 16K is allocated to the read-only area, and 4K is allocated to the readable and writable area. In this way, the size of IROM is set to 0x4000, the start of IRAM1 becomes 0X20004000, and the size is only 0X1000.
Select ULINK1 Cortex Debugger in the Debug tab (the software uses the yjgyiysb CC crack method). Unselect Load Application at Start and add the startup script RAM.ini in Initialization.
The specific contents of RAM.ini are as follows:
FUNC void Setup (void) {
SP = _RDWORD(0x20000000); // Setup Stack Pointer
PC = _RDWORD(0x20000004); // Setup Program Counter
_WDWORD(0xE000ED08, 0x20000000); // Setup Vector Table Offset Register
}
LOAD XXX.axf INCREMENTAL // Download, red represents the project file name.axf
Setup(); // Setup for Running
g, main
Uncheck Update Target before Debugging under Utilities
After adding this, you can debug in RAM.
>>>>>>We need to set the correct interrupt vector table location in the code. The interrupt vector table is usually placed at the beginning of the user program, so when running in flash, the vector table is located at 0x08000000, and when the code is placed in SRAM, its location becomes 0x20000000. When initializing NVIC, we can place the following code to define the location of the vector table
NVIC_SetVectorTable(0x20000000, 0x0);
or
NVIC_SetVectorTable(0x08000000, 0x0);
or
?
>>>>>In the Debug item in the project options, in the Download tab, remove all hooks and do not download the code to flash. In this way, you can debug the program in RAM!
2. Debugging in Flash
After creating a new project, the system sets IROM1 as the address and size of FLASH by default. Only two steps are required:
1) Set the debugging tool to ULINK1 CORTEX DEBUGGER, as shown in the figure below. There is no need to set the start script.
2) Select ULINK1 cortex debugger in the Utility and set the programming algorithm, as shown below.
After that, you can debug the FLASH.
Hardware: Wanli's EK-STM32F development board, remove the RS3 and RS4 resistors, and disconnect the emulator of the development board itself.
Software: KEIL MDK3.20+ULINK driver replacement file.
Emulator: ULINK
Previous article:Transplantation and implementation of LwIP TCP/IP protocol stack on embedded real-time operating system uC/0SII
Next article:Design of Embedded IPv6 Firewall Based on S3C2440 Processor
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Innovation is not limited to Meizhi, Welling will appear at the 2024 China Home Appliance Technology Conference
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- The secret to a smaller, quieter, smoother stepper motor system
- Application of wireless transmitter chip A7105 in RF short-distance communication
- Evaluation of domestic FPGA Gaoyun GW1N-4 series development board - use of IP and primitives and use of power analysis tools
- [Talk about Mid-Autumn Festival] Eat mooncakes and chat, and there are also gifts for you!
- [CB5654 Intelligent Voice Development Board Evaluation] Development Environment Construction
- I have read several books, but I still don't understand the difference between LWM2M and COAP. Can you please guide me?
- Let Arduino make your useless board playable Part 3 How to play ESP-C3, ESPS2
- Risking my life to tell the administrator: The title has too few words, and the problem description was cut off before it was finished.
- Violent disassembly of Xiaomi's latest 2-in-1 power bank
- Ended|Maxim & Avnet [Typical applications in the era of the Internet of Things]