In-depth discussion of the role of 32 reset and SystemInit functions in the program

Publisher:自在逍遥Latest update time:2018-12-18 Source: eefocusKeywords:Reset Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In 32 applications, we generally reset in two ways:


1. Press the reset button to reset the program 


2. Pull the jumper on the microcontroller to complete the 32


In the above two reset methods, for the chip, they are actually just programs triggered after the pin receives a jump delay signal. In the firmware library that comes with Keil, we can see the following program:


Write the picture description here


Here is the reset program code snippet from the library. EXPORT defines a global variable Reset_Handler. IMPORT means a function is referenced. The _main function introduced here is used to make the main function in the main function we usually write work, connecting the C program with the underlying assembler program to make the program work. When we first start learning, we often find that there is always a function in the environment written by others that we don’t know what it means: SystemInit(). We can see that the SystemInit function is introduced in line 150 of the picture, and the function is called in the next line, but it is not declared. Therefore, if we do not declare a new SystemInit function outside main when writing the main program, the program will report an error when compiling.


Write the picture description here


Just write an empty function as shown in the figure, the purpose is to trick the compiler into not reporting an error. Note that the function name here should be the same as the function name in the firmware library. 


If you get this error in Keil: 


..\OBJ\Template.axf: Error: L6218E: Undefined symbol assert_param (referred from misc.o). 


This means that you have not defined the SystemInit() function. Therefore, you can solve the problem by defining SystemInit() in any .c function. The function can be empty. 


Write the picture description here

Keywords:Reset Reference address:In-depth discussion of the role of 32 reset and SystemInit functions in the program

Previous article:STM32 Problem Record: This time Keil compiler is to blame
Next article:Summary of LPC1788 debugging in external RAM

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号