I'm trying to do a basic read/write on an SD card interfaced to my KL46Z256VLL4 eval board via SPI. I'm using the fsl_sdcard and the fsl_spi components to read/write from/to the SD card.
I'm using the SDSPI_DRV_Init and SDSPI_DRV_Write functions of the fsl_sdcard component to attempt to write data to the SD card:
SDSPI_DRV_Init(&memoryCard1_spi_state, &memoryCard1_state); SDSPI_DRV_WriteBlocks(&memoryCard1_spi_state, &memoryCard1_state, "test", 0, 1); debug_getchar();
However, nothing seems to happen. Upon closer inspection with a logic analyzer, I noticed there's no activity at all on the SPI pins. I then dig into the component files and see the lower level SPI functions (spiSendWord, spiExchange, etc.) are not implemented within "spi_dspi_layer.c". Am I responsible for implementing that portion of the SPI interface?
Excerpt of spi_dspi_layer.c:
/** * Function sets required speed of SPIx/DSPI */ uint32_t SetSpiFrequency(sdspi_spi_t *spi, uint32_t frequency) { uint32_t calculatedBaudRate = 0x00; /* User Code: Calling of the SPI/DSPI method that provides setting of SPI/DSPI transfer speed */ if (calculatedBaudRate == 0x00) { return 0x01; } return 0x00; } /** * Function performs transmission of the input data buffer via SPIx/DSPI */ uint32_t spiExchange(sdspi_spi_t *spi, const uint8_t *in, uint8_t *out, uint32_t size) { uint8_t result = 0x00; /* User Code: Calling of the SPI/DSPI method that provides blocking transfer over SPI/DSPI */ return result; } /** * Function performs transmission of the input byte */ uint8_t spiSendWord(sdspi_spi_t *spi, uint8_t word) { uint8_t result = 0x00; /* User Code: Calling of the SPI/DSPI method that provides blocking transfer of 1B over SPI/DSPI */ return result; }


Original Attachment has been moved to: SDRawWrite.zip