After adding bootloader to stm32, it cannot enter interrupt

Publisher:shengjuLatest update time:2018-07-10 Source: eefocusKeywords:stm32  bootloader  interrupt Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

It can be entered before adding the bootloader, but it cannot be entered after adding it, but the main program does not crash and runs normally


It may be that the interrupt is turned off before jumping in the bootloader. 

That is, it has been set in the bootloader:


__set_PRIMASK(1);


You need to add in the application layer:


__set_PRIMASK(0);


Re-enable interrupts


The program can be executed before adding the bootloader, but crashes into HardFault after adding it


Maybe this sentence was not added


SCB->VTOR = 0x08010000;


Or the C++ project does not use extern "C" to wrap the interrupt function


After adding the bootloader, the program runs randomly and JLink reports an error during debugging.


JLink News


**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.


It may be due to the change of chip type, the IROM start address under Project - Option for Target - Target has been restored to 0x08000000.


Summarize


Note 3 points when adding bootloader: 

1. Change SCB->VTOR 

2. Change the IROM start address 

3. Enable global interrupt


Keywords:stm32  bootloader  interrupt Reference address:After adding bootloader to stm32, it cannot enter interrupt

Previous article:About the problem of external interrupt not responding after adding bootloader to stm32f030
Next article:STM32 Bootloader and startup analysis

Recommended ReadingLatest update time:2024-11-15 07:49

PIC24 online upgrade via USB -- USB HID bootloader
Development Environment 1. IDE: MPLABX v4.01 2. Compiler: XC16, v1.11 3. Library & Example:  c:/microchip_solutions_v2013-06-15/USB/Device - Bootloaders/HID/Firmware - PIC24FJ256GB110 Family/MPLAB.X This PIC24 HID bootloader is modified based on the Device Bootloader of MLA_v2013-06-15. The space allocation of boo
[Microcontroller]
PIC24 online upgrade via USB -- USB HID bootloader
STM32 IWDG usage
As for the independent watchdog, it is very simple. Just turn it on and feed it. It is that simple. Many books talk about registers and so on. For beginners, these are not very important. The important thing is to learn how to use it first, and then slowly digest why it is set up like this. OK, let's take a look at my
[Microcontroller]
6 steps to teach you how to add printf function in STM32 program
The premise is that you have a complete Keil project such as ADC   When debugging, the serial port is often used. Here we teach you how to use the Printf function. Add Printf to the program 1, #include stdio.h 2, /* Private functions ---------------------------------------------------------*/ Add void USART
[Microcontroller]
How to turn on and off total interrupt in stm32
PRIMASK and FAULTMASK Special Function Registers  PRIMASK is used for all exceptions except NMI and hard faults, which effectively changes the current priority to 0 (can be The highest priority in the programming priority). This register can be accessed through MRS and MSR as follows:  1.   Disable interrupt
[Microcontroller]
stm32 learning notes: interrupt
The status of interrupts in developing embedded systems is absolutely unquestionable. In the era of C51 microcontrollers, there were only 5 interrupts, including 2 external interrupts, 2 timer/counter interrupts and one serial port interrupt. However, in STM32, the number of interrupts has greatly increased, and the in
[Microcontroller]
STM32 RTC principle
1. RTC clock block diagram analysis (important) First, let’s get familiar with a few knowledge points:       1. The real-time clock (RTC) of STM32 is an independent timer!       2. The RTC module and the clock configuration system (RCC_BDCR register) are in the backup area, that is, the RTC settings and time rem
[Microcontroller]
STM32 RTC principle
STM32 serial port transmission background and analysis of some problems
1. The serial port part introduced has the following advantages and disadvantages: Advantages: Simple, suitable for small amounts of data transmission. (This is the only advantage required. In fact, serial port interrupts can be omitted. However, in order to understand the ins and outs and avoid the serial port being
[Microcontroller]
STM32 serial port transmission background and analysis of some problems
In-depth research on the underlying platform of wireless sensor networks
Introduction     At present, the research on WSN (Wireless Sensor Netwoek) mainly focuses on protocol stack, positioning algorithm, energy consumption management and architecture design, while the research on wireless sensor network operating system is relatively small, especially the research on its underlying platf
[Microcontroller]
In-depth research on the underlying platform of wireless sensor networks
Latest Microcontroller Articles
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号