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
Parents
  • Hello,

    It is based on the Peripheral UART Sample, programmed with nfr Connect SDK v1.9.1.

    Is there any reason you want to use the older version of the nRF Connect SDK? If not, I recommend switching to the latest stable version, which is v2.6.0. I strongly recommend switching to the newer version, as adding OTA DFU support for NCS v2.5.0 and above is much easier. I haven't gone through the tutorial you have provided, but there is an official tutorial for doing this in our Developer Academy course. See the section DFU for nRF5340 (only works with new SDK versions).

    when I add this to the prj. conf, BLE does not work, even when I did not do any changes in the main.

    Could you brief a little more on this issue like how the BLE crashes? Is it like device stop advertising or is this any connection issue? Have you tested any sample inside the SDK?

     Kind Regards,

    Abhijith

  • Thanks for the answer,

    the reason for the old SDK is that i have done this application some time ago, and now I just need to add the OTA. Thank you for the tip for the Developer Academy Course. I was trying to make it work with the actual SDK v.2.6.0 on nrf5340DK, but I am struggeling with that.

    By the Lesson 8 Excercise 3, which is actually the thing that I need to implement, I always get the Error Message 

    "E: Failed to open flash area ID 2 (image 0 slot 1): -19, cannot continue" via VCOM1 after booting.

    I downloaded the code from the GitHub repository of the Academy, so the code must be Ok, maybe I need to change some settings in VS Code?

    If I could get it working with the new SDK, I will consider overwriting the old program into the SDK 2.6.0.

    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.

Reply Children
  • 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

  • Hi Jirik,

    I'm not sure, how to solve this. I just wanted to report my findings. To make progress on this, I probably will add some changes to my fork of the nordic SDK (I would share that with you, once I'm done). I hope, that someone at Nordic could point us into the right direction. Hopefully just a configuration issue.

    best regards

    Torsten

  • For me, this patch workes: https://github.com/TorstenRobitzki/sdk-hal_nordic/commit/260bbb97b67521ab95375083f421a4b2c3aebff8

    If you want to apply that in your project, you could overwrite the used `hal_nordic` version with the version above by adding:

        -   name: hal_nordic
            repo-path: sdk-hal_nordic
            remote: robitzki
            path: modules/hal/nordic
            revision: fix_nrf53_qspi
    

    to your projects `west.yml` `projects` list. You would then also need to add the repository, that contains this hack (`remotes` in `west.yml`):

        -   name: robitzki
            url-base: https://github.com/TorstenRobitzki
    

    HTH

    Torsten

  • Thanks a lot for sharing it Torsten, unfortunately did not help, I still get the same error. There are probably more problems.

Related