Skip to content

Commit

Permalink
Always reserve at least 1kb for configs on ESP32 (#2402)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperl authored Jun 12, 2024
1 parent 3c08483 commit 69093d7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/firmware.toit
Original file line number Diff line number Diff line change
Expand Up @@ -1175,6 +1175,15 @@ extract-binary-content -> ByteArray
extension += config-size
extension += config-encoded

// If the encoded config is small, we make sure to reserve
// more space so the config area is guaranteed to be useful
// for slightly larger configs without changing the free
// size in the header. Usually, the padding we do after this
// is more than enough, but we want a guarantee to have some
// space available.
reserved := 1024 - config-encoded.size
if reserved > 0: extension += ByteArray reserved

// This is a pretty serious padding up. We do it to guarantee
// that segments that follow this one do not change their
// alignment within the individual flash pages, which seems
Expand Down

0 comments on commit 69093d7

Please sign in to comment.