Repository navigation
Added MCUboot support for RAK4631 module - #9
Conversation
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
|
Claude finished @srcnert's task in 5m 44s —— View job Review of the latest push
This push mostly lands review feedback, and the substantive parts look right to me:
Three things still open, all posted inline:
Still open from earlier rounds, not re-posted inline to avoid repetition:
One withdrawal: I flagged the I also re-checked the |
38892cf to
1182821
Compare
1182821 to
7e10ddf
Compare
7e10ddf to
9d7df87
Compare
9d7df87 to
bb1be3c
Compare
bb1be3c to
c157816
Compare
Signed-off-by: Sercan Erat <sercan.erat@rakwireless.com>
c157816 to
ca3f2a3
Compare
Adds MCUboot as the first-stage bootloader for the RAK4631 (nRF52840), so the
loader and the sketch can both be updated over USB CDC-ACM without a J-Link.
Flash layout
The RAK4631 flash map moves into a shared
rak4631_nrf52840_partitions.dtsi,included by both the loader overlay and the MCUboot image overlay so the two
can never drift:
boot_partition0x00000slot0_partition/code_partition0x10000slot1_partition/user_sketch0x80000storage_partition0xf8000Entering serial recovery
Two ways in, both routed through a boot-mode retention area in the last 1 KB of
SRAM (
rak4631_nrf52840_bootmode.dtsi, also shared between the two images):modules/rak_double_tapmodule, built into theMCUboot image. The first pin reset arms a magic value and busy-waits
CONFIG_RAK_DOUBLE_TAP_WINDOW_MS(default 500 ms) with the LED lit; a secondreset inside that window sets
BOOT_MODE_TYPE_BOOTLOADER.variants/rak4631_nrf52840/variant.cppimplements_on_1200_bps(), setting the same boot mode and resetting, soarduino-cli uploadworks without touching the reset button.bootmode_setis added toloader/llext_exports.cso the sketch can reach it.Build and upload
extra/build.shgains--mcuboot, which switches the loader build towest build --sysbuildand picks uploader/sysbuild.conf,loader/overlay_mcuboot.confandloader/sysbuild/mcuboot/. Artifact pathsmove under
build/<variant>/loader, andfirmwares/mcuboot-<variant>.hexisproduced alongside the signed loader.
mcumgrtool and programmer inplatform.txt/programmers.txt/boards.txt:uploadwrites the sketch to slot 1,burn-bootloadersendsthe 1200-bps touch itself (arduino-cli does not) and then writes the loader
to slot 0.
extra/rak/checkall.py) now builds the loader with--mcuboot.Other changes
loader/rak4630_regout0.cmoves tomodules/rak_regout0_fix/, becoming aKconfig-selectable module (
CONFIG_RAK_REGOUT0_FIX) so the MCUboot image andthe samples can enable it too — the REGOUT0 fix has to run before the 3.3 V
rail is needed, including in the bootloader. A new top-level
modules/directory is wired into
CMakeLists.txtandKconfig.rak.Serialenumeratesfirst, which is what the 1200-bps touch needs to land on; the console/logging
port moves to third. This is user-visible: the console is no longer the
first port.
(
key/arduino_key_ecdsa-p256.pem). Asloader/sysbuild.confnotes, this keyis for development only and must be replaced for production.
loader/mcuboot.mddocuments installingmcumgr/scripting-toolsand themanual upload commands.