Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/main/drivers/flash_w25n.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ static void w25n_performOneByteCommand(uint8_t command)

static void w25n_performCommandWithPageAddress(uint8_t command, uint32_t pageAddress)
{
uint8_t cmd[4] = { command, 0, (pageAddress >> 8) & 0xff, (pageAddress >> 0) & 0xff};
// The 2Gbit devices have 2048 blocks of 64 pages, so their page address needs 17 bits.
// Its most significant bit is the lowest bit of the first address byte, which is a don't
// care on the 1Gbit W25N01GV where the page address never exceeds 16 bits.
uint8_t cmd[4] = { command, (pageAddress >> 16) & 0xff, (pageAddress >> 8) & 0xff, (pageAddress >> 0) & 0xff};
busTransfer(busDev, NULL, cmd, sizeof(cmd));
}

Expand Down