Enabling MCUBOOT does not run application

I am trying to add BLE OTA to our project for our custom NRF52833 board. We are using nrfconnect together with visual studio code and are using the most recent toolchain (nrf Connect SDK v2.1.1) we are using a j-link Segger to flash and debug our applications.

I am following the tutorial Add DFU support to your application - Software - nRF Connect SDK guides - Nordic DevZone (nordicsemi.com) and the code compiles but nothing happens when I flash it to the target. I tried lots of things, but I do not seem to get any further.

Hence, I decided to get back to the basics. So I set-up the hello-world sample for our board with the following configuration prf.conf:

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

CONFIG_USE_SEGGER_RTT=y
CONFIG_SERIAL=n
CONFIG_CONSOLE=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_RTT_CONSOLE=y

CONFIG_GPIO=y

This displays the hello world message and also an LED is switched on. Now, when I enable the MCUboot in the conf file: 

CONFIG_BOOTLOADER_MCUBOOT=y
the code compiles and flashes successfully, I can reset it, I can connect the Segger using j-link rtt viewer but I do not see the print statement or any feedback from the chip, nor is the LED is turned on. 
So either, I am missing a step / insight here, or there is something not working as expected. 
Am I correct to assume that enabling the bootloader should run the application in the same way as when it is disabled? Or is just enabling MCUBoot not enough to get the system to working? Hopefully someone can help me getting this right / clarifying this.
My second goal is to get the BLE OTA (or should I say FOTA) functionality working. For this I followed the tutorial but also set-up a sample based on the peripheral_hr sample (which feels a bit more simple / clear to me. Again, I can get that sample to work but as soon as I enable the MCUBOOT and OTA functionality, the code compiles fine and also flashes fine but the application does not return anything. 
To keep things simple, perhaps it is best to clarify/solve the hello world issue first before going into the BLE OTA part.
Many thanks!
 

Parents
  • Hello,

    Please correct me if I'm wrong, but I assume you don't have a 32KHz crystal mounted on your custom board since you are setting CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y in your application.

    This setting will not be applied to the MCUBoot child image, instead it will be built with the default board configuration. So, if you build for 'nrf52833dk_nrf52833' the LF crystal oscillator will end up being selected and the bootloader would become stuck waiting for the crystal to ramp up.

    To override this setting in the bootloader, you can create a folder named 'child_image' in your project directory, then define a kconfig fragment named mcuboot.conf (Ref. https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_multi_image.html#image-specific-variables). Config settings in this file will automatically be applied to the mcuboot build.

    The folder structure should look like this:

    ├── child_image
    │   └── mcuboot.conf
    ├── CMakeLists.txt
    ├── prj.conf
    ├── README.rst
    ├── sample.yaml
    └── src
        └── main.c

    where mcuboot.conf contains CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y.

    Best regards,

    Vidar

Reply
  • Hello,

    Please correct me if I'm wrong, but I assume you don't have a 32KHz crystal mounted on your custom board since you are setting CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y in your application.

    This setting will not be applied to the MCUBoot child image, instead it will be built with the default board configuration. So, if you build for 'nrf52833dk_nrf52833' the LF crystal oscillator will end up being selected and the bootloader would become stuck waiting for the crystal to ramp up.

    To override this setting in the bootloader, you can create a folder named 'child_image' in your project directory, then define a kconfig fragment named mcuboot.conf (Ref. https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_multi_image.html#image-specific-variables). Config settings in this file will automatically be applied to the mcuboot build.

    The folder structure should look like this:

    ├── child_image
    │   └── mcuboot.conf
    ├── CMakeLists.txt
    ├── prj.conf
    ├── README.rst
    ├── sample.yaml
    └── src
        └── main.c

    where mcuboot.conf contains CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y.

    Best regards,

    Vidar

Children
Related