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

  • Hello Edvin,

    I'm so sorry for finding out that I've entered a misunderstanding.

    Originally I was saying that I need to upgrade via UART, and yes it worked, but But after I finished testing, my colleague told me that we are using ARM architecture, so I can't update my nrf-device by use nrfutil, Because the source code has some libraries that cannot be ported to the host device.

    So I wanted to use the bluetooth update and ask you a lot of questions about it, but when I finished work yesterday and asked my colleague about bluetooth related things ready to debug the bluetooth upgrade, he told me that our host device does not have bluetooth enabled (I Know that our host device has bluetooth, but I don't know it won't be used).

    Sorry for taking up so much of your time with these wrong questions.

    Let me sort out the current situation.

    1. I can enter the DFU mode normally.

    2. I can update success via UART on PC.

    3. I can't port the ntfutil to host device, because it use ARM.

    4. Since 3 is not established, I can't upgrade nrf-device on the host device.

    So I think the question should be how to update nrf-device without ntfutil.

    And I think there is a method like this:

    I can receive the update file and save it to bank1, then enter the DFU mode, it will check and update itself.

    But I don't know how to receive the file and save it to bank1.

    I found an example made by Vidar, but it also used nrfutil.

    Apologies again for the previous question.

    Best regards,

    Lurn

  • No worries, Lurn,

    What you are writing makes sense to me! So we are back at having a UART bootloader without the possibility to use nrfutil, if I understand correctly.

    However, you could still use nrfutil to generate the DFU images on a computer, and then somehow transfer that to the computer that will transfer the image to the nrf-device, right?

    In that case, you would only need the ARM device to run the part of nrfutil that does the transfer, which is only a small part of nrfutil.

    While we do not have a strip down version of nrfutil, the colleague that wrote the getting started with DFU guide also wrote a sample application that can run on another nRF device, and will update the target nRF device over UART. Click that link, and search for "DFU Master Code". 

    I believe it may be easier to analyze and reverse engineer the process from that sample than it is to interpret the nrfutil source code.

    Unfortunately, we don't have very much good documentation on nrfutil, but a couple of useful links are:

    A general description of the DFU procedure can be found here.

    The UART Serial protocol is described here.

    Just in case, the link to nrfutil source code. But I find it difficult to navigate to understand the protocol.

    Lastly, one additional hint could be to hook on a UART to computer sniffer/analyzer, and observe an update, to see if you can make sense of the packets, as described in the links above.

    Best of luck!

    Best regards,

    Edvin

  • Hi Edvin,

    I read the code about "DFU Master", I think in this code it use another nrf-device, and what I should do is make sure my nrf-device is in DFU mode, and just run the "DFU Mast code", am I understand currently?

    And a question about it, what is the format of image .hex/.bin or .zip?

    If it run a part of nrfutil that does the transfer, I think it should be a .zip which made by nrfutil, Am i right?

    Best regards,

    Lurn

  • The DFU master does what the computer running nrfutil does when transferring the image. 

    Lurn_Z said:

    what I should do is make sure my nrf-device is in DFU mode, and just run the "DFU Mast code", am I understand currently?

    Yes.

    I have not tested this, but I believe there is some description saying how to do the test. Check out the DFU_SPI_readme.docx (yes, it is written for the SPI variant, but it covers your questions).

    It explains how to transfer the DFU image (.zip file) to the flash of the DFU master by using JFlash. I played around with .bin files the other day. The thing with these is that they are not address mapped, like hex files are. But there is a tool that you can test (pip install bin2hex.py), and you can use this to convert .bin files to .hex files with an offset, so that you can program them using nrfjprog (for testing purposes).

    bin2hex.py --offset 0x12000000 bin_file.bin hex_file.hex
    nrfjprog --program hex_file.hex

    Lurn_Z said:
    And a question about it, what is the format of image .hex/.bin or .zip?

    Read the doc for the SPI sample, and you will see, but in short, it is the .bin and .dat inside the .zip that actually contains the data that is needed.

    BR,
    Edvin

  • I didn't find the file "nrf_serial_dfu.h"

    and also I did not have the pack.

    the download log is here.

    Cannot download file developer.nordicsemi.com/.../NordicSemiconductor.nRF_DeviceFamilyPack.8.15.0.pack: Object not found

Reply Children
No Data
Related