mcuboot enter with button

hi support team,

i was testing smp_svr, i want to add button to my application that once i press the button and reset, the device will stay in mcuboot (serial port mode)and i can program my device with serial port, liking our old sdk bootloader----examples\dfu\secure_bootloader\pca10040_uart , how can i accieve this function?

it it more like how our thingy53 works.

 i don't know how to add button or gpio to my project.

Thanks!

Regards,

William.

Parents Reply Children
  • nrfutil is searching for VID and PID of the device to match a pre-set number of PIDs.
    So you have three alternatives

    • Use another tool for the programming. See here for a list
    • add PID and VID to your nRF52840
    • nrfutil device x-execute -o program --args 'firmware[file]=./dfu_application.zip' --device-filter 'serialNumber=4254EFB4D8746FF6' --override-traits mcuBoot --inject 'mcuBoot[vcom]=0
  • Hi Sigurd,

     i was still not able to program device as below: however mcumgr is working after nrfutil device program fails

    C:\Users\William>nrfutil device x-execute -o program --args 'firmware=C:\ncs\v2.6.0\test\peripheral_uart\build\zephyr\dfu_application.zip' --device-filter 'serialNumber=683014854' --override-traits mcuBoot --inject 'mcuBoot[COM23]=0'
    Error: No devices with requested filter found

    C:\Users\William>>mcumgr -c myCOM image upload C:\ncs\v2.6.0\test\peripheral_uart\build\zephyr\app_update.bin
    '-c' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Users\William>>mcumgr -c myCOM image upload C:\ncs\v2.6.0\test\peripheral_uart\build\zephyr\app_update.bin
    '-c' is not recognized as an internal or external command,
    operable program or batch file.

    C:\Users\William>mcumgr conn add myCOM type="serial" connstring="dev=COM23,baud=115200,mtu=256"
    Connection profile myCOM successfully added

    C:\Users\William>mcumgr -c myCOM image upload C:\ncs\v2.6.0\test\peripheral_uart\build\zephyr\app_update.bin
    6.31 KiB / 219.90 KiB [=>------------------------------------------------------------------] 2.87% 2.38 KiB/s 01m29s
    C:\Users\William>

    it is really hard to findout what's wrong in my command.

    snr 683014854 should be correct as i can select this jlink to program:

    C:\ncs\v2.6.0\test\peripheral_uart>west flash --recover --snr 683014854
    -- west flash: rebuilding
    [0/4] Performing build step for 'mcuboot_subimage'ninja: no work to do.

    [3/3] Completed 'mcuboot_subimage'
    -- west flash: using runner nrfjprog
    -- runners.nrfjprog: reset after flashing requested
    -- runners.nrfjprog: Recovering and erasing all flash memory.
    Recovering device. This operation might take 30s.
    Erasing user code and UICR flash areas.

    Regrads,

    William.

  • If the command does not work, i think I will just suggest that you use one of the other tools for now.

    I spoke to our nrfutil developers, and it does not officially support SMP yet

  • and it does not officially support SMP yet

    Hi Sigurd,

    it doesn't make any sense.

    For assert_tracker_v2, with borad thingy91 it is working now. 

    how does this command work?

    C:\Users\William>nrfutil device program --firmware C:\ncs\v2.6.0\nrf\applications\asset_tracker_v2\build\zephyr\app_signed.hex --traits mcuBoot
    [00:00:01] ###### 100% [5/5 THINGY91_F6ABB02220E9] Programmed

    and it is clear that we can program device with mcuBoot:

    Regards,

    William.

  • William.wei said:
    For assert_tracker_v2, with borad thingy91 it is working now. 

    The Thingys has the PID and VID set correctly. See here.

    William.wei said:
    and it is clear that we can program device with mcuBoot:

    The sentence means that we support MCUboot programming with nrfutil, but only for a subset of our devices (which have specific VIDs and PIDs).
    We do not yet support detecting other devices with SMP enabled. I asked about this in https://nordicsemi.atlassian.net/browse/NCSIDB-969, and got to know that it was not supported yet.

Related