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
31 lines
683 B
CMake
31 lines
683 B
CMake
# SPDX-License-Identifier: Apache-2.0
|
|
cmake_minimum_required(VERSION 3.20.0)
|
|
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
|
project(app_photomagnetic)
|
|
|
|
|
|
|
|
target_include_directories(app PRIVATE include)
|
|
|
|
if(CONFIG_SAMPLE_HELLOWORLD)
|
|
message("CONFIG_SAMPLE_HELLOWORLD is enabled")
|
|
target_sources(app PRIVATE src/sample_hello_world.cpp)
|
|
elseif(CONFIG_SAMPLE_NTC)
|
|
message("CONFIG_SAMPLE_NTC is enabled")
|
|
target_sources(app PRIVATE src/sample_ntc.cpp)
|
|
else()
|
|
message("build main app")
|
|
|
|
target_sources(app PRIVATE
|
|
src/main.cpp
|
|
src/led.cpp
|
|
src/temp.cpp
|
|
src/watdog.cpp
|
|
src/com.cpp
|
|
)
|
|
|
|
zephyr_sources_ifdef(CONFIG_APP_DFU
|
|
src/dfu.cpp
|
|
)
|
|
endif()
|