Skip to content

Commit d4a1ca9

Browse files
ThomasLeistersandeepmistry
authored andcommitted
EepromMcuReadBuffer: Read back from cache
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.
1 parent 69989bb commit d4a1ca9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/boards/rp2040/eeprom-board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void EepromMcuInit()
2626

2727
uint8_t EepromMcuReadBuffer( uint16_t addr, uint8_t *buffer, uint16_t size )
2828
{
29-
memcpy(buffer, EEPROM_ADDRESS + addr, size);
29+
memcpy(buffer, eeprom_write_cache + addr, size);
3030

3131
return SUCCESS;
3232
}

0 commit comments

Comments
 (0)