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

Flash .hex file via Bluetooh

Dear Community;

Is it possible to flash a .hex file to an nRF 9160 DK using Bluetooth? Something similar to nRF programmer but using Bluetooth instead of USB OTG cable.

Thanks.

Parents
  • Hi.

    It is not something that we have at the moment, but all the building blocks should be there.

    The solution would look something like this:

    You need an application on the nRF52840 that can receive the new image. Then, when the image is received it must transfer it to the nRF9160 over UART (or other serial protocol). The new image can also be streamed over the UART as it comes in without waiting to receive it all first.

    On the nRF9160, you have two options for how to receive the image.

    1. MCUBoot with "serial recovery". This requires the nRF52840 to be able to reset the nRF9160 while holding a pin high (or low, depending on the configuration of MCUBoot). Then after the reset, MCUBoot will run, which will check the pin value. If the pin is asserted, MCUBoot will enter serial recovery mode, meaning that it will be able to receive a new image over UART. When the image is received, the nRF9160 must be reset before it will start to use the new image.
    2. The application on the nRF9160 will receive the new image and write it to the secondary image slot in flash. Then, the application will trigger a reset. After the reset, MCUBoot will detect the new image, and boot that.

    A third option is to run the Bluetooth host layer on the nRF9160 and run the hci_uart sample on the nRF52840. That way, you can program the nRF9160 as if it has Bluetooth.

    In both cases 1 and 3 (and optionally in 2), you must use the SMP protocol.

    You can find more information here:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/mcuboot/wrapper.html

    Best regards,

    Didrik

Reply
  • Hi.

    It is not something that we have at the moment, but all the building blocks should be there.

    The solution would look something like this:

    You need an application on the nRF52840 that can receive the new image. Then, when the image is received it must transfer it to the nRF9160 over UART (or other serial protocol). The new image can also be streamed over the UART as it comes in without waiting to receive it all first.

    On the nRF9160, you have two options for how to receive the image.

    1. MCUBoot with "serial recovery". This requires the nRF52840 to be able to reset the nRF9160 while holding a pin high (or low, depending on the configuration of MCUBoot). Then after the reset, MCUBoot will run, which will check the pin value. If the pin is asserted, MCUBoot will enter serial recovery mode, meaning that it will be able to receive a new image over UART. When the image is received, the nRF9160 must be reset before it will start to use the new image.
    2. The application on the nRF9160 will receive the new image and write it to the secondary image slot in flash. Then, the application will trigger a reset. After the reset, MCUBoot will detect the new image, and boot that.

    A third option is to run the Bluetooth host layer on the nRF9160 and run the hci_uart sample on the nRF52840. That way, you can program the nRF9160 as if it has Bluetooth.

    In both cases 1 and 3 (and optionally in 2), you must use the SMP protocol.

    You can find more information here:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.3.0/mcuboot/wrapper.html

    Best regards,

    Didrik

Children
Related