Hi @UsamaShafiq,
I apologize for the inconveniences, but since this is an implementation of a custom flash, support is limited.
Instead of using the DSPI_MasterWriteCommandDataBlocking function alone, please base yourself off an example so only the data transferred can be edited.
Personally, I would recommend starting with the dspi_interrupt_transfer or dspi_polling_transfer examples (depending on if you want blocking or nonblocking), since these are the most basic DSPI examples in the SDK.
This example utilizes both instances of the SPI, one as master, and one as slave in the same board. In order to control your external flash, please modify the transfer data initialization to match your custom flash commands. This is how the data is initialized in the example:
/* Set up the transfer data */
for (i = 0U; i < TRANSFER_SIZE; i++)
{
masterTxData[i] = i % 256U;
masterRxData[i] = 0U;
slaveTxData[i] = ~masterTxData[i];
slaveRxData[i] = 0U;
}
This initialization fills the Tx data array from 0 to 255, you can modify it, so you only fill it byte by byte, or keep it this way and send the dataWords separately.
DSPI_MasterTransferBlocking(EXAMPLE_DSPI_MASTER_BASEADDR, &masterXfer);
This function utilizes the masterXfer structure, where the masterTxData is assigned by this part of the code:
masterXfer.txData = masterTxData;
In your case, the commands (C7h 94h 80h 9Ah) are to be filled into masterTxData and transferred with DSPI_MasterTransferNonBlocking if you were to use the interrupt example, or DSPI_MasterTransferBlocking if you were to use the polling example.
I apologize again for the limited support.
Best regards,
Julián