I have MCUBOOT working using the default UART pin numbers. I need to change the UART RX and TX pin numbers used by MCUBOOT for a custom application. I am able to change the UART pin numbers used in the application firmware by creating an overlay file and referencing the overlay file with a -DDTC_OVERLAY_FILE:STRING= argument in the extra CMake arguments in the VS Code build configuration.
I read the examples given on DevZone and created an overlay file for MCUBOOT.called mcuboot_dtc.overlay as shown below. This file is in a child_image directory.
&uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 0)>,
<NRF_PSEL(UART_RTS, 0, 5)>;
};
group2 {
psels = <NRF_PSEL(UART_RX, 0, 8)>,
<NRF_PSEL(UART_CTS, 0, 7)>;
bias-pull-up;
};
};
&uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 0)>,
<NRF_PSEL(UART_RX, 0, 8)>,
<NRF_PSEL(UART_RTS, 0, 5)>,
<NRF_PSEL(UART_CTS, 0, 7)>;
low-power-enable;
};
};
I added lines to the CMakeLists.txt file to reference the overlay file.
cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(blinky)
set(mcuboot_DTC_OVERLAY_FILE
${CMAKE_CURRENT_SOURCE_DIR}/child_image/mcuboot_dtc.overlay
)
set(mcuboot_CONF_FILE
${CMAKE_CURRENT_SOURCE_DIR}/child_image/mcuboot.conf
)
target_sources(app PRIVATE src/main.c)
After these additions MCUBOOT is still using the default UART pin numbers. Is this the right approach? What could I missing?
Your help is appreciated.
Ray