This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Update user application through master mcu

Hello forum,

I have a new project that requires Bluetooth connectivity and I think that the nRF52805 suits me best due to its very small size.

The nRF52805 would work as a slave and it would communicate via UART with the master mcu.

My biggest concern about the its firmware is whether I will be able to update the user application of the nRF device from the UART port using the master mcu.

Do I need any custom bootloader to do that?

Is there any on chip feature or any support from nRF SDK or from SoftDevice for that?

Note: over the air update is not wanted in that case. Only the master mcu will be able to update the firmware of the nRF device.

Parents
  • Hi,

    We do not have an official DFU master code for using a nRF52 to update another nRF52, only using a PC or a mobile phone. However, it is possible to implement this feature.

    This guide shows a step by step guide for getting started with secure DFU bootloader, and in Appendix 6 DFU Master code of that guide, you can find example code for UART DFU master. Please note that the example code is made for SDK v14.2, so if you are using a newer version of the SDK, you will have to migrate the example to your version. As this is not an official example, I cannot guarantee that it will work out of the box, but you can use it as a starting point.

    You will need a bootloader in order to perform DFU on your device, as the actual updating is performed by the bootloader. We have several DFU bootloader examples in our SDK. Since you do not want over the air, you can take a look at the Secure DFU Bootloader over Serial Link (UART/USB) example.

    Best regards,

    Marte

Reply
  • Hi,

    We do not have an official DFU master code for using a nRF52 to update another nRF52, only using a PC or a mobile phone. However, it is possible to implement this feature.

    This guide shows a step by step guide for getting started with secure DFU bootloader, and in Appendix 6 DFU Master code of that guide, you can find example code for UART DFU master. Please note that the example code is made for SDK v14.2, so if you are using a newer version of the SDK, you will have to migrate the example to your version. As this is not an official example, I cannot guarantee that it will work out of the box, but you can use it as a starting point.

    You will need a bootloader in order to perform DFU on your device, as the actual updating is performed by the bootloader. We have several DFU bootloader examples in our SDK. Since you do not want over the air, you can take a look at the Secure DFU Bootloader over Serial Link (UART/USB) example.

    Best regards,

    Marte

Children
  • Hi Marte,

    I don't want to use an nRF52 device to update another nRF52. I'm sorry for the misunderstanding.

    I want to update an nRF52 device via UART. At least its user application.

    I have a product with a general purpose mcu. But now it requires a Blueetooth connectivity. I thought of using an nRF52 device as a slave along with my general purpose mcu.

    Though, it is essential for me to be able to update its firmware. It would be much better for me to know that I can update the user application in case any bug arises in the future.

  • BTDT.

    Ended up implementing the DFU host side myself from scratch  - dunno if the code just was a bad fit for my case or if I simply did not find it in the first place. Code on the NRF side was the uart bootloader, just customized via sdk_config.h and custom_board.h header files.

    You need to be able to store the firmware and the header on the main MCU system somehow. My device was a daterlogger with an SD card, so I had enough storage capacity.

    If you don't have enough space on the main MCU, you can also update the NRF firmware OTA from bluetooth.

  • I have enought space on the host mcu. That is not a problem.

    Another question that also poped up on my head is: what the address of the 3 sections would be. I mean having a bootloader, softdevice and main application. At what address would I place each one into the flash?

    I see in the examples that bootloader doesn't go into the address 0x0. So, doesn't the application boots always on the bootloader section?

    If no, how can I force the program to enter the bootloader?

  • Hi,

    We do not have a memory layout for the nRF52805, but it is very similar to nRF52810, with only some differences in the peripherals, but not flash and RAM, so you can look at the memory layout for that SoC.

    Usage Memory range nRF52810 (S112 v7.0.x)
    Bootloader settings 0x0002 F000 - 0x0003 0000 (4 kB)
    MBR parameter storage 0x0002 E000 - 0x0002 F000 (4 kB)
    Bootloader 0x0002 8000 - 0x0002 E000 (24 kB)
    Application area (incl. free space) 0x0001 9000 - 0x0002 8000 (60 kB)
    SoftDevice 0x0000 1000 - 0x0001 9000 (96 kB)
    Master Boot Record (MBR) 0x0000 0000 - 0x0000 1000 (4 kB)

    This can also be found here.

    Best regards,

    Marte

Related