Skip to content

BL602: import WiFi/device config injected into firmware image#2150

Open
kruzer wants to merge 1 commit into
openshwprojects:mainfrom
kruzer:bl602-ota-injected-config
Open

BL602: import WiFi/device config injected into firmware image#2150
kruzer wants to merge 1 commit into
openshwprojects:mainfrom
kruzer:bl602-ota-injected-config

Conversation

@kruzer

@kruzer kruzer commented Jul 1, 2026

Copy link
Copy Markdown

Summary

Adds an embedded config block in .rodata (magic OBKCFG1 + CRC32) that a provisioning tool can patch into a firmware .bin before OTA/flash. On boot, CFG_InitAndLoad() imports the SSID / password / device name into the EasyFlash config — but only if:

  • the block is marked valid and its CRC32 matches
  • no WiFi SSID is already configured
  • this exact block (by CRC) was not already imported

This lets credentials be baked into the image without a serial console or web setup step. No-op on other platforms (guarded by PLATFORM_BL602).

Files

  • src/hal/bl602/hal_ota_config_bl602.c / .h — the embedded block, CRC check and import logic
  • src/new_cfg.c — calls OBK_OtaConfig_TryImport() at the end of CFG_InitAndLoad()

Test plan

  • Builds and links via make OpenBL602 (canonical build)
  • On a device without an injected block, boot logs OtaCfg: not marked valid (flags=0x00), skip and boots normally
  • Patch a valid block into the image, flash, and confirm SSID/name are imported on first boot and skipped on subsequent boots

Adds an embedded config block (.rodata, magic "OBKCFG1" + CRC32) that can
be patched into a firmware .bin before OTA/flash. On boot, CFG_InitAndLoad
imports the SSID/password/device name into EasyFlash config, but only if:
- the block is marked valid and its CRC32 matches
- no WiFi SSID is already configured
- this exact block (by CRC) was not already imported

This lets a provisioning tool bake credentials into the image without a
serial console or web setup step. No-op on other platforms.
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.

1 participant