From e9e78609b78f720bc4af23ea03ab910f00c3a9ea Mon Sep 17 00:00:00 2001 From: zxkmm Date: Tue, 17 Feb 2026 16:06:38 +0800 Subject: [PATCH] init (#3000) --- CMakeLists.txt | 2 -- firmware/application/ui_navigation.cpp | 9 ++++++++- flashsize.h.in | 2 -- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1086ac30f..e7f2c72af 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,10 +41,8 @@ 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 - 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 e113987b7..3f740bd79 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -607,7 +607,14 @@ 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_WITH_BITSTREAM_MB * 1024 * 1024) != FLASH_EXPECTED_CHECKSUM); +#ifdef PRALINE + fw_checksum_error = (simple_checksum(FLASH_STARTING_ADDRESS, 4 * 1024 * 1024) != FLASH_EXPECTED_CHECKSUM); + // TODO: This is a minimal workaround to fix the FLASH ERR checksum, bc GSG's cmake doesn't define the PortaRF board, + // so if we do, we need to patch many codes. so we can't define the PortaRF board currently in our cmake. + // discuss needed to find a better way but currently we need CI works and make hackrf pro works as much as possible. +#else + fw_checksum_error = (simple_checksum(FLASH_STARTING_ADDRESS, FLASH_SIZE_LIMIT_MB * 1024 * 1024) != FLASH_EXPECTED_CHECKSUM); +#endif } return fw_checksum_error; } diff --git a/flashsize.h.in b/flashsize.h.in index bc0d52313..a35ea111c 100644 --- a/flashsize.h.in +++ b/flashsize.h.in @@ -6,6 +6,4 @@ #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