stm32f030R8 environment configuration under keil environment

Publisher:SereneSerenityLatest update time:2018-07-11 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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


Reference address:stm32f030R8 environment configuration under keil environment

Previous article:Why is the interrupt vector table remapped to a high address?
Next article:STM32 mapping of printf under keil environment

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号