AnsweredAssumed Answered

Shift in SPI Rx Buffer MKL17Z256

Question asked by Samuel Conti on Jun 23, 2016
Latest reply on Jun 24, 2016 by xiangjun.rong

Hello,

 

I use the SPI of the MKL17Z256VFT4 and I have a question about the received char, in fact I have a 1 byte shift in my received buffer.

The MCU communicate with a S25FL116K0XNF1011 FLASH memory. I simply send the JEDECID 0x9F command to read the manufacturer ID (0x01), the device type (0x40) and the capacity (0x15) according to the datasheet.

 

Here the code who read these values :

 

FLA_TxBuffer_U8A[0] = cFLA_JEDECID_U8;

GPIO_DRV_WritePinOutput(CS_SPI , 0);

SPI_DRV_MasterTransferBlocking(spiCom1_IDX, &spiCom1_MasterConfig0, FLA_TxBuffer_U8A, FLA_RxBuffer_U8A, 4, 100);

GPIO_DRV_WritePinOutput(CS_SPI , 1);

 

As you can see I have a Rx Buffer named FLA_RxBuffer_U8A which is an array of 6 bytes.

 

After these lines was executed, in the buffer I have this :

 

 

I found the 3 correct values, but why these values don't begin at the value FLA_RxBuffer_U8A[0]  but at ....[1] ?

 

I tried with 3 instead of 4 for the 5th argument of the read function (transfertByteCount) but I d'ont received the 0x15 in this case.

 

Thank you,

 

Sam

Outcomes