Meshtastic device firmware
Go to file
geeksville 62a0321c7d
Fixes for #4395: nrf52 flash filesystem reliability (#4406)
* bug #4184: fix config file loss due to filesystem write errors
* Use SafeFile for atomic file writing (with xor checksum readback)
* Write db.proto last because it could be the largest file on the FS (and less critical)
* Don't keep a tmp file around while writing db.proto (because too big to fit two files in the filesystem)
* generate a new critial fault if we encounter errors writing to flash
either CriticalErrorCode_FLASH_CORRUPTION_RECOVERABLE or CriticalErrorCode_FLASH_CORRUPTION_UNRECOVERABLE
(depending on if the second write attempt worked)
* reformat the filesystem if we detect it is corrupted (then rewrite our config files) (only on nrf52 - not sure
yet if we should bother on ESP32)
* If we have to format the FS, make sure to preserve the oem.proto if it exists

* add logLegacy() so old C code in libs can log via our logging

* move filesList() to a better location (used only in developer builds)

* Reformat with "trunk fmt" to match our coding conventions

* for #4395: don't use .exists() to before attempting file open
If a LFS filesystem is corrupted, .exists() can fail when a mere .open()
attempt would have succeeded.  Therefore better to do the .open() in hopes that
we can read the file (in case we need to reformat to fix the FS).
(Seen and confirmed in stress testing)

* for #4395 more fixes, see below for details:
* check for LFS assertion failures during file operations (needs customized lfs_util.h to provide suitable hooks)
* Remove fsCheck() because checking filesystem by writing to it is very high risk, it makes likelyhood that we will
be able to read the config protobufs quite low.
* Update the LFS inside of adafruitnrf52 to 1.7.2 (from their old 1.6.1) to get the following fix:
97d8d5e96a

* use disable_adafruit_usb.py now that we are (temporarily?) using a forked adafruit lib
We need to reach inside the adafruit project and turn off USE_TINYUSB, just doing that
from platformio.ini is no longer sufficient.

Tested on a wio-sdk-wm1110 board (which is the only board that had this problem)

---------

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
2024-08-13 06:45:39 -05:00
.github Just literally trying stuff at this point 2024-07-29 06:52:14 -05:00
.trunk Update trunk.yaml 2024-07-10 14:39:41 -05:00
.vscode tell vscode, if formatting, use whatever our trunk formatter wants (#4186) 2024-06-27 13:14:16 -05:00
arch Fixes for #4395: nrf52 flash filesystem reliability (#4406) 2024-08-13 06:45:39 -05:00
bin Use sys.executable to refer to python. (#4402) 2024-08-06 06:48:05 -05:00
boards Initial Support for Heltec VM-T190 (#4391) 2024-08-06 13:59:33 -05:00
data/static Bundle WebUI (#878) 2021-10-09 17:15:12 +11:00
extra_scripts Fixes for #4395: nrf52 flash filesystem reliability (#4406) 2024-08-13 06:45:39 -05:00
images remove hard to maintain system-info bootloader 2022-10-01 09:50:16 +02:00
monitor Fixes for #4395: nrf52 flash filesystem reliability (#4406) 2024-08-13 06:45:39 -05:00
protobufs@071fd931ec [create-pull-request] automated change (#4439) 2024-08-11 17:22:01 -05:00
release don't keep uf2 files in source control 2020-08-21 09:37:41 -07:00
src Fixes for #4395: nrf52 flash filesystem reliability (#4406) 2024-08-13 06:45:39 -05:00
variants Fixes for #4395: nrf52 flash filesystem reliability (#4406) 2024-08-13 06:45:39 -05:00
.gitattributes trunk roundhouse kick 2023-01-21 21:23:24 +01:00
.gitignore Native Webserver (#3343) 2024-03-06 16:23:04 -06:00
.gitmodules revert protobuf change to develop 2022-11-26 16:03:17 +01:00
.semgrepignore Fix de/compression buffer overflows in TAK packets (#4317) 2024-07-23 06:16:53 -05:00
docker-compose.yml trunk roundhouse kick 2023-01-21 21:23:24 +01:00
Dockerfile Fix that Dockerfile would not run with podman (#4262) 2024-07-13 06:09:51 -05:00
LICENSE move my bt experiment into its own repo (about to remove ttn) 2020-02-01 08:30:53 -08:00
partition-table.csv - new Bootloader for ESP-IDF 4.2 2022-09-26 22:42:58 +02:00
platformio.ini Fix build to not use incorrect OneButton version (#4374) 2024-08-02 18:28:04 -05:00
pyocd.yaml Add semihosting support for nrf52 devices (#4137) 2024-06-24 10:27:37 -05:00
README.md Update README.md 2023-10-09 22:30:02 +10:00
suppressions.txt Cpp-check warnings cleanup (#3014) 2023-12-14 07:35:46 -06:00
userPrefs.h STM32WL improvements (#4449) 2024-08-12 20:31:45 -05:00
version.properties [create-pull-request] automated change (#4409) 2024-08-09 06:35:26 -05:00

Meshtastic Firmware

GitHub release downloads CI CLA assistant Fiscal Contributors Vercel

Overview

This repository contains the device firmware for the Meshtastic project.

Stats

Alt