This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF5340 - UART boot mode selection

Hello,

I want to program nRF5340 via UART.

What is the hardware related event that puts the application processor in program mode over the UART ?

All ARM microprocessors I've worked with have special pins with "boot-mode" function.
When the device reset is deasserted, the boot mode selection is determined by the logic values of these pins.
I suppose nRF5340 does the same. Or not?

I'm in the hardware design process, and need to fix this.

Regards,
Gabriele

Parents
  •  Thanks haakonsh,

    Kconfig tells that BOOT_SERIAL_DETECT_PIN is "11" for BOARD_NRF52840_PCA10056.
    In the HW schematics of PCA10056 the RESET pin is P0.18.
    How does P0.18 relates to 11 ?

Reply
  •  Thanks haakonsh,

    Kconfig tells that BOOT_SERIAL_DETECT_PIN is "11" for BOARD_NRF52840_PCA10056.
    In the HW schematics of PCA10056 the RESET pin is P0.18.
    How does P0.18 relates to 11 ?

Children
  • You're mixing two concepts here. The reset pin called nRESET is used to reset the MCU, in case of the nRF52840 this pin can be configured as a GPIO instead.

    The BOOT_SERIAL_DETECT_PIN is used to signal the bootloader that you wish to start the DFU procedure.


  • If I understand well,
    P0.18 is the reset pin
    P0.11 is the in to get monitored to start DFU
    Is it correct ?

  • Yes, the bootloader checks the BOOT_SERIAL_DETECT_PIN during boot and starts the DFU process. The reset pin is used to start the bootloader.

  •  Great.

    In my application the user cannot put her hands on the board, to press buttons etc. Thus DFU must be entirely managed by SW.
    This is the idea (look at the circuit)

    a) the user sends a command like "please, DFU on next reboot"
    b) the nRF5340 sets DFUEN high long enough to charge the capacitor, then resets the board
    c) on reboot DFUBOOTn is found low, and the DFU process starts
    d) during the DFU process, the capacitor discharges through the large resistor

  • If the ext MCU will send a UART command to the application then you can just store that state in persistent storage and issue a system reset, then check for that state in the bootloader. In that case, you won't need the BOOT_SERIAL_DETECT_PIN  signal at all.