I'm having issues using the flexspi_nor_hyperbus_write() in the hyper_flash_polling_transfer example for the RT1060EVK. I have modified by hardware to use hyperflash and my application is running from RAM.
Inside the flexspi_nor_hyperbus_write function, the address is multiplied by 2. What is the reason for this?
status_t flexspi_nor_hyperbus_write(uint32_t addr, uint32_t *buffer, uint32_t bytes)
{
flexspi_transfer_t flashXfer;
status_t status;
flashXfer.deviceAddress = addr * 2;
flashXfer.port = kFLEXSPI_PortA1;
flashXfer.cmdType = kFLEXSPI_Write;
flashXfer.SeqNumber = 1;
flashXfer.seqIndex = HYPERFLASH_CMD_LUT_SEQ_IDX_WRITEDATA;
flashXfer.data = buffer;
flashXfer.dataSize = bytes;
status = FLEXSPI_TransferBlocking(FLEXSPI, &flashXfer);
if (status != kStatus_Success)
{
return status;
}
return status;
}
When I remove the addr*2, it writes to the intended address but the commands no longer work.
For example, if I want to write to the address 0x20000, how should I be using the flexspi_nor_hyperbus_write function? This is how I would have intended to use it? Is there something else required?
uint8_t data[8] = "abcdefgh";
flexspi_nor_hyperbus_write(0x20000, (uint32_t*)(data), sizeof(data));
In conclusion, what is the reason for this and why do I need it?