-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement firmware update over LPUART1 #71
Comments
I wrote few a bootloaders years ago, but today there is really a lot of good ones. |
I am not familiar with MCU bootloaders at all and I am happy to take recommendations! My main motivation is to enable LoRa firmware upgrade in deployed devices over the main USB port on the Core module, even if the process is slow. I am looking for a bootloader that:
There is plenty of flash memory left so far, but not enough to store both the old and new firmware versions at the same time. Thus, we will need to overwrite the running application. But I think that's okay. If the upgrade fails, one can always fall back to the built-in STM bootloader. |
@janakj I would not bother with overwriting the FLASH area from a function running in RAM. It is technically possible, but implementing such a thing is too much of an effort (and debugging nightmare :)) Probably you think the same, but since you said Ideally, it will be a simple bootloader that will do the integrity check of the application in the beginning. If it fails, it just waits in the bootloader mode for the new firmware. If it does not, it will boot it. I would not mind marking the application area flag that the update is enforced. So this solves the problem that the bootloader does not have to time out. Once the update request is sent, the bootloader will not continue unless it receives a new image. No matter what. As @hubmartin said, pick whichever strategy you like the best, we will be grateful for anything and even more, if it is simple :) |
If the flash cannot be split in half because of the size of the app, then simplier bootloaders could be used. I tried to search for serial bootloaders on github ( Some reading: |
My bad! I wasn't suggesting to run the boot loader from RAM. Just that it overwrites the original application in flash since there isn't enough space left for two copies of the same application.
Yep, that sounds like a good approach to me, thanks for the suggestion.
I will look for something minimalistic based on Martin's suggestions. I don't wish to spend more time than what's necessary on this. |
It also appears that the pin PA0/WKUP1 is dedicated to activating the boot loader embedded in the application (as opposed to the boot loader in the system memory). When pulled down during power on, the application boot loader will be activated. |
Add a small separate bootloader to the firmware with support for firmware update over the ATCI (LPUART1). There are a number of existing bootloaders for STM32 platforms on Github, so perhaps one of those could be simply integrated. When activated, the bootloader would provide a small set of AT commands that could be used to replace the contents of flash to update the firmware.
This would make it possible to update the LoRa modem firmware in a Tower device using existing tools such as bcf without the need to take the LoRa modem out in order to connect it to a USB-UART converter.
The text was updated successfully, but these errors were encountered: