OTA DFU on NORA B1

Hello,

I have a project working on Nora B1, which I am testing on nrf5340DK. It is based on the Peripheral UART Sample, programmed with nfr Connect SDK v1.9.1. Now I need to add the OTA DFU to update the program from the nrf Connect mobile app. I changed the prj.conf and main according to this tutorial

https://getwavecake.com/blog/adding-ota-dfu-to-a-nordic-zephyr-project/

It works perfectly, when I am testing it on the Development Kit, but it does not work at all on the Nora B1. The flash is succesful, but the BLE can't get initialised.

I tried a bit and it seems like the problem is caused by the line

CONFIG_BOOTLOADER_MCUBOOT=y
when I add this to the prj. conf, BLE does not work, even when I did not do any changes in the main.
Is there anything special I should take care about while configuring bootloader on the NoraB1?
Thanks a lot for any answer
  • Hello,

    thanks for your answer. When I follow the steps 1 to 5, everything works fine, the BLE is advertising, I got messages vie COM port, when I connect per Nrf Connect Mobile, there is the option of the DFU.

    When I continue in the tutorial, or when I just use the solution from GitHub, built it for nrf5340dk_nrf5340_cpuapp and flash it on the Nfr5340DK from VS Code (without any changes), I get this error message and the program does not continue. 

    Did you do it the same way? (just build for nrf5340dk_nrf5340_cpuapp in the VS Code and Flash via nrf Connect extension) or did I missunderstand something and did something wrong?

    I did not change anything in the sample and I use nrf5340DK.

    I wish you happy eastern, and I am looking for the answer after the 2nd April. Thanks a lot for the support :)

    Kind regards

    Jiri

  • I'm seeing the very same error message (including exactly this error code -19 and ID 2). I try to add MCUboot to an application and to setup the secondary partition one the external flash memory of the nrf5340 eval board. I try to follow this example: https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/bootloader_samples/nrf5340/mcuboot_smp_ble_simultaneous

    I see the error message:

    *** Booting nRF Connect SDK v3.5.99-ncs1-4867-g272786b07422 ***
    I: Starting bootloader
    E: Failed to open flash area ID 2 (image 0 slot 1): -3, cannot continue

    On the UART.

    To me, it looks like the bootloader does not start, because in `flash_area_open()` (implemented in  `zephyr/subsys/storage/flash_map/flash_map.c`, the call to `device_is_ready(area->fa_dev)` is failing (printf debugged). Maybe, the flash driver is not initialized by the bootloader?

  • After a longer debug session, I found, that `qspi_init()` in nrf_qspi_nor.c failed with a test of the expected `JEDEC id` fails. The read out JEDEC id is 0xff 0xff 0xff, which sounds like, the flash is not responding at all.

  • After an other lengthy debugging session, I discovered, that the GPIOs of the QSPI peripheral are not initialized by the nrf_qspi_nor.c driver (due to having `skip_gpio_cfg` and `skip_psel_cfg` set to true in the `qspi_nor_dev_config` structure).

    I've tried to force the driver to initialize the GPIOs by setting `skip_gpio_cfg` and `skip_psel_cfg` to false and by providing the dedicated pins for the QSPI peripheral in the `.pins` substructure. But that did not did the trick. By adding this, the pins were initialized by `nrfx_qspi_ini()` in `nrfx_qspi.c` using the `QSPI_PIN_INIT` macro, which sets the GPIO configuration accordingly for the nrf52 family, but not for the nrf53, which requires the configuration to set the `MCUSEL` to `Peripheral`.

    After changing the `QSPI_PIN_INIT` in `nrfx_qspi.c` the bootloader starts and the bootloader starts my application. I guess, that is not the intended way to configure MCUboot to use an external QSPI flash. Where are the GPIO pins supposed to be configured?

  • Hello Torsten,

    Thank you very much for your answer and for all the debugging work, I realy epreciate that you shared your results. 

    I am affraid that I did not understand all the steps you did correctly, could you please once again guide me, what exactly should I change in which programs?

    Thanks a lot in advance

    Jirik

Related