5430 views|4 replies

7172

Posts

195

Resources
The OP
 

STM32 remote upgrade [Copy link]

Today I saw the STM32 remote upgrade solution that uses GPRS for remote upgrade. Now I have used the process on the Internet to set up serial port IAP. First, burn the bootloader firmware on the development board, and then burn the application firmware through the serial port. There is no problem for the first time, but it will not work when downloading again unless the reset button is pressed. I have two questions to ask: (1) Can I directly call the library function reset nvic_setfaultmask(); nvic_generatesystemreset(); These two library functions were previously in NVIC, and the new library has not found their traces. This means that after I receive the upgrade command, I need to perform a software reset. (2) If software reset is not used, is there any way to jump to BOOT to upgrade the application firmware?


This post is from stm32/stm8

Latest reply

(1) I have never used these two functions in the library and I don't know if they can achieve the effect of software reset, but in fact, you can directly read the STM32 reference manual to know how to set the registers to achieve the effect of software reset. Of course, you can also read the library manual. (2) There are two ways to jump from App to Bootloader without generating a low level on the RST pin. 1. Through function call, directly force the address at the beginning of the Bootloader to be converted into a function pointer for calling (this method requires resetting the stack pointer, but it is not a big problem if it is not set); 2. Through inline assembly, use C inline assembly code to directly set the content of the PC pointer to the starting address of the Bootloader. In fact, the above two methods are essentially the same. Both methods achieve the purpose by changing the content of the PC pointer, but one involves the change of the stack pointer and the other does not.   Details Published on 2018-1-18 22:37
 

407

Posts

3

Resources
2
 
I have played with remote upgrades recently, but I have never used libraries, so I am not sure how the libraries work. Let me briefly share my thoughts. 1. If it is in the APP, you need to reset it to the boot. If it is in the boot, upgrade it directly. 2. After the upgrade, determine whether the APP is normal. If it is normal, jump to the APP to run. If it is abnormal, an alarm needs to be issued. 3. Pay attention to the address mapping of the boot and APP programs. You can also jump directly through the address without soft reset. It is the same as jumping from boot to APP. But it is not recommended.
This post is from stm32/stm8
 
Personal signature我在想
我知道什么
 

3414

Posts

0

Resources
3
 
1.λapi3.5nvicResetλbootУ 2.bootappжλ
This post is from stm32/stm8
 
Personal signature

So TM what......?

 

3414

Posts

0

Resources
4
 
1. The reset function (I forgot what it was called) of the old version of the function library nvic class can play a reset role, and after reset, you can enter the boot program. 2. Arrange the interrupt vector, which should be achievable, but it is better to use reset.
This post is from stm32/stm8
 
 
 

62

Posts

1

Resources
5
 
(1) I have never used these two functions in the library and I don't know if they can achieve the effect of software reset, but in fact, you can directly read the STM32 reference manual to know how to set the registers to achieve the effect of software reset. Of course, you can also read the library manual. (2) There are two ways to jump from App to Bootloader without generating a low level on the RST pin. 1. Through function call, directly force the address at the beginning of the Bootloader to be converted into a function pointer for calling (this method requires resetting the stack pointer, but it is not a big problem if it is not set); 2. Through inline assembly, use C inline assembly code to directly set the content of the PC pointer to the starting address of the Bootloader. In fact, the above two methods are essentially the same. Both methods achieve the purpose by changing the content of the PC pointer, but one involves the change of the stack pointer and the other does not.

This post is from stm32/stm8
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list