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-23 10:33
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- What are the introductory knowledge points for Web front-end?
- [TI's Big Live Broadcast] Let's get started! For 30 yuan, let's play with the new MSP430 that helps eliminate smog, vertical and horizontal sensing and measurement
- HardFault location method and steps for smart microcontroller
- [ESP32-Audio-Kit Audio Development Board]-1. Installation of the development environment
- Filter Design in Embedded Development
- How to reuse the same module in Allegro software?
- sad
- [Old post in the section] A 51-post from ten years ago
- (2) Based on STM32L4R9 MEMS sensor board (IKS01A3): project creation and testing
- Huawei base station equipment disassembly-power supply part