Skip to content

Commit

Permalink
EepromMcuReadBuffer: Read back from cache
Browse files Browse the repository at this point in the history
Read back information from cache instead of flash.
The cache contains  the latest context, whereas
the flash is only updated periodically.

This could cause issues if the flash is not (yet) updated
while the context has been updated in the meantime and values are read
by LoRaMAC.

Therefore just read from flash initially after startup (EepromMcuInit())
and rely on write cache later.

This commit effectively makes commit  e31d3c1
work for me and therefore is a fix. Previous attemps to use commit
e31d3c1... without this commit failed. Error message: "Duty cycle restricted".

The error message might not appear at the first startup, but will
appear if Raspberry Pi Pico is restarted and values from "EEPROM" /
Flash have been read.
  • Loading branch information
ThomasLeister committed Jan 16, 2022
1 parent 30d8a0f commit 85b818b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/boards/rp2040/eeprom-board.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void EepromMcuInit()

uint8_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size )
{
memcpy(buffer, EEPROM_ADDRESS + addr, size);
memcpy(buffer, eeprom_write_cache + addr, size);

return SUCCESS;
}
Expand Down

0 comments on commit 85b818b

Please sign in to comment.