Hi ,
We are using the MKE15Z256xxx7 controller for transfer and receive the data through SPI with DMA for Pmod-sf3 flash( Customized SPI driver) . The communication is fine, Read/Write too is also fine, however the data is read from index 4 instead of 0th index, ie first we need this data to be from 1st index.
E.g : Current working of code
Write command : Buffer status
WriteBuff[10u] = {0x02, 0x00, 0xff, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06};
ReadBuff[10u] = {0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
Read Command: Buffer status
WriteBuff[10u] = {0x03, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
ReadBuff[10u] = {0xff, 0xff, 0xff, 0xff, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06};
Expected: Read command: Should read from index 0.
WriteBuff[10u] = {0x03, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
ReadBuff[6u] = {0x01, 0x02, 0x03, 0x04, 0x05, 0x06};
Here we are using a single buffer which contain Command + Address + Data, We are using same buffer for writing and while reading too.
Query :
1. We wanted the data to be read from 0th index.
2. Can we have a sample code SDK (SPI + DMA) which uses separate buffer for command/Address and read/write.
3. How can we not trigger the interrupt for first 4bytes( Command+Adress) and then trigger SPI interrupt so that it read from 0th index.