nrf52832 OTA over ESB based on SDK17.1.0

Hi everyone:    I developed an application based on ESB wireless communication protocol ofr the nRF52832, and I would like to perform an OTA DFU with it.    Do you know any example of some over the air FW upgrade of nRF52832 chip via ESB protocol.

    SDK is 17.1.0.

Best regards,

Lurn.

Parents
  • I only found examples of ble and uart in the dfu/secure_bootloader folder, Which one should I use or how should I modify it to adapt my program.

  • Hello,

    It is correct that you will only find BLE and UART in our samples, but I know that several customers have ported this to SPI, so if you need it over ESB, then that should also be possible. The transport layers in the bootloader for the nRF5 SDK are on purpose quite separated from the rest of the libraries, to make it easier to change the transport layer, or to add your own transport layer.

    But you do need to implement it yourself. Also note that we do not have the "DFU Master" as an official part of our SDK. We have tools like nrfutil (open source) or nRF Connect for Desktop (not open source), and applications for mobile phones that are open source (but mobile phones doesn't have ESB). However, there is an unofficial implementation (not properly tested. You can use it, but on your own "risk"), which you can find here. I have not tested these myself, but you can give it a go. I suggest you test out the UART master, in combination with the uart bootloader, and then you can port both to ESB once you are up and running.

    Best regards,

    Edvin

  • I believe the limitation comes from the fact that most of our users use the softdevice, and it is a bad idea to update the bootloader and app without updating the softdevice, because updating the bootloader often comes with a version update, so you should update the softdevice so that the BL and SD are not incomatible.

    In your case, if your bootloader doesn't use the softdevice, this requirement doesn't really make sense. But as I mentioned, there is literally no difference between having the BL and APP in the same packet or two. The only difference is that you need to do "nrfutil dfu serial -pkg ..." two times instead of one. It doesn't take longer time, as it is the same amount of data that needs to go through, and the end user will probably not notice a difference, if you are doing this from a custom app or some sort of script either way.

    BR,

    Edvin

  • Yes, I can update it in two steps, but after one step done, I need enter the DFU mode again.

    Whatever, this problem has been solved.

    Thanks a lot.

    BR,

    Lurn

  • I have not tested now, but doesn't it delete the app when you update the bootloader? And doesn't that in turn put it in DFU mode automatically?

    BR,

    Edvin

  • I don't know the standard process but in my test, the log shows it doesn't delete the app, and after the bootloader update, it will enter the old app.

    BR,

    Lurn

  • Hi Edvin

    If I don't want to use nrfutil do you guys have any other example for me to update the version?

    And how can I get or set the firmware version in my program?

    Best Regards

    Lurn

Reply Children
  • Hello Lurn,

    Sorry for the late reply. I have been on vacation. 

    It seems like this ticket got the status "verified answer" before your last reply, meaning it disappeared from my list. Did you solve the issue from about 1 month ago?

    Regarding your last question.

    nrfutil is the only officially supported tool that we have. However, it is open source, and you can find the source code on GitHub.

    We do have an experimental implementation for the DFU master (the device that sends the packet) over UART, so perhaps you can look into that. It is found in the getting started with nRF5 SDK DFU blog post. Search for "DFU Master code".

    However, you probably still want to use nrfutil to generate your images. This is also where you set the firmware version. By default, this version is not stored in the application itself, but in the bootloader settings, which are generated when you do the DFU. So it is part of the DFU image, but not the application (meaning the application is not aware of what version it is running). If you need the application to know, you need to hard code this into your application (as a #define). 

    Best regards,

    Edvin

  • Hi Edvin,

    It seems like this ticket got the status "verified answer" before your last reply, meaning it disappeared from my list. Did you solve the issue from about 1 month ago?

    Yes, I can update via uart now.

    I was found the source code on GitHub, but it is implemented in python and contains library files, I want to use it on ARM, it doesn't seem feasible.

    And yes I still want to use nrfutil because I have to set the firmware version.

    if there is no other way, I will try to use BLE to update.

    If I use BLE to upgrade, and my main application is used ESB, will the two of them conflict?

    Best regards,

    Lurn

  • Lurn_Z said:
    If I use BLE to upgrade, and my main application is used ESB, will the two of them conflict?

    Not other than that the softdevice will have to be present in flash. You don't need to enable it in your application.

    So your first step before trying to perform a DFU would be to make sure that your application runs as intended when the softdevice is present in the flash of the nRF52. Just to make sure that you have the correct start addresses for both RAM and Flash in your application.

    Best regards,

    Edvin

  • Hi Edvin,

    For my application, How could I modify the address? I don't know where the softdevice end address is.

    The ble bootloader debug address is here.

    and the application address is here.

    and if I use ble bootloader do i still need to program the mbr.hex?

    Best regards,

    Lurn

  • Hello,

    The bootloader address settings you can leave as is, but you need to adjust the flash (IROM1) address and size for your application. 

    Assuming you are still using SDK17.1.0, and a BLE bootloader, I assume you are using s132_nrf52_7.2.0_softdevice.hex. Just look at any of the samples using the same softdevice, such as the ble_app_hrs\pca10040\s132\ and open the project settings. You should see that it uses start address 0x26000, and size 0x5A000. 

    Strictly speaking, we don't have a size of 5A000, because the bootloader takes up address 0x71000 to 0x80000, so you can set start address 0x26000 and size 0x4B000

    But it wouldn't be an issue unless your application is so big that it starts growing into your bootloader. 

    The IRAM1 settings (RAM settings) you can leave as is. The softdevice requires 8 bytes (the same as MBR) if you do not enable it in your application.

    Lurn_Z said:
    and if I use ble bootloader do i still need to program the mbr.hex?

    No, if you program the softdevice, you don't need to program the mbr.hex. The MBR is merged into the softdevice. 

    Best regards,

    Edvin

Related