diff --git a/README.md b/README.md index 811ff68..ecbfcb0 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,11 @@ symbol costs one API-table entry. temperature, remaining/full/design capacity, health, charge state) are already exported by stock firmware. This build also enables `furi_hal_power_insomnia_level`; `furi_hal_power_init` stays disabled. +* **Flash + option-byte internals** (`furi_hal_flash_*`): flash geometry, + free-page info, and raw program / erase / dword-write / option-byte access. + An app can read and modify internal flash directly. **This can brick the + device or wipe storage.** Enabled here for research; build with + `EXPORT_FLASH=0 ./build.sh` to leave these disabled. `build.sh` also widens the GAP roles the firmware initialises (`GAP_PERIPHERAL_ROLE | GAP_CENTRAL_ROLE | GAP_OBSERVER_ROLE`) in diff --git a/build.sh b/build.sh index 030fcab..0fbb2bd 100755 --- a/build.sh +++ b/build.sh @@ -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.