fix(gps): make ephemeris flash persistence hardware-safe

Add freestanding S25FL256S read/program/erase/verify support and seed a newly formatted ephemeris store with stale records. Age-gate navigation readiness, persist the continuous Toe week, and regenerate the Genesys2 MAX2771 integration and flash image.
This commit is contained in:
onur
2026-08-13 00:50:57 +03:00
parent 97e3a71ab9
commit a25a1a61d0
43 changed files with 722126 additions and 713769 deletions
@@ -29,7 +29,8 @@
#define GPS_EPH_STORE_SLOT_SIZE 256u /* one flash page */
#define GPS_EPH_STORE_MAGIC 0x45504853u /* "EPHS" */
#define GPS_EPH_STORE_HEADER_MAGIC 0x45504844u /* "EPHD" */
#define GPS_EPH_STORE_VERSION 1u
#define GPS_EPH_STORE_VERSION 2u
#define GPS_EPH_STORE_INITIAL_SEED_COUNT 9u
typedef struct {
/* Reads never fail on NOR flash; erase/program report success. */
@@ -124,4 +125,13 @@ bool gps_ephemeris_store_save(
/* Erase both sectors and start an empty generation. */
bool gps_ephemeris_store_format(gps_ephemeris_store_t* store);
/*
* Populate a newly formatted store with structurally valid but deliberately
* stale LNAV records. These records exercise the complete flash/CRC/parser
* restore path on first boot; the normal ephemeris age gate prevents them from
* entering a position solution. Returns the number of records written.
*/
unsigned int gps_ephemeris_store_seed_initial(
gps_ephemeris_store_t* store);
#endif
@@ -161,6 +161,9 @@
#ifndef GPS_EPHEMERIS_FLASH_FORCE_FORMAT
#define GPS_EPHEMERIS_FLASH_FORCE_FORMAT 0
#endif
#ifndef GPS_EPHEMERIS_FLASH_SEED_INITIAL
#define GPS_EPHEMERIS_FLASH_SEED_INITIAL 1
#endif
#ifndef GPS_EPHEMERIS_FLASH_BASE
#define GPS_EPHEMERIS_FLASH_BASE 0x01FE0000UL
#endif