SHA-256 hash verification of flash slots, pico_hash_binary, flash:: namespace, ring_buffer iterator, non-destructive log

This commit is contained in:
Ian Gulliver
2026-04-12 23:47:00 +09:00
parent cc37b711a4
commit 23587c41e2
7 changed files with 210 additions and 64 deletions

View File

@@ -12,6 +12,7 @@ pico_sdk_init()
set(LIB_SOURCES
lib/arp.cpp
lib/dispatch.cpp
lib/flash.cpp
lib/handlers.cpp
lib/icmp.cpp
lib/igmp.cpp
@@ -21,7 +22,7 @@ set(LIB_SOURCES
w6300/w6300.cpp
)
set(LIB_DEPS pico_stdlib tinyusb_device tinyusb_board hardware_pio hardware_spi hardware_dma hardware_clocks)
set(LIB_DEPS pico_stdlib pico_sha256 tinyusb_device tinyusb_board hardware_pio hardware_spi hardware_dma hardware_clocks)
add_executable(picomap firmware.cpp ${LIB_SOURCES})
target_include_directories(picomap PRIVATE include w6300)
@@ -35,6 +36,7 @@ math(EXPR VERSION_MAJOR "${BUILD_EPOCH} >> 16")
math(EXPR VERSION_MINOR "${BUILD_EPOCH} & 65535")
pico_set_binary_version(picomap MAJOR ${VERSION_MAJOR} MINOR ${VERSION_MINOR})
target_compile_definitions(picomap PRIVATE BUILD_EPOCH=${BUILD_EPOCH})
pico_hash_binary(picomap)
pico_embed_pt_in_binary(picomap ${CMAKE_CURRENT_LIST_DIR}/partition_table.json)
pico_add_extra_outputs(picomap)
target_link_libraries(picomap ${LIB_DEPS})
@@ -48,6 +50,7 @@ pico_enable_stdio_uart(picomap_test 0)
pico_set_binary_type(picomap_test copy_to_ram)
pico_set_binary_version(picomap_test MAJOR ${VERSION_MAJOR} MINOR ${VERSION_MINOR})
target_compile_definitions(picomap_test PRIVATE BUILD_EPOCH=${BUILD_EPOCH})
pico_hash_binary(picomap_test)
pico_embed_pt_in_binary(picomap_test ${CMAKE_CURRENT_LIST_DIR}/partition_table.json)
pico_add_extra_outputs(picomap_test)
target_link_libraries(picomap_test ${LIB_DEPS})