mirror of
https://github.com/markqvist/RNode_Firmware.git
synced 2026-04-27 14:30:33 +00:00
Fix: don't write CONF_OK in self-provisioning (corrupts SX1262 calibration)
Self-provisioning wrote CONF_OK_BYTE without writing radio config values (freq/bw/sf/txp). This caused eeprom_conf_load() to load 0xFFFFFFFF into lora_freq, then startRadio() called begin(0xFFFFFFFF) which ran calibrate_image() with an impossible frequency — no matching band, leaving PLL/image calibration corrupted. Even when beacon_update() later set correct params, the initial bad calibration persisted. This was the root cause of the recurring LoRa RX decode failure after any flash erase + re-provision cycle.
This commit is contained in:
parent
6b64f8c3b4
commit
fd8a0be97e
1 changed files with 3 additions and 1 deletions
|
|
@ -172,7 +172,9 @@ void setup() {
|
|||
EEPROM.write(eeprom_addr(ADDR_MADE+2), 0x00);
|
||||
EEPROM.write(eeprom_addr(ADDR_MADE+3), 0x00);
|
||||
EEPROM.write(eeprom_addr(ADDR_INFO_LOCK), INFO_LOCK_BYTE);
|
||||
EEPROM.write(eeprom_addr(ADDR_CONF_OK), CONF_OK_BYTE);
|
||||
// Do NOT write CONF_OK_BYTE — radio config (freq/bw/sf) is not set.
|
||||
// If CONF_OK is set, eeprom_conf_load() loads 0xFFFFFFFF into lora_freq
|
||||
// and startRadio() calls begin(0xFFFFFFFF) which corrupts SX1262 calibration.
|
||||
// Compute and write EEPROM checksum (MD5 of first CHECKSUMMED_SIZE bytes)
|
||||
char chk_data[CHECKSUMMED_SIZE];
|
||||
for (uint8_t i = 0; i < CHECKSUMMED_SIZE; i++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue