Hi,
I am working on an OTA update using my own wireless protocol . I’m currently developing my own bootloader. I use nrf52832 DK and s132_nrf52_6.1.0_softdevice.
To sum up, I started with the "iot_secure_dfu_bootloader_s132_pca1040" found in "nRF5_SDK_15.2.0_9412b96\examples\iot\bootloader".
I added my mesh network protocol to the project and then deleted all the main.c to create my own bootloader.
To test my bootloader I use the blinky example.
I don't use the fonction nrf_bootloader_init() but I made no modification on nrf_bootloader and nrf_dfu files. I only use it to write on flash and jump to the application address.
I received the application chunk by chunk, I took the blinky.hex change to create a .txt file with 4 bytes words big-endian. Then I sent my words to my device with my mesh protocol.
My bootloader is really simple:
- display "Starting Bootloader"
- flash_protect() // for MBR and bootloader addr range
- flash_init()
- flash_erase() // from start application addr (0x26000) to bootloader start
- receive my app chunk by chunk
- check integrity with my own function
- flash_store() // chunk by chunk
- receive end_update signal
- start_app() // here is my problem !
I have tested all my functions, I have no issues before trying to restart on app, the application is well written (checked with Segger J-FLASH tool).
To restart my device on the new app I firstly used nrf_bootloader_app_start() but nothing happened, my program crashed during the reset.
So, after some research on the Nordic DevZone I found this post.
I followed the first answer (I also tested the second one with no success).
With the first solution I can see my LEDs up but only one time after my device reboot on bootloader (I see "Starting Bootloader" on Segger embedded studio debug terminal).
I'm really not familiar with the assembly language so it could be normal, or maybe I miss something really simple with the different registers.
- Is there any change to do in MBR or Softdevice or somewhere else when I update my app?
- Is the found solution viable? What did I miss to stay on my application?
I hope my ticket is not too hard to understand, I can give you more information if you need it.
Thank you in advance.