Bug Report
With SPIFlash::writeStr
The formula in the line 1055 (SPIFlash.cpp) does not take into account the offset of the address by the value of the line size sizeof(_sz). As a result, an overflow may occur and an attempt to write to the beginning of the current page of memory may occur instead of continuing the write on the next page. This may cause a write error!
Current formula:
uint16_t maxBytes = SPI_PAGESIZE-(_addr % SPI_PAGESIZE); // Force the first set of bytes to stay within the first page
Variant of the formula, taking into account the address offset:
uint16_t maxBytes = SPI_PAGESIZE-(_currentAddress % SPI_PAGESIZE); // Force the first set of bytes to stay within the first page
Bug Report
With SPIFlash::writeStr
The formula in the line 1055 (SPIFlash.cpp) does not take into account the offset of the address by the value of the line size sizeof(_sz). As a result, an overflow may occur and an attempt to write to the beginning of the current page of memory may occur instead of continuing the write on the next page. This may cause a write error!
Current formula:
Variant of the formula, taking into account the address offset: