Skip to content

Commit abc3dea

Browse files
MarekPietarlubos
authored andcommitted
[nrf fromlist] boot: zephyr: Add default values of boot detect pins
Change introduces default values of CONFIG_BOOT_SERIAL_DETECT_PIN and CONFIG_BOOT_USB_DFU_DETECT_PIN. This is needed to prevent build issues caused by uninitialized Kconfig. Upstream PR: mcu-tools/mcuboot#1472 Jira: NCSDK-16550 Signed-off-by: Marek Pieta <[email protected]> (cherry picked from commit fddbe51b5bd4b400f736b28ed040fe87cf1d969a)
1 parent 1d535d0 commit abc3dea

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

boot/zephyr/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ config BOOT_USB_DFU_DETECT_PIN
450450
default 13 if BOARD_NRF52DK_NRF52832
451451
default 23 if BOARD_NRF5340_DK_NRF5340_CPUAPP || BOARD_NRF5340_DK_NRF5340_CPUAPP_NS
452452
default 43 if BOARD_BL5340_DVK_CPUAPP || BOARD_BL5340_DVK_CPUAPP_NS
453+
default -1
453454
help
454455
Pin on the DFU detect port that triggers DFU mode.
455456

boot/zephyr/Kconfig.serial_recovery

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ config BOOT_SERIAL_DETECT_PIN
7070
default 13 if BOARD_NRF52DK_NRF52832 || BOARD_NRF52833DK_NRF52833
7171
default 23 if BOARD_NRF5340PDK_NRF5340_CPUAPP || BOARD_NRF5340PDK_NRF5340_CPUAPP_NS || \
7272
BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_NRF5340DK_NRF5340_CPUAPP_NS
73+
default -1
7374
help
7475
Pin on the serial detect port that triggers serial recovery mode.
7576

boot/zephyr/main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ static const struct gpio_dt_spec button0 = GPIO_DT_SPEC_GET(BUTTON_0_NODE, gpios
421421

422422
#if defined(CONFIG_MCUBOOT_SERIAL)
423423

424+
/* The value of -1 is used by default. It must be properly specified for a board before used. */
425+
BUILD_ASSERT(CONFIG_BOOT_SERIAL_DETECT_PIN != -1);
426+
424427
#define BUTTON_0_GPIO_LABEL CONFIG_BOOT_SERIAL_DETECT_PORT
425428
#define BUTTON_0_GPIO_PIN CONFIG_BOOT_SERIAL_DETECT_PIN
426429
#define BUTTON_0_GPIO_FLAGS ((CONFIG_BOOT_SERIAL_DETECT_PIN_VAL) ?\
@@ -429,6 +432,9 @@ static const struct gpio_dt_spec button0 = GPIO_DT_SPEC_GET(BUTTON_0_NODE, gpios
429432

430433
#elif defined(CONFIG_BOOT_USB_DFU_GPIO)
431434

435+
/* The value of -1 is used by default. It must be properly specified for a board before used. */
436+
BUILD_ASSERT(CONFIG_BOOT_USB_DFU_DETECT_PIN != -1);
437+
432438
#define BUTTON_0_GPIO_LABEL CONFIG_BOOT_USB_DFU_DETECT_PORT
433439
#define BUTTON_0_GPIO_PIN CONFIG_BOOT_USB_DFU_DETECT_PIN
434440
#define BUTTON_0_GPIO_FLAGS ((CONFIG_BOOT_USB_DFU_DETECT_PIN_VAL) ?\

0 commit comments

Comments
 (0)