Skip to content

feat: add NVS partition library for ESP32 flash storage#19

Merged
deadprogram merged 1 commit intotinygo-org:mainfrom
jgangemi:jae/upstream-nvs
Apr 11, 2026
Merged

feat: add NVS partition library for ESP32 flash storage#19
deadprogram merged 1 commit intotinygo-org:mainfrom
jgangemi:jae/upstream-nvs

Conversation

@jgangemi
Copy link
Copy Markdown
Contributor

@jgangemi jgangemi commented Apr 9, 2026

Summary

  • Add pkg/nvs package for parsing and generating ESP32 NVS (Non-Volatile Storage) v2 binary partitions
  • Parse NVS binary partitions into typed entries (namespace, key, type, value)
  • Generate NVS binary partitions from entry lists
  • Support u8/u16/u32/i8/i16/i32/string/blob value types
  • 29 tests with full coverage of parse and generate paths

Use case

Enables programmatic read-modify-write of NVS partitions — useful for provisioning device configuration (WiFi credentials, calibration data, etc.) without reflashing the entire firmware.

Test plan

  • go test -v ./pkg/nvs/... — all 29 tests pass
  • golangci-lint run ./pkg/nvs/... — zero issues

@jgangemi jgangemi force-pushed the jae/upstream-nvs branch 2 times, most recently from 38e0889 to 3de0d22 Compare April 9, 2026 20:15
- parse NVS v2 binary partitions into typed entries
- generate NVS binary partitions from entry lists
- support u8/u16/u32/i8/i16/i32/string/blob value types
@deadprogram
Copy link
Copy Markdown
Member

Thanks for the addition @jgangemi now merging.

@deadprogram deadprogram merged commit fef487b into tinygo-org:main Apr 11, 2026
3 checks passed
@jgangemi jgangemi deleted the jae/upstream-nvs branch April 11, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants