Hi,
I'm implementing QSPI using nRF52840 and MT29F8G01ADAFD12.
- SDK version : 17.1.0
- Soft device : s140 7.2.0
I'm wondering about custom instruction.
I'm implementing reading the ID of device.
void QspiMemory_init(void){ nrf_drv_qspi_config_t config = NRF_DRV_QSPI_DEFAULT_CONFIG; uint8_t temporary = 0x00; uint32_t err_code; nrf_qspi_cinstr_conf_t cinstr_cfg = { .opcode = MT29F_RESET, .length = NRF_QSPI_CINSTR_LEN_1B, .io2_level = false, .io3_level = false, .wipwait = true, .wren = true }; err_code = nrf_drv_qspi_init(&config, qspi_handler, NULL); APP_ERROR_CHECK(err_code); // Send reset enable //err_code = nrf_drv_qspi_cinstr_xfer(&cinstr_cfg, NULL, NULL); //APP_ERROR_CHECK(err_code); cinstr_cfg.opcode = MT29F_READ_ID; cinstr_cfg.length = NRF_QSPI_CINSTR_LEN_3B; err_code = nrf_drv_qspi_cinstr_xfer(&cinstr_cfg, NULL, m_buffer_rx); APP_ERROR_CHECK(err_code); }
I implemented the code like this, but the data was not read.
In datasheet, for reading device's id, enter opcode(READ_ID) + dummy byte.
How can i send dummy byte?
I also run this code for sending dummy byte.
err_code = nrf_drv_qspi_cinstr_xfer(&cinstr_cfg, &dummy, m_buffer_rx);
APP_ERROR_CHECK(err_code);
My question is
- Is it right to use nrf_drv_qspi_cinstr_xfer(..., &dummy, ...)to transmit dummy data?
- Does NRF_QSPI_CINSTR_LEN_4B mean length of frame?
(Should I set the length to NRF_QSPI_CINSTR_LEN_4B(opcode + dummy + manufacture id + device id)?
This is my schematic.
Regards,
Youngjun.