New firmware with Zephyr and old bootloader

HI,

two years ago I started my adventure with the nRF52840 microcontroller. I started using SEGGER Embedded Studio for ARM as my development IDE. I created a peripheral BLE device and am able to update the firmware via bluetooth following the pca10056_s140_ble_debug example of the SDK.

Now I want to use Zephyr OS.

My question is: can I still use the bootloader I used previously?

If not, how can I update my device with the new firmware developed with the Zephyr?

Thank you.

Parents Reply Children
  • HI,

    I didn't quite understand.

    My situation is this:

    1) I program nRF52840 microcontroller using nRF5_SDK_17.1.0 and SEGGER Embedded Studio for ARM.

    2) as bootloader I used the example pca10056_s140_ble_debug available in the SDK

    3) I create the DFU package using nrfutil tool and the following command

    python nordicsemi/__main__.py pkg generate --application myApplication.hex myApplication.zip --hw-version 1 --sd-req 0x100 --application-version 1 --key-file priv.pem

    4) finally I switch my device to DFU mode and, via the "nRF Connect" app on my smartphone, I connect and send the DFU package.

    Everything works fine.

    Now I want to switch to using the Zephyr.

    I wrote the code for my application using the Zephyr and it works.

    Now I want to create a DFU package to install my application on my device without changing the bootloader. It can be done?

    I tried to create the DFU package using the .hex file generated by the Zephyr:

    python nordicsemi/__main__.py pkg generate --application myZephyrApplication.hex myZephyrApplication.zip --hw-version 1 --sd-req 0x100 --application-version 1 --key-file priv.pem

    The DFU package is created but when I install it on my device nothing works.

    How can I do?

    Thank you

  • I bet you forgot CONFIG_FLASH_LOAD_OFFSET, and your zephyr image will overwrite the MBR

  • Hi Sigurd Hellesvik,

    Thanks for the reply.
    I actually entered the CONFIG_FLASH_LOAD_OFFSET command.
    Below I report the contents of my prj.conf file:

    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    CONFIG_MAIN_STACK_SIZE=4096
    
    CONFIG_BT=y
    CONFIG_LOG=y
    
    CONFIG_BT_SMP=y
    CONFIG_BT_SIGNING=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DIS=y
    CONFIG_BT_ATT_PREPARE_COUNT=5
    CONFIG_BT_PRIVACY=y
    
    CONFIG_BT_DEVICE_NAME="My app"
    CONFIG_BT_DEVICE_APPEARANCE=833
    CONFIG_BT_DEVICE_NAME_DYNAMIC=y
    CONFIG_BT_DEVICE_NAME_MAX=65
    CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
    CONFIG_BT_SETTINGS=y
    
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_RTT_CONSOLE=y
    CONFIG_CONSOLE=y
    CONFIG_PRINTK=y
    CONFIG_LOG_PRINTK=n
    
    CONFIG_GPIO=y
    CONFIG_PWM=y
    CONFIG_LED=y
    CONFIG_I2C=y
    CONFIG_ADC=y
    CONFIG_DEBUG_OPTIMIZATIONS=y
    CONFIG_DEBUG_THREAD_INFO=y
    CONFIG_LOG_MODE_IMMEDIATE=y
    
    CONFIG_FLASH_LOAD_OFFSET=0x27000 <-------

    Below are the images of the flash after the firmware update:

    As you can see, the firmware is loaded correctly starting from address 0x27000. However, the application doesn't work. How come? Can you help me? Am I forgetting some settings?

    Thank you
    Best regards.

  • Stefano1984 said:

    How come? Can you help me? Am I forgetting some settings?

    How does the same addr map look for a nRF5 application?

    Do you get any logs at all?

  • Hi Sigurd Hellesvik,

    Thanks for the reply.

    I don't understand what I need to check.

    Can you explain it better? I'm new to Zephyr.

    Thank you.

Related