MeshCore FUOTA Entwurf zur PrüfungDraft for review

Wo was im Flash liegt

FakeTec, SenseCAP P1 und RAK4631 nutzen ein Flash-Layout. Stage-0 liegt direkt hinter dem SoftDevice, danach folgen Status-Seite, Slot A und Slot B. Das Image mit FUOTA belegt in 1.18.0-b3 306.104 B, also 75 Seiten gemessen. Am 8. November 2026 waren es 299.284 B und 74 Seiten gemessen.

What lives where in flash

FakeTec, SenseCAP P1 and RAK4631 share one flash layout. Stage-0 sits behind the SoftDevice, then come the status page, slot A and slot B. The image with FUOTA takes 306,104 B in 1.18.0-b3, which is 75 pages measured. On 8 November 2026 it was 299,284 B and 74 pages measured.

Aufteilung

Die Boards sind nRF52840 mit Adafruit-Bootloader. Der Bootloader springt ans Ende des SoftDevice, des Bluetooth-Stacks von Nordic. Dort sitzt Stage-0, der Lader, der beim Start die Images tauscht.

  • S140 6.1.1 (FakeTec, RAK4631): Sprungziel 0x26000.
  • S140 7.3.0 (SenseCAP P1, T1000-E): Sprungziel 0x27000.

Ab 0x28000 ist alles für beide gleich. Dort folgen die Status-Seite und zwei Slots mit je 98 Seiten. Eine Seite im Flash sind 4 KB.

  • Slot A enthält die App, das laufende Repeater-Image.
  • Slot B ist das Zwischenlager für den Patch, das Manifest und das neue Image.
  • Der Patch (Delta-Patch) enthält nur den Unterschied zwischen zwei Images.
  • Das Manifest ist die signierte Liste dessen, was zu einem Update gehört.

Layout

The boards are nRF52840 with the Adafruit bootloader. The bootloader jumps to the end of the SoftDevice, Nordic's Bluetooth stack. Stage-0 sits there: the loader that swaps the images at boot.

  • S140 6.1.1 (FakeTec, RAK4631): jump target 0x26000.
  • S140 7.3.0 (SenseCAP P1, T1000-E): jump target 0x27000.

From 0x28000 on, everything is the same for both. The status page follows, then two slots of 98 pages each. A flash page is 4 KB.

  • Slot A contains the app, the running repeater image.
  • Slot B is the staging area for the patch, the manifest and the new image.
  • The patch (delta patch) holds only the difference between two images.
  • The manifest is the signed list of what belongs to an update.
SD S0 Slot A: läuft 98 Seiten à 4 KB, ab 0x29000 Slot B: Zwischenlager 98 Seiten, ab 0x8B000 FS BL SD SoftDevice · S0 Stage-0 (3,0 von 4 KB) · orange Status-Seite · FS InternalFS · BL Bootloader neues Image, beim Anwenden hier gebaut (bis 96 Seiten) Patch M Patch seitenbündig vor der letzten Seite, Manifest (M) in der letzten Seite von Slot B. Passt max(alt, neu) + Patch + 1 ≤ 98: dahinter. Sonst überlappend: neu + 1 + 1 ≤ 98.
Die Status-Seite enthält den Tausch-Auftrag mit den Größen und SHA-256 beider Images. Dazu kommt ein Journal: Stage-0 schreibt jeden Schritt hinein. InternalFS ist das Dateisystem im Flash. Es enthält Identität, Einstellungen und die Datei /fuota.dat mit gesperrten Kampagnen und Retracts (signierten Rückrufen).
SD S0 Slot A: running 98 pages of 4 KB, from 0x29000 Slot B: staging area 98 pages, from 0x8B000 FS BL SD SoftDevice · S0 Stage-0 (3.0/4 KB used) · orange 4 KB status page · FS InternalFS · BL bootloader new image, built here on apply (up to 96 pages) Patch M Patch page-aligned before the last page, manifest (M) in the last page of slot B. Fits max(old, new) + patch + 1 ≤ 98: behind. Else overlapping: new + 1 + 1 ≤ 98.
The status page contains the swap job with the sizes and SHA-256 of both images. It also contains a journal: Stage-0 writes every step into it. InternalFS is the file system in flash. It contains identity, settings and the file /fuota.dat with banned campaigns and retracts (signed recalls).

Wer in welchen Bereich schreibt

Adressen und Seitenzahlen der Tabelle sind Konstanten der Firmware im Code geprüft.

Who writes to which area

Addresses and page counts of the table are firmware constants checked in the code.

BereichAdresse bei S140 6.1.1Adresse bei S140 7.3.0GrößeWer schreibt
SoftDevice0x00000 bis 0x260000x00000 bis 0x27000bis zum Sprungziel des BootloadersFUOTA nie
Stage-00x26000 bis 0x270000x27000 bis 0x280001 Seite, belegt 3.032 B, am RAK4631 2.984 B gemessenper USB (UF2 oder serielles DFU) oder BLE-DFU, einmal je Board. FUOTA nie
frei, bleibt gelöscht0x27000 bis 0x28000entfällt1 Seiteniemand
Status-Seite0x28000 bis 0x290000x28000 bis 0x290001 SeiteApp: Tausch-Auftrag. Stage-0: Journal
Slot A0x29000 bis 0x8B0000x29000 bis 0x8B00098 Seitenper USB oder BLE-DFU bei der ersten Installation, danach Stage-0 beim Tausch
Slot B0x8B000 bis 0xED0000x8B000 bis 0xED00098 SeitenApp: Patch, Manifest, neues Image. Stage-0 beim Tausch
InternalFS und Bootloaderab 0xED000ab 0xED000InternalFS bis 0xF4000, dahinter der BootloaderApp: Dateien in InternalFS. Bootloader: FUOTA nie
AreaAddress with S140 6.1.1Address with S140 7.3.0SizeWho writes
SoftDevice0x00000 to 0x260000x00000 to 0x27000up to the jump target of the bootloaderFUOTA never
Stage-00x26000 to 0x270000x27000 to 0x280001 page, 3,032 B used, 2,984 B on the RAK4631 measuredby USB (UF2 or serial DFU) or BLE DFU, once per board. FUOTA never
free, stays erased0x27000 to 0x28000not present1 pagenobody
Status page0x28000 to 0x290000x28000 to 0x290001 pageApp: swap job. Stage-0: journal
Slot A0x29000 to 0x8B0000x29000 to 0x8B00098 pagesby USB or BLE DFU at the first install, then Stage-0 during the swap
Slot B0x8B000 to 0xED0000x8B000 to 0xED00098 pagesApp: patch, manifest, new image. Stage-0 during the swap
InternalFS and bootloaderfrom 0xED000from 0xED000InternalFS up to 0xF4000, the bootloader behind itApp: files in InternalFS. Bootloader: FUOTA never
  • Der Flash-Code von FUOTA schreibt nur in die Status-Seite und in Slot B. Er schreibt nie ins SoftDevice oder in den Bootloader im Code geprüft.
  • Stage-0 schreibt nur in die Status-Seite und in beide Slots im Code geprüft.
  • Der Build bricht ab, wenn Stage-0 in die Status-Seite ragt. Er bricht auch ab, wenn die Slots nicht bei 0xED000 enden im Code geprüft.
  • The flash code of FUOTA writes only to the status page and slot B. It never writes to the SoftDevice or the bootloader checked in the code.
  • Stage-0 writes only to the status page and to both slots checked in the code.
  • The build stops if Stage-0 reaches into the status page. It also stops if the slots do not end at 0xED000 checked in the code.

Ein Layout für beide SoftDevice-Versionen

  • Die App ist für 0x29000 gelinkt und nutzt das SoftDevice nicht.
  • Für ein Update per Telefon startet sie neu in den BLE-DFU des Bootloaders.
  • Dasselbe Image läuft darum mit beiden SoftDevice-Versionen.
  • Wir haben ein P1-Image nur mit den Headern von S140 6.1.1 gebaut. Es ist byte-gleich zu dem Image, das auf dem P1 mit S140 7.3.0 läuft gemessen.
  • Ein Repeater-Image läuft nur an der Adresse, für die es gelinkt ist. Darum ist Slot B ein Zwischenlager und kein zweites Startziel.

One layout for both SoftDevice versions

  • The app is linked for 0x29000 and does not use the SoftDevice.
  • For an update by phone it reboots into the BLE DFU of the bootloader.
  • The same image therefore runs with both SoftDevice versions.
  • We built a P1 image with only the S140 6.1.1 headers. It is byte-identical to the image running on the P1 with S140 7.3.0 measured.
  • A repeater image runs only at the address it is linked for. So slot B is a staging area, not a second boot target.

Flash und RAM

  • Image mit FUOTA für alle Boards: 1.18.0-b3 hat 306.104 B Flash gemessen. Das sind 75 von höchstens 96 Seiten gerechnet. 1.17.1-b2 hat 301.928 B und 74 Seiten gemessen. Das Release-Image vom 8. November 2026 hatte 299.284 B und 74 Seiten, gemessen beim ersten Bau des Release-Env gemessen. Am 20. Oktober 2026 waren es 270.080 B und 66 Seiten. Bis zum 8. November 2026 kamen 29.204 B dazu. Bis 1.18.0-b3 sind es 36.024 B gerechnet.
  • RAM: 1.18.0-b3 belegt laut Bericht zum Neubau 45.768 B. Das haben wir nicht selbst nachgemessen. Am 8. November 2026 waren es 43.580 B gemessen.
  • Stock-P1 (MeshCore unverändert) mit BLE-OTA zum Vergleich: 365.292 B (Stand 19. Oktober 2026) gemessen. Am offiziellen UF2 von Version 1.18.0 nachgemessen: 1.427 Blöcke zu je 256 B, das sind höchstens 365.312 B gemessen. Eigene Neubauten vom 27. Oktober 2026 kamen auf 365.452 und 365.468 B, den Abstand von 160 B haben wir nicht untersucht gemessen.
  • FUOTA selbst: 49.946 bis 58.969 B Code und Daten im Release-Image vom 8. November 2026 gemessen. Davon sind 49.946 B Code, Konstanten und Anfangswerte und 9.023 B Zeichenketten gemessen. Der Linker legt gleiche Zeichenketten zusammen, darum ist ihr Anteil ein oberer Wert. FUOTA belegt 14.205 B RAM gemessen. Der Firmware-Code war bis zum Stand vom 10. November 2026 unverändert. Bis 1.18.0-b3 kamen die Statusmeldungen, die Werkseinstellungen und zwölf weitere Boards dazu im Code geprüft. Den Anteil für 1.18.0-b3 haben wir nicht neu gezählt.
  • Gezählt sind laut Linker-Map die acht Objektdateien unter src/helpers/fuota, soweit der Linker sie übernommen hat. Nicht enthalten sind die Anpassungen in MeshCore-Dateien und die Board-Dateien.
  • FUOTA am 20. Oktober 2026: Ein Neubau dieses Stands hat nach derselben Zählung 31.272 B Flash gemessen. Sein RAM liegt bei 7.771 B gemessen. Die damalige Angabe 31.584 B ist um 312 B größer. So groß sind dort die Build-Attribute dieser Dateien. Sie liegen nicht im Flash gemessen. Wie die Angabe damals gezählt wurde, ist nicht festgehalten.
  • Stage-0 belegt 3.032 B in einer Seite, am RAK4631 2.984 B. Am ausgelieferten Paket gemessen gemessen.

Jeder Schalter für sich, auf den Stock-P1 angewendet:

  • Ohne BLE in der App ist das Image 34,4 KB kleiner gemessen.
  • Mit -Os (Größe) statt -Ofast (Tempo) ist es 69,7 KB kleiner gemessen.

Ein Image darf höchstens 96 Seiten haben. Der Build bricht sonst ab gemessen.

