AnsweredAssumed Answered

KL16 mcu SPI read/write NandFlash failure

Question asked by junwang@lifecarenetworks.com on Jul 1, 2016
Latest reply on Jul 4, 2016 by ZhangJennie

I use below code to read ID of external NandFlash . The code is generated under KDS's PE tool.Every operation returns a wrong result. 0xFF, 0xC8.   The right result should be 0xC8, 0xD4.  I test sck output wave, should output 32 clock  pulses, but really only output 16 clock pulses. 

....................................

txbuf[0] = 0x9F;

txbuf[1] = 0x00;

SM2_ReceiveBlock(SM2_DeviceData, recv_buf, 2);

SM2_SendBlock(SM2_DeviceData, txbuf, 2);

  while (!SM2_GetBlockReceivedStatus(SM2_DeviceData))

  {

  SM2_Main(SM2_DeviceData);

  }

.....................

Outcomes