Steps:
1. Select the chip model
2. External crystal oscillator 8M, check "Use MicroLIB",
microlib is an alternative to the default C library. It is intended for use with deeply embedded applications that need to fit into a very small amount of memory. These applications do not run within an operating system.
microlib is highly optimized to keep the code small. It has fewer features than the default C library and does not have some ISO C features at all.
The functions in microlib are responsible for:
Create an environment in which C programs can be executed. This includes:
Create a stack
Create a heap (if necessary)
Initializes parts of the library used by the program.
Call main() to start executing the program, which is often used for mapping pritf functions.
The access area generally does not need to be set, unless it is used for IAP or the APP needs to adjust the area space;
3. Generate a hex file, i.e. the burning file.
1. Write the program in keil and compile and connect it into a .hex file that can be downloaded to the development board, and then download it with the jlink emulator; 2. Write and compile the code in the uboot APP, and generate a .bin file that can be downloaded with uboot.
4. Used to generate bin files. If not needed, you can skip this step.
C:\Keil_v5\ARM\ARMCC\bin\fromelf.exe --bin -o E:\bootloader_030test\OBJ\bootloader_030.bin E:\bootloader_030test\OBJ\bootloader_030.axf
Format: CMD command fromelf.exe --bin --output a.bin a.axf
5.
#ifdef USE_STDPERIPH_DRIVER
#include "stm32f0xx_conf.h"
#endif
stm32f0xx_conf.h contains the library function header file. Generally, you need to enter: USE_STDPERIPH_DRIVER;
To ensure that your code runs correctly after optimization, be sure to add volatile before variables that cannot be optimized.
The main function of the option One ELF Section per Function is to optimize redundant functions. With this option, redundant functions can be excluded from the final binary file (although the file where they are located has participated in the compilation and linking) in order to optimize the final binary code to the greatest extent.
The mechanism implemented by this option is to treat each function as an optimization unit, rather than the entire file as a unit participating in the optimization.
This optimization function of the option One ELF Section per Function is particularly important, especially in situations where there are strict requirements on the size of the generated binary file. People are accustomed to putting a series of interface functions in one file and then including it in the project as a whole, even if only one function in this file will be used. In this way, the final binary file may contain many redundant functions, resulting in a waste of valuable storage space.
The option One ELF Section per Function is particularly effective for optimizing a large project, sometimes even halving the number of functions. Of course, for small projects or projects with few redundant functions, the optimization effect is not so obvious.
The option One ELF Section per Function compiles only used functions.
Include Paths: Includes the file paths used
6. Hardware download debugging configuration, use JTAG debugger SW mode to download, that is, 3.3V, SWDIO, SWDCLK, GND (these four are enough, usually the download is successful; if the download is abnormal, connect RST to solve it)
Attachment:
Keil MDK generates BIN process
In the integrated development environment of Realview MDK, by default, debug files in *.axf format and executable files in *.hex format can be generated. Although these two file formats are very useful for downloading and debugging the ULINK2 simulator, ADS users are more accustomed to using *.bin format files, and some embedded software developers even have debugging or burning tools for *.bin format files. In order to make full use of existing tools and take advantage of the integrated development environment of Realview MDK, it is a natural idea to convert *.axf format files or *.hex format files into *.bin format files. This article will explore this conversion method in detail.
Before introducing this method in detail, it is necessary to first understand the fromelf.exe conversion tool in ARM's RVCT development kit, because it is the tool that generates *.bin format files in Realview MDK.
The syntax format of the fromelf.exe conversion tool is as follows:
fromelf [options] input_file
The options included in [options] and their detailed descriptions are shown in Table 1.
Table 1 Options and descriptions of the fromelf tool
Previous article:Why is the interrupt vector table remapped to a high address?
Next article:STM32 mapping of printf under keil environment
- Popular Resources
- Popular amplifiers
- uCOS-III Kernel Implementation and Application Development Practical Guide - Based on STM32 (Wildfire)
- RT-Thread Kernel Implementation and Application Development Practical Guide: Based on STM32
- FreeRTOS kernel implementation and application development practical guide: based on STM32
- kernel_riscv_newlibc_prebuilt_win32_2020.08
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
- CircuitPython 6.3.0 released
- Methods to increase the transmission distance of wireless modules
- [Evaluation of Anxinke Bluetooth Development Board PB-02-Kit] KEY and LED Control
- Award-winning live broadcast | Azure Sphere helps to provide stable, secure and flexible IoT solutions
- In gratitude to teachers, FLUKE offers annual discounts! Participate in the event and win a prize of 30,000 yuan!
- EEWORLD University Hall----Keithley 4200A-SCS parameter analyzer accelerates semiconductor equipment, materials and process development
- The upcoming Adafruit Feather STM32F405 Express
- Transfer a PCB experience collection to see
- How to use the Power Path Selector function of BQ24170 with BQ3050?
- The new version of Unico software for STEVAL-MKI109V3 already supports the LIS25BA bone vibration sensor