Change GPIO for trigger DFU update

Hello !

I would like to change standard DFU pin ( 0,23 ) to own one e.g 0,4

 I have forwarded 0,23 to net core and add to mcuboot.conf the next configuration :

# Use GPIO for trigger update
CONFIG_BOOT_SERIAL_DETECT_PORT="GPIO_0"
#CONFIG_BOOT_SERIAL_DETECT_PIN=23
CONFIG_BOOT_SERIAL_DETECT_PIN=4
CONFIG_BOOT_SERIAL_DETECT_PIN_VAL=0
CONFIG_BOOT_SERIAL_DETECT_DELAY=0

And application core reboot all the time in loop, even I only forward this pin to network core.

How to change DFU trigger pin in correct way  in all bootloaders and core images ?

How disable GPIO trigger pin completely for be sure if it not used by zephyr components ?

I need 0,23 for own usage on network core side in any case, even FW update feature can be disabled for now.

** Booting Zephyr OS build v3.2.99-ncs2 ***
I: Starting bootloader
I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
I: Boot source: none
I: Swap type: none
I: Bootloader chainload address offset: 0x18000

... reboot again ...

Regards,

Eugene

  • Hi,

    # Use GPIO for trigger update
    CONFIG_BOOT_SERIAL_DETECT_PORT="GPIO_0"
    #CONFIG_BOOT_SERIAL_DETECT_PIN=23
    CONFIG_BOOT_SERIAL_DETECT_PIN=4
    CONFIG_BOOT_SERIAL_DETECT_PIN_VAL=0
    CONFIG_BOOT_SERIAL_DETECT_DELAY=0

    What SDK version are you using ? In the latest version this is set by dts.

    From the release notes here,

    • Edited the DFU detection’s GPIO-pin configuration to be done through DTS using the mcuboot-button0 pin alias.

    Example usage: https://github.com/nrfconnect/sdk-zephyr/blob/v3.3.99-ncs1/boards/arm/thingy53_nrf5340/thingy53_nrf5340_common.dts#L134

  • Hello !

    Looks like in new 2.4.0 those symbols is really forbidden, for example : 

    : warning: attempt to assign the value '"GPIO_0"' to the undefined symbol BOOT_SERIAL_DETECT_PORT

    Can you be more precise about actual changes what need in overlay file for application core or and mcuboot.

    At root I have file nrf5340dk_nrf5340_cpuapp.overlay   where I forward 0,23 to net core as occasional pin

    /* Enable pin forwarding to network core.
    * The selected pins will be used for debug purposes.
    */
    gpio_fwd {
    compatible = "nordic,nrf-gpio-forwarder";
    dm-gpio-if {
    gpios = <&gpio0 24 0>, // SW2
    <&gpio0 8 0>, // SW3
    <&gpio0 9 0>, // SW4
    <&gpio1 15 0>,
    <&gpio1 13 0>,
    <&gpio1 10 0>,
    /* */
    <&gpio0 15 1>, 
    <&gpio0 14 1>, 
    <&gpio0 13 1>, 
    <&gpio1 12 1>, 
    <&gpio1 11 1>, 
    <&gpio1 10 1>,
    /* */
    <&gpio0 23 0>; // SW1
    };
    };

    But how mcuboot releative files need to be modified ?

    I think application core is not used this pin if buttons is not in use ?

    I mean is any fast way to define exact gpio numbers for

    mcuboot-button0 = &button1;
    mcuboot-led0 = &blue_led;

     

    If I put definitions like this

    buttons {
    compatible = "gpio-keys";
    buttonx: button_x {
    gpios = <&gpio0 4 GPIO_PULL_UP>;
    label = "DFU button switch";
    };
    };

    /* These aliases */
    aliases {
    mcuboot-button0 = &buttonx;
    //mcuboot-led0 = &led1;
    //watchdog0 = &wdt0;
    };

    to file rf5340dk_nrf5340_cpuapp.overlay, it is not taken in use.

    Looks like dtc overlay for mcuboot need to be specified in other way.

    Regards,

    Eugene

  • Hi !

    Looks like mcuboot.overlay named file can be placed to folder child_image where mcuboot.conf id located also.

    Regards,

    Eugene

  • Hiihtaja said:
    Looks like mcuboot.overlay named file can be placed to folder child_image where mcuboot.conf id located also.

    Yes, that is right. Did that solve the issue?

  • Yes, pins are remapped.

    LED in bootloader just ON. May be fading , like in nrf52840 is not possible.

    In new 2.4 release I can update  net core image but not app. Something was changed.

    But this is other story what I test right now.

Related