forked from EmbeddedTeam/app_photomagnetic
Implement device firmware upgrade using MCUboot Serial Recovery over usart1 (reusing the existing protocol UART). The application layer handles upgrade commands (0xFF) to trigger bootloader entry, while MCUboot manages the actual firmware swap with RSA signature verification. Key additions: - sysbuild.conf to enable MCUboot bootloader with signing key - mcuboot.conf with serial recovery and watchdog feed settings - Kconfig option APP_DFU (default y) with conditional compilation - dfu.cpp module for DFU initialization - Upgrade command callback in com.hpp (bootmode_set + sys_reboot) - Documentation for upgrade procedures and change notes
23 lines
535 B
Plaintext
23 lines
535 B
Plaintext
# ── Serial Recovery 配置 ──
|
|
CONFIG_MCUBOOT_SERIAL=y
|
|
CONFIG_BOOT_SERIAL_UART=y
|
|
|
|
# 禁用 GPIO 按钮检测
|
|
CONFIG_BOOT_SERIAL_ENTRANCE_GPIO=n
|
|
|
|
# 等待 mcumgr 命令触发进入 serial recovery
|
|
CONFIG_BOOT_SERIAL_WAIT_FOR_DFU=y
|
|
CONFIG_BOOT_SERIAL_WAIT_FOR_DFU_TIMEOUT=3000
|
|
|
|
# 喂狗(避免升级过程中看门狗复位)
|
|
CONFIG_BOOT_WATCHDOG_FEED=y
|
|
|
|
# ── 签名验证 ──
|
|
CONFIG_BOOT_SIGNATURE_TYPE_RSA=y
|
|
|
|
# ── 优化 ──
|
|
CONFIG_BOOT_ERASE_PROGRESSIVELY=y
|
|
|
|
# ── 日志 ──
|
|
CONFIG_MCUBOOT_LOG_LEVEL_WRN=y
|