Flash and RAM

  • Image with FUOTA for all boards: 1.18.0-b3 has 306,104 B of flash measured. That is 75 of at most 96 pages calculated. 1.17.1-b2 has 301,928 B and 74 pages measured. The release image of 8 November 2026 had 299,284 B and 74 pages, measured at the first build of the release env measured. On 20 October 2026 it was 270,080 B and 66 pages. By 8 November 2026 the image had grown by 29,204 B. By 1.18.0-b3 it is 36,024 B calculated.
  • RAM: 1.18.0-b3 uses 45,768 B according to the report on the rebuild. We did not measure that ourselves. On 8 November 2026 it was 43,580 B measured.
  • Stock P1 (MeshCore as published, unchanged) with BLE OTA for comparison: 365,292 B (as of 19 October 2026) measured. Measured again on the official UF2 of version 1.18.0: 1,427 blocks of 256 B each, so at most 365,312 B measured. Our own rebuilds of 27 October 2026 came to 365,452 and 365,468 B, and we have not investigated the gap of 160 B measured.
  • FUOTA itself: 49,946 to 58,969 B of code and data in the release image of 8 November 2026 measured. Of these, 49,946 B are code, constants and initial values and 9,023 B are strings measured. The linker merges equal strings, so their share is an upper value. FUOTA also uses 14,205 B of RAM measured. The firmware code was unchanged up to the state of 10 November 2026. Up to 1.18.0-b3 the status messages, the factory settings and twelve more boards were added checked in the code. We did not count the share again for 1.18.0-b3.
  • Counted are the eight object files under src/helpers/fuota in the linker map, as far as the linker kept them. This leaves out the changes in MeshCore files and the board files.
  • FUOTA on 20 October 2026: By the same count, a rebuild of that state has 31,272 B of flash measured. Its RAM is 7,771 B measured. The figure given back then, 31,584 B, is 312 B larger. That is the size of the build attributes of these files in that build. They are not stored in flash measured. How the old figure was counted was not recorded.
  • Stage-0 takes 3,032 B in one page, 2,984 B on the RAK4631. Measured on the delivered package measured.

Each switch on its own, applied to the stock P1:

  • Without BLE in the app the image is 34.4 KB smaller measured.
  • With -Os (size) instead of -Ofast (speed) it is 69.7 KB smaller measured.

An image may have at most 96 pages. The build stops otherwise measured.

Patch in Slot B

Der Patch liegt seitenbündig am Ende von Slot B. Das neue Image schreibt der Knoten ab dem Anfang von Slot B. Dabei liest er den Patch noch.

Patch in slot B

The patch sits page-aligned at the end of slot B. The node writes the new image from the start of slot B. It is still reading the patch at that moment.

