From Thingy53 to custom board

Hi community,

I`m trying to develop a custom board with nRF5340, now comes the question how to flash it?

The application was developed with the Thingy53. On Thingy53 the bootloader mode is activated by cycling the power during press the button SW2(P1.14).

we also want to use another pin for activating the bootloader mode, therefore we also need to customize the bootloader.

so my questions are: 

1. how to customize/develop the bootloader?

2. Is it possible to use another pin for activating the bootloader mode?

3. how to flash the custom bootloader?

Thanks in advance

Danny

Parents
  • Hi AHaug,

    thanks for replying me.

    I go throgh the lessons again, It´s more about DFU. not about how to flash the Bootloader in a empty nRF5340.

    My understanding is like this, please correct me, if I´m wrong.

    The MCUboot(Bootloader) will be  automatically compiled if CONFIG_BOOTLOADER_MCUBOOT=y is set in the project conf file. 

    the Bootload can be found under project_name\build\mcuboot\zephyr\zephyr.hex

    I tried to use the Programmer from nRF Connect for Desktop to flash this hex file inito thingy53, but failed as followed:

    11:33:15.271
    Error: Failed with exit code 1. One or more program tasks failed. Message: Failed, [mcuBoot] Unable to parse MCUBoot image file. Unable to parse image header: invalid magic value.
    11:33:15.271
    MCUboot DFU failed with error: Error: Failed with exit code 1. One or more program tasks failed. Message: Failed, [mcuBoot] Unable to parse MCUBoot image file. Unable to parse image header: invalid magic value.
    11:33:15.271
    Error: Failed with exit code 1. One or more program tasks failed. Message: Failed, [mcuBoot] Unable to parse MCUBoot image file. Unable to parse image header: invalid magic value.
    In the Exercise 2 of Lesson 8, 
    Until here not explained what is built and flashed? If only the Application, then it´s also not what i`m looking for. 
    Again, I want to know how to flash the Bootloader in an empty nRF5340.
  • danny0007 said:
    The MCUboot(Bootloader) will be  automatically compiled if CONFIG_BOOTLOADER_MCUBOOT=y is set in the project conf file. 

    This is correct, for multi image builds such as a build including MCUboot/bootloader and an app, you must also make sure that you meet the conditions mentioned in the multi-image builds documentation as well as this one specifically mentioned for the nrf5340.

    Do note that there will be changes w.r.t the parent/child support in upstream Zephyr so there might be some changes when sysbuild is introduced in 2.7.0/later releases of NCS.

    danny0007 said:
    the Bootload can be found under project_name\build\mcuboot\zephyr\zephyr.hex

    This is also correct

    danny0007 said:
    I tried to use the Programmer from nRF Connect for Desktop to flash this hex file inito thingy53, but failed as followed

    I assume that you've seen the working with the Thingy:53, but in case you haven't here's another two link that you should have a look at https://docs.nordicsemi.com/bundle/ncs-2.7.0-rc2/page/nrf/device_guides/nrf53/thingy53_application_guide.html and https://docs.nordicsemi.com/bundle/ncs-2.7.0-rc2/page/nrf/gsg_guides/thingy53_gs.html 

    Are you following this guide when programming the bootloader through nRF Connect for Desktop? https://docs.nordicsemi.com/bundle/ncs-2.7.0-rc2/page/nrf/gsg_guides/thingy53_gs.html#getting_started_with_precompiled_firmware_samples 

    danny0007 said:
    Until here not explained what is built and flashed?

    Thats right. When building all of the components are built as a default to ensure that versions and signings are matching. You can choose to set up the build system/configure your project so that you only build MCUboot or the application, but then you will have to manually sign all of the images with the same key to ensure that they are compatible with each other.

    danny0007 said:
    Again, I want to know how to flash the Bootloader in an empty nRF5340.

    Could you try using nrfjprog -f NRF53 --sectorerase --program mcuboot/zephyr/zephyr.hex --verify on a DK if you have one available to verify that this works on the 53 DK and then try to use this command on the Thingy through the DK?

    Kind regards,
    Andreas

Reply Children
Related