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

Firmware transfer over BLE for another MCU

Hi,

We've a custom board which has NRF52832 and Maxime. They are connected over UART. ( I'm using ble_app_uart)

What I want is transfer binary data between Phone and nRF52 over BLE.  Is there any application example?

After receiving binary data from Phone, we will store it to external EEPROM on our custom board, and doing Maxmie update further.

The binary data actually is for Maxime update.

I've tried using UART for transferring binary.

As I googled, TX characteristic of UART service(ble_app_uart) on Phone has 20 bytes payload, our binary file has about 4xx kbytes.

It takes too much time when nRF52 receive from Phone over UART and send binary over UART between 52832 soc and Maxime soc.

So maybe the better way is using BLE from Phone to nRF52.

I've read https://devzone.nordicsemi.com/f/nordic-q-a/29028/download-firmware-over-ble-for-another-mcu.  Still confusing.

Is there application sample or guide for receiving data over BLE from Phone? Once nRF52 receives binary data, how to send binary packet over UART to Maxime.

Thanks.

Vick

Parents
  • Hi,

    I have further question about this case.

    Should I create new case?

    Our MCU image is about 450 kb, can it be saved to bank1 ? Is bank1 storage enough?

    52832 has 512KB flash, my application occupy 245 KB. (including ble_app_hrs, nus, i2c)

    If there is no enough space, how do I store MCU image?

    Thanks.

  • Hi Vick, 
    Please clarify that the external image is 450kB. You should check the binary image, not the hex file. 
    If it's required larger space than the available space in bank1, you would need to think about using an external flash storage. For example we have an MX25R6435F 64Mb on the nRF52840DK. 


    Another option is to store the image directly on your MCU flash storage if you have enough free space there. The image is transferred on the go when you receive it on the nRF52832. 

  • Hi Hung,

    1. About zip:  I see

    2.

    I would suggest you to go for the option to implement the BLE receiving and forwarding on UART on the bootloader on the nRF52. And then implement a similar bootloader on the Maxime MCU that can also do verification and DFU update. Something similar to our UART DFU bootloader on the nRF5 SDK. 

     Thanks for the suggestion!! It's helpful.

    3. I have other question about app on phone, does DFU app on phone have source code for reference?

    We may need to know how to transmit  MCU bin file over BLE, and then bootloader can receive it.

    Thanks.

  • Hi again Vick, 
    You can find the source code of the DFU app here: https://github.com/NordicSemiconductor/Android-DFU-Library

    The implementation of how to use the library is in the nRF Toolbox: github.com/.../Android-nRF-Toolbox

  • Hi Hung,

    It's very helpful. Thanks for your support!!

  • Hi Hung,

    I still need your help! Sorry for reply it again.

    I want to evaluate feasibility also try to implement what you recommend and clarify more details.

    I want to try below tasks:

    1. Try receiving BLE bin (for example ble_app_hrs_pca10040_s132 bin file, dat)

        => It is easier way that don't care about MCU bin file protocol 

    2. Once receiving packet from Phone over BLE, transferring it over UART.

        => It will need to integrate bootloader and NUS.

        => Find out receive function and try to transfer it in proper way. Could you give some tips that which function/C file I can study first?

    3. To make sure total numbers of packets is expected on MCU side.

        =>It is easier way to check the process is correct.

    =============

    4. Try receiving MCU bin file

         => Find out bin file difference between MCU and BLE.

    5. Receiving packet then transferring it over UART

        =>The protocol might be different.

    6. To make sure total numbers of packets is expected on MCU side.

    Are those ideas above correct? Please give me advice!

    Thanks.

  • Hi Vick, 

    I don't fully understand what  you are asking about.  
    But this has nothing to do with NUS. 

    I suggest you to draw some figure to explain what you are planning to do. 

    For example: 

    Phone |==BLE DFU==> nRF52 |===UART==> Maxime. 

    Then you can tell what exact you want to do on the nRF52 , on the Maxime etc. 

    What you are planning to make is complex and requires you to fully understand the code of the bootloader. You need to get very familiar with how the Bootloader works, how the DFU protocol is, how the UART DFU master works etc. 

Reply
  • Hi Vick, 

    I don't fully understand what  you are asking about.  
    But this has nothing to do with NUS. 

    I suggest you to draw some figure to explain what you are planning to do. 

    For example: 

    Phone |==BLE DFU==> nRF52 |===UART==> Maxime. 

    Then you can tell what exact you want to do on the nRF52 , on the Maxime etc. 

    What you are planning to make is complex and requires you to fully understand the code of the bootloader. You need to get very familiar with how the Bootloader works, how the DFU protocol is, how the UART DFU master works etc. 

Children
Related