FallWas der Knoten tut
Der Patch passt hinter das größere der beiden Images.Er übersteht den eigenen Tausch, der nur so viele Seiten bewegt wie das größere Image. Der Knoten wendet sofort an und bietet danach weiter an gemessen.
Der Patch passt nicht dahinter.Der Knoten wendet überlappend an. Er kopiert den Patch in Stücken zu 512 Byte ins RAM im Code geprüft. Das neue Image überschreibt nur Patch-Seiten, die er schon ganz gelesen hat.
CaseWhat the node does
The patch fits behind the larger of the two images.It survives its own swap. The swap moves only as many pages as the larger image has. The node applies at once and keeps offering afterwards measured.
The patch does not fit behind.The node applies overlapping. It copies the patch to RAM in chunks of 512 bytes checked in the code. The new image overwrites only patch pages it has read completely.
  • Das Release-Werkzeug spielt genau diesen Code vorher auf dem Rechner durch.
  • Es setzt im signierten Manifest ein Flag, nur wenn das Überlappen sicher ist.
  • Der Knoten hält die Regel beim Anwenden trotzdem selbst ein und bricht sonst ab.
  • Nach dem überlappenden Anwenden ist der Patch weg. Darum gibt der Knoten ihn vorher ein Fenster lang weiter gemessen. Mehr dazu steht unter Ablauf.
  • Ein Patch darf bis zu 64 Seiten groß sein im Code geprüft.
  • Hinter ein Image mit 75 Seiten (1.18.0-b3) passen 22 Seiten berechnet. Das sind 98 im Slot, minus 75 fürs Image, minus 1 fürs Manifest. Beim Image vom 8. November 2026 mit 74 Seiten waren es 23. Größere Patches wendet der Knoten überlappend an.
  • Der Alpha-Patch von 1.17.1-b2 auf 1.18.0-b3 hat 28.630 B gemessen. Das sind 163 Fragmente zu 176 B und 7 Seiten berechnet. Dazu kommen das Manifest (3 Fragmente) und die Prüftabelle (8 Fragmente) berechnet. Das sind 174 Fragmente: Ein Knoten holte die Kampagne dc7b7cb0 mit 174 Fragmenten gemessen. Er passt hinter das Image und wird nicht überlappend angewendet berechnet. Laut Bericht baute der Host-Test aus ihm ein Image, das Byte für Byte gleich ist.
  • The release tool runs exactly this code on a computer beforehand.
  • It sets a flag in the signed manifest only if the overlap is safe.
  • The node still keeps to the rule itself while applying, and stops otherwise.
  • After an overlapping apply the patch is gone. So the node passes it on for a window first measured. More on this under How it runs.
  • A patch may be up to 64 pages checked in the code.
  • 22 pages fit behind an image of 75 pages (1.18.0-b3) calculated. The slot has 98 pages, minus 75 for the image, minus 1 for the manifest. With the image of 8 November 2026 and its 74 pages it was 23. The node applies larger patches overlapping.
  • The alpha patch from 1.17.1-b2 to 1.18.0-b3 has 28,630 B measured. That is 163 fragments of 176 B and 7 pages calculated. The manifest (3 fragments) and the check table (8 fragments) come on top calculated. That makes 174 fragments: A node pulled the campaign dc7b7cb0 with 174 fragments measured. It fits behind the image and is not applied overlapping calculated. According to the report, a host test built a byte-identical image from it.

Ein Image für mehrere Boards

Ein Repeater-Image wählt das Board beim Start. Es läuft auf diesen Boards, alle nRF52840 mit SX1262:

  • auf Hardware getestet: FakeTec, SenseCAP P1, Heltec T114, RAK4631 gemessen
  • am Brett gemessen (11. November 2026): Seeed Xiao nRF52840 und Heltec T096. Das Board wird am Deskriptor erkannt, der Funk läuft, Zero-Hop-Pakete gehen in beide Richtungen mit einem FakeTec gemessen. Offen: Update per Funk annehmen, LED und Taste, serielles DFU, Rückfall offen
  • nur gebaut und am Rechner geprüft, laut Bericht: zwölf weitere Boards im Einheitsimage. Die Namen stehen auf der Seite Alpha-Test

Das Einheitsimage trägt 18 Boards. Sechs davon sind am Gerät gesehen, zwölf nur gebaut. Laut Bericht zum Neubau gibt es Alpha-Pakete für alle 18, je Board für seine SoftDevice-Version. FakeTec (S140 6.1.1), SenseCAP P1 (S140 7.3.0) und RAK4631 (S140 6.1.1) sind dabei.

Eine Tabelle im Image enthält, was sich je Board unterscheidet:

  • Pins für Funkchip, SPI, I2C, GPS, LEDs, Taste und Batteriemessung
  • TCXO (temperaturkompensierter Quarz), RF-Schalter, DC/DC-Wandler und 32-kHz-Takt
  • Sendeleistung: Vorgabe und Obergrenze, wichtig bei Boards mit Verstärker

Wie das Image sein Board erkennt

  1. Ein Deskriptor von 32 Byte am Ende der Stage-0-Seite nennt das Board. Er enthält Magic-Wert, Version, Board-ID, die Adresse der Seite und die Prüfsumme CRC-32.
  2. Du installierst Stage-0 je Board einmal per USB oder BLE-DFU. FUOTA schreibt diese Seite nie. Ein BLE-DFU ersetzt Stage-0, darum bringt jedes FUOTA-Paket Stage-0 mit gemessen. Ohne USB-Zugang nimmst du die OTA-ZIP-Datei, siehe Ohne USB: Update per Bluetooth. BLE-OTA ist vom Rechner aus am P1 und an einem FakeTec gemessen gemessen (Bootloader ab 0.9.2-OTAFIX2.1 nötig). Ungetestet sind nRF Connect am Handy, der RAK4631 und Bootloader mit OTAFIX 1.x offen.
  3. Die App liest den Deskriptor an der Adresse, die das SoftDevice als Sprungziel nennt.
  4. Sie vergleicht ihn mit der Board-ID im Bootloader. Nennt der Bootloader ein anderes bekanntes Board, gilt das als Widerspruch.
  5. Ohne Deskriptor reicht die Board-ID nur, wenn der Bootloader zu genau einem Board gehört (P1).

Unbekanntes oder widersprüchliches Board

  • Die App fasst keinen Pin an, sendet nicht und läuft nur im USB-Notbetrieb.
  • Die App bestätigt ein neues Image dann nie. Stage-0 tauscht nach 3 Probestarts ohne Bestätigung zurück.

Die App bestätigt ein neues Image außerdem nur, wenn der Funkchip geantwortet hat. Eine signierte Kampagne (eine Ziel-ID, ein Patch) aktualisiert so FakeTec, SenseCAP P1, Heltec T114 und RAK4631 gemessen.

One image for several boards

One repeater image picks the board at start. It runs on these boards, all nRF52840 with SX1262:

  • tested on hardware: FakeTec, SenseCAP P1, Heltec T114, RAK4631 measured
  • measured on the bench (11 November 2026): Seeed Xiao nRF52840 and Heltec T096. The board is recognised by its descriptor, the radio works, zero-hop packets go in both directions with a FakeTec measured. Open: accepting an update by radio, LED and button, serial DFU, rollback open
  • only built and checked on the host, according to the report: twelve more boards in the unified image. The names are on the alpha test page

The unified image carries 18 boards. Six of them were seen on a device, twelve are only built. According to the report on the rebuild, there are alpha packages for all 18, each board for its SoftDevice version. FakeTec (S140 6.1.1), SenseCAP P1 (S140 7.3.0) and RAK4631 (S140 6.1.1) are among them.

A table inside the image contains what differs per board:

  • pins of radio chip, SPI, I2C, GPS, LEDs, button and battery measurement
  • TCXO (temperature-compensated crystal), RF switch, DC/DC converter and 32 kHz clock
  • transmit power: default and upper limit, important for boards with an amplifier

How the image recognises its board

  1. A 32-byte descriptor at the end of the Stage-0 page names the board. It contains a magic number, version, board ID, the page address and the CRC-32 checksum.
  2. You install Stage-0 once per board by USB or BLE DFU. FUOTA never writes that page. A BLE DFU replaces Stage-0, so every FUOTA package carries Stage-0 measured. Without USB access you take the OTA ZIP file, see Without USB: update over Bluetooth. BLE OTA is measured from a computer on the P1 and on one FakeTec measured (bootloader from 0.9.2-OTAFIX2.1 required). Untested: nRF Connect on a phone, the RAK4631 and bootloaders with OTAFIX 1.x open.
  3. The app reads the descriptor at the address the SoftDevice names as the jump target.
  4. It compares the descriptor with the board ID in the bootloader. If the bootloader names another known board, that is a contradiction.
  5. Without a descriptor, the board ID can suffice. That holds only if the bootloader belongs to exactly one board (P1).

Unknown or contradictory board

  • The app touches no pin and does not transmit. It runs only in a USB fallback mode.
  • The app then never confirms a new image. Stage-0 reverts after 3 test boots without confirmation.

The app also confirms a new image only if the radio chip answered. One signed campaign (one target ID, one patch) thus updates FakeTec, SenseCAP P1, Heltec T114 and RAK4631 measured.

Weiter: MessungenNext: Measurements →