Export flash + option-byte internals to apps

Enable all furi_hal_flash_* functions: geometry, free-page info, raw
program/erase/dword-write, and option-byte read/set/apply. Lets an app
read and modify internal flash directly (research use). Guarded by
EXPORT_FLASH (default 1); build with EXPORT_FLASH=0 to leave disabled.
17 symbols exported; firmware links and the app builds.
This commit is contained in:
2026-06-12 00:49:15 +01:00
parent f12e9c196b
commit 142d47ad08
2 changed files with 14 additions and 0 deletions
+9
View File
@@ -119,6 +119,15 @@ EXPORT_ENABLE+='
EXPORT_ENABLE+='
^furi_hal_power_insomnia_level$
'
# Flash + option-byte internals: geometry, free-page info, and raw program /
# erase / write / option-byte access. These let an app read and modify internal
# flash directly. WARNING: misuse can brick the device or wipe storage; enabled
# here for research. Set EXPORT_FLASH=0 before building to leave them disabled.
if [ "${EXPORT_FLASH:-1}" = "1" ]; then
EXPORT_ENABLE+='
^furi_hal_flash_
'
fi
export EXPORT_ENABLE
if grep -q "^Function,?," "$API_CSV" || ! grep -qE "^Header,\+,.*ble_hci_le\.h" "$API_CSV"; then
# fbt notices the new headers, rewrites the csv with '?' entries and stops.