spi: flash: support the 256-byte wraparound when programming pages
This commit is contained in:
parent
3d33e5e0ce
commit
3395eb1a82
1 changed files with 1 additions and 0 deletions
|
@ -130,6 +130,7 @@ static size_t spi_flash_write(struct flash_dev *dev, uint32_t addr,
|
|||
spi_flash_addr(cmd, addr);
|
||||
|
||||
nbytes = min(len, 32);
|
||||
nbytes = nbytes - ((addr + nbytes) & 0xff);
|
||||
|
||||
memmove(cmd + 4, data, nbytes);
|
||||
spi_tx_rx(spi_dev, NULL, 0, cmd, 4 + nbytes);
|
||||
|
|
Loading…
Add table
Reference in a new issue