Other Parts Discussed in Thread: HALCOGEN
Hi team,
The customer is trying to test SPI communication with microSD card using TMS570LS3137HDK development board, but unable to initialize SD card. Tried replacing the 32g and 16g SD cards but still cannot find the code examples. The received data is always 0xFF.
The R1 signal is not received after sending CMD0, this is the first attempt to connect the SD card:
int main(void) { /* USER CODE BEGIN (3) */ gioInit(); sciInit(); spiInit(); spiDAT1_t spiDat1; spiDat1.CS_HOLD = FALSE; spiDat1.WDEL = TRUE; spiDat1.DFSEL = SPI_FMT_0; spiDat1.CSNR = SPI_PIN_CS0; // 发送80个信号 for (int i = 0; i < 80; i++) { spiTransmitData(spiREG2, &spiDat1, 1, 0xFF); } uint16_t tData[6] = {0x40, 0x00, 0x00, 0x00, 0x00, 0x95}; uint16_t rData[1] = {0}; uint32 tRes = spiTransmitAndReceiveData(spiREG2, &spiDat1, 6, tData, NULL); while (1) { uint32 rRes = spiTransmitAndReceiveData(spiREG2, &spiDat1, 1, NULL, rData); if (rData[0] == 0x01) { while (1) { printf("ok"); } } } /* USER CODE END */ return 0; }
Here are halcogen shots:
Could you help check this case? Thanks.
Best Regards,
Cherry