Selection of STM32 startup file (determined by capacity)

Publisher:少年不识愁滋味Latest update time:2018-08-14 Source: eefocusKeywords:STM32 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

         When writing a program for STM32, we need to add the startup file provided by the manufacturer to the project file (here we take the STMf10x series as an example), which contains the startup code. The startup code is a piece of assembly code related to the hardware. It is indispensable! The main functions of this code are as follows:

    1. Initialization of the stack (SP);

    2. Initialize the program counter (PC);

    3. Set the entry address of the vector table exception event;

    4. Call the main function.

    These are all preparations. It doesn’t matter if you don’t understand it at the moment. After all, the file is written in assembly language. . . . .

   Let's take a look at the three files provided by ST, which are used for STM32 chips of different capacities. These three files are:

     startup_stm32f10x_ld.s

     startup_stm32f10x_md.s

     startup_stm32f10x_hd.s

 

    Among them, ld.s is suitable for small-capacity products; md.s is suitable for medium-capacity products; hd.s is suitable for large-capacity products;

The capacity here refers to the size of FLASH. The judgment method is as follows:

    Small capacity: FLASH≤32K

    Medium capacity: 64K≤FLASH≤128K

    Large capacity: 256K≤FLASH

 

    In other words, you need to choose different startup files according to the size of your STM32 capacity, otherwise various errors will easily occur.


Keywords:STM32 Reference address:Selection of STM32 startup file (determined by capacity)

Previous article:In-depth analysis of STM32 startup files
Next article:ucOS_II transplantation: Stm32 startup code analysis

Recommended ReadingLatest update time:2024-11-16 17:48

stm32 learning notes (ten) input capture experiment
#include "timer.h" #include "led.h" #include "usart.h" #include "sys.h" //////////////////////////////////////////////////////////////////////////////////   //This program is for learning purposes only and may not be used for any other purpose without the author's permission. //ALIENTEK Mini STM32 Development Board //
[Microcontroller]
stm32 learning notes (ten) input capture experiment
Design of Rubik's Cube Solving Robot Based on STM32
Solution Design The servo is used as the driving motor of the Rubik's Cube. From the driving principle of the servo, it can be seen that the speed of the servo is not related to the main frequency, so there is no difference in the control effect between using a servo with a lower main frequency and using a serv
[robot]
How to implement STM32 Printf function using standard library
/****************************************************Dividing line*******************************************/ // Add the following code. If printf function is supported, you do not need to select use MicroLIB //Add header file #include stdio.h //Add code #if 1 #pragma import(__use_no_semihosting)              //
[Microcontroller]
How to implement STM32 Printf function using standard library
STM32 DMA -> memory to memory
Based on the STM32 F401 Discovery board: DMA2 on AHB1 bus Step 1: Enable DMA #define DMA_STREAM_CLOCK         RCC_AHB1Periph_DMA2      RCC_AHB1PeriphClockCmd(DMA_STREAM_CLOCK, ENABLE);   Step 2: reset DMA Stream register: /* Reset DMA Stream registers (for debug purpose) */     DMA_DeInit(DMA_STREAM);  
[Microcontroller]
STM32 DMA -> memory to memory
Compile the STM32 standard library into lib for use
In the past, I had been using the STM32 standard library, and I needed to add the code step by step, set the compilation options, and then compile the entire project. This compilation process is a very slow process! A complete compilation takes about the time of a cigarette. Compiling like this every time you build a
[Microcontroller]
Compile the STM32 standard library into lib for use
STM32 SPI query mode transmission test
environment: Host: WIN7 Development environment: MDK4.23 MCU:STM32F103CBT6   illustrate: The software sets the NSS foot and transmits using the query method   source code: Initialization code: // Turn off SPI SPI_Cmd(SPI1,DISABLE); //Initialize the SSN pin of the SPI interface and the RST pin of NTRX
[Microcontroller]
STM32 SPI query mode transmission test
STM32 combination device realizes USB to dual serial port
Serial port and interrupt initialization void USART1Init(void) {   GPIO_InitTypeDef GPIO_InitStructure; USART_InitTypeDef USART_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE); RCC_APB1PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE); GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9; GPIO_InitStructu
[Microcontroller]
Design of TFT digital color screen with STM32 direct driving RGB interface
Introduction With the continuous development of industrial technology, the development and application of human-machine interface are unprecedentedly hot. In order to have a more friendly human-machine interface, TFT digital color screens are widely used, but TFT color screens usually do not have controllers, so ther
[Microcontroller]
Design of TFT digital color screen with STM32 direct driving RGB interface
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号