Hello,
Could you please give me any help about how I can build an SPI communication between CC2650EM-7ID-RD and a SD card through spi? I use the corresponding libraries and also, I change the Board.c file, according to the following lines:
/* Include drivers */
#include "SDSPICC2650.h"
#include <ti/drivers/SDSPI.h>
/* SPI objects */
SDSPICC2650_Object sdspiCC2650_Object[CC2650_SPICOUNT];
/* SDSPI configuration structure, describing which pins are to be used */
const SDSPICC2650_HWAttrs sdspiCC2650HWAttrs[CC2650_SPICOUNT] = {
{
.baseAddr=SSI0_BASE, // or I declare SSI3_
.powerMngrId = PERIPH_SSI0,
.pinSCK=Board_SPI0_CLK,
.pinMISO=Board_SPI0_MISO,
.pinMOSI=Board_SPI0_MOSI,
.pinCS=Board_SPI0_CSN
}
};
PIN_Handle ledPinHandle; // for the SD card
PIN_State newPinState;
PIN_Config ledPinTable[] = {
Board_SPI0_CSN| PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
Board_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN,
Board_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN,
Board_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN,
PIN_TERMINATE
};
Do you see that something is wrong? I have seen the following posts [1]
[3] 192.237.145.96/.../560104
and as I can understand, I follow the same logic, but the SPI doesn't respond and also, when I call the function which open SPI and tries to read/write, the BLE stops to advertise. I create a function SDcommunication(), where I init SDSPI_init() and I start to write and read one char buffer[30] (for example). I call the "SD communication()" inside the main() or inside the "SimpleBLEPeripheral_taskFxn()" , but nothing happens. Only BLE stops to advertise. SPI does not respond. Could you please help me with any quideline? Everything seems to be logical, but the SPI doesn't respond.
void SDcommunication(void)
{
SDSPI_Handle sdspiHandle;
SDSPI_Params sdspiParams;
SDSPI_init();
SDSPI_Params_init(&sdspiParams);
sdspiHandle = SDSPI_open(Board_SDSPI0, DRIVE_NUM, &sdspiParams);
f_write().....
SDSPI_close(sdspiHandle);
}
Thank you in advance for your time,