Today I will teach you how to write the bootloader for STM32 . In fact, the main things to do when writing the bootloader are as follows:
1. Select the memory address for your bootloader program, because the STM32 memory FLASH storage program code space is 512K and needs to be divided.
2. If you need to use JTAG online debugging, you need to configure the area:
3. Choose the appropriate storage space for your user program:
At the same time, configure the online debugging area:
4. The basic process of writing the bootloader program is as follows:
1) Check whether there is a flag that needs to be updated, which can be customized by the user. For example, read the byte stored in a certain position of the flash as a flag.
2) If an update is required, call the STM32 FLASH program shoe polishing user code part.
3) Write the new bin file (that is, the binary file is burned directly into it, the hex file generated by Keil needs to be converted into a bin file, and then stored in the external expansion flash) into the FLASH that comes with the STM32 . Remember that it needs to be consistent with the user code storage area set above.
4) After the update is successful, jump to the user program.
5. The user program needs to pay attention to the need to reset the interrupt vector table before the program runs, that is: NVIC_SetVectorTable().
6. When using the STM32 built-in burning software for burning, the items need to be modified as follows:
1) Open the map folder in the target file after installation. The STM32 we use is 512Kflash, so select STM32_High-density_512K.STmap and decompose it into two STmap files (this file can be opened with Notepad)
In the STmap file, sectors are displayed as 2K pages each, so we only need to go to page 7 for the boot area, and we need to go to page 8 to the end for the user area.
After the modification is completed, when you open the software again, you will find two more flash options. You can choose the code area to be stored here.
Then there is one more thing that needs to be modified:
Previous article:How to port uCGUI to STM32, see here!
Next article:Teach you how to use the DSP library of STM32F4
Recommended ReadingLatest update time:2024-11-15 07:36
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
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
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- Steps to create a register-based STM32 project in Keil5
- What is a Level 2 or Level 3 charger?
- Thank you for being there, thank you gift activity summary
- IMX6ULL development board apt-get software download tool
- 2019 National TI Sponsored Board Video Tutorials
- DIY Wooden Computer Case
- Switching Power Supply Reference Book, "Switching Power Converters: Principles, Simulation, and Design of Switching Power Supplies"
- Today's 10:00 AM broadcast | MPS inductor solutions help better switching power supply design
- Playing with Zynq Serial 17 - Creating a New Vivado Project
- EEWorld monthly prize giving event is launched! You have the information, I have the prize!