Skip to content

Conversation

@hrfarmer
Copy link
Collaborator

@hrfarmer hrfarmer commented Nov 1, 2025

Right now the process for getting mcuboot to build is very fragile, that will be addressed later once I can actually figure out how to even get it properly working.

The zephyr submodule was bumped to the specific commit that merged support for the RP2350 flash controller (zephyrproject-rtos/zephyr#89182), and the following diffs will need to be applied to mcuboot (lib/zephyr-workspace/bootloader/mcuboot):

diff --git a/boot/zephyr/CMakeLists.txt b/boot/zephyr/CMakeLists.txt
index c601afa6..949bfa1a 100644
--- a/boot/zephyr/CMakeLists.txt
+++ b/boot/zephyr/CMakeLists.txt
@@ -313,9 +313,13 @@ if(CONFIG_MCUBOOT_SERIAL)
   zephyr_sources(${BOOT_DIR}/zephyr/serial_adapter.c)
   zephyr_sources(${BOOT_DIR}/boot_serial/src/boot_serial.c)
   zephyr_sources(${BOOT_DIR}/boot_serial/src/zcbor_bulk.c)
+  zephyr_sources(${BOOT_DIR}/zcbor/src/zcbor_decode.c)
+  zephyr_sources(${BOOT_DIR}/zcbor/src/zcbor_encode.c)
+  zephyr_sources(${BOOT_DIR}/zcbor/src/zcbor_common.c)
 
   zephyr_include_directories(${BOOT_DIR}/bootutil/include)
   zephyr_include_directories(${BOOT_DIR}/boot_serial/include)
+  zephyr_include_directories(${BOOT_DIR}/zcbor/include)
   zephyr_include_directories(include)
 
   zephyr_include_directories_ifdef(
diff --git a/boot/zephyr/prj.conf b/boot/zephyr/prj.conf
index 02b27f1c..e4fd3fba 100644
--- a/boot/zephyr/prj.conf
+++ b/boot/zephyr/prj.conf
@@ -13,16 +13,16 @@ CONFIG_BOOT_BOOTSTRAP=n
 
 ### We never want Zephyr's copy of tinycrypt.  If tinycrypt is needed,
 ### MCUboot has its own copy in tree.
-# CONFIG_TINYCRYPT is not set
-# CONFIG_TINYCRYPT_ECC_DSA is not set
-# CONFIG_TINYCRYPT_SHA256 is not set
 
 CONFIG_FLASH=y
+CONFIG_FLASH_MAP=y
 
 ### Various Zephyr boards enable features that we don't want.
 # CONFIG_BT is not set
 # CONFIG_BT_CTLR is not set
-# CONFIG_I2C is not set
+
+CONFIG_I2C=y
+CONFIG_SENSOR=y
 
 CONFIG_LOG=y
 CONFIG_LOG_MODE_MINIMAL=y # former CONFIG_MODE_MINIMAL
@@ -36,3 +36,19 @@ CONFIG_CBPRINTF_NANO=y
 CONFIG_PICOLIBC=y
 ### Disable malloc arena because we don't need it
 CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=0
+
+CONFIG_GPIO=y
+
+CONFIG_MCUBOOT_SERIAL=y
+CONFIG_BOOT_SERIAL_UART=y
+CONFIG_UART_CONSOLE=n
+
+CONFIG_BOOT_SERIAL_CDC_ACM=y
+CONFIG_BOOT_SERIAL_WAIT_FOR_DFU=y
+CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT=100000
+CONFIG_MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD=y
+
+CONFIG_BOOT_SERIAL_ENTRANCE_GPIO=n
+
+CONFIG_USB_DEVICE_PID=0x000F
+CONFIG_USB_DEVICE_VID=0x2E8A

You will then also need a python venv for some build requirements, I just made a venv and installed zephyr's requirements.txt and that worked (from what I remember).

This is the build command I used (paths will need to be changed for your machine)
west build -c -b proves_flight_control_board_v5c/rp2350a/m33 /Users/aychar/code/lib/zephyr-workspace/bootloader/mcuboot/boot/zephyr -- -DBOARD_ROOT=/Users/aychar/code/proves-core-reference, and as well I had to specifically run it while inside of proves-core-reference, otherwise I'd get errors about pem keys(??).

boards/bronco_space/proves_flight_control_board_v5c/Kconfig.proves_flight_control_board_v5c will also need to be changed to your specific path for proves-core-reference for now, the relative path was not working for me when trying to build mcuboot with the board definition still being in proves-core-reference.

The current state this is in right now, I'm able to build the uf2 for mcuboot and put it on a v5c board, and as well the serial connection does show up in /dev. However, whenever I try to use mcumgr(will probably also want to install this) to flash proves-core-reference to the first partition, nothing happens. I think that the board may be crashing, or possibly could be an issue with how I set up the serial, because the mcumgr echo command also returns nothing from the board.

@hrfarmer hrfarmer requested a review from LeStarch November 1, 2025 00:33
@ineskhou ineskhou moved this to In progress in v0.1-v0.3 Nov 5, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in v0.1-v0.3 Nov 30, 2025
@Mikefly123
Copy link
Contributor

Closed, superseded by #140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants