From 300a4b03c697e14787959b94ee7e693a4ddd10a8 Mon Sep 17 00:00:00 2001 From: zxkmm Date: Tue, 17 Feb 2026 12:31:03 +0800 Subject: [PATCH] fix the FLASH ERR warn on hackrf pro plus PP H1/2/3/4 (#2997) * init * remove mbt --- CMakeLists.txt | 4 +++- firmware/application/ui_navigation.cpp | 2 +- flashsize.h.in | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b4ef0e94d..1086ac30f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,9 +41,11 @@ message("Configuring for FLASH_MB_SIZE=${FLASH_MB_SIZE}MB") if(NOT DEFINED FLASH_MB_LIMIT_SIZE) if(BOARD STREQUAL "PRALINE") set(FLASH_MB_LIMIT_SIZE 3.5) #PRALINE 4 MB = 3.5 firmware + 0.5 MB fpga bitstream. + set(FLASH_MB_LIMIT_WITH_BITSTREAM_SIZE 4) #PRALINE 4 MB = 3.5 firmware + 0.5 MB fpga bitstream. else() set(FLASH_MB_LIMIT_SIZE 1) #TODO: should be ${FLASH_MB_SIZE} remove once we got a stable build for all devices we support with bigger than 1 mb flash - endif() + set(FLASH_MB_LIMIT_WITH_BITSTREAM_SIZE 1) # the hackrf one ain't have bitstream. this is to satisfy the FLASH ERR checker. + endif() endif() message("Configuring for FLASH_MB_LIMIT_SIZE=${FLASH_MB_LIMIT_SIZE}MB") diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index 210a8fe3a..538d9c2f9 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -607,7 +607,7 @@ bool InformationView::firmware_checksum_error() { // only checking firmware checksum once per boot if (!fw_checksum_checked) { - fw_checksum_error = (simple_checksum(FLASH_STARTING_ADDRESS, FLASH_SIZE_LIMIT_MB * 1024 * 1024) != FLASH_EXPECTED_CHECKSUM); + fw_checksum_error = (simple_checksum(FLASH_STARTING_ADDRESS, FLASH_SIZE_LIMIT_WITH_BITSTREAM_MB * 1024 * 1024) != FLASH_EXPECTED_CHECKSUM); } return fw_checksum_error; } diff --git a/flashsize.h.in b/flashsize.h.in index a35ea111c..bc0d52313 100644 --- a/flashsize.h.in +++ b/flashsize.h.in @@ -6,4 +6,6 @@ #define FLASH_SIZE_MB @FLASH_MB_SIZE@ //Current compiled fw size in MB #define FLASH_SIZE_LIMIT_MB @FLASH_MB_LIMIT_SIZE@ +//Current compiled fw + bitstream size in MB +#define FLASH_SIZE_LIMIT_WITH_BITSTREAM_MB @FLASH_MB_LIMIT_WITH_BITSTREAM_SIZE@ // clang-format on \ No newline at end of file