This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SPI flash in DK-TM4C129X

Dear Sir,

I am trying to use SPI flash in DK-TM4C19X. I am using Ti-RTOS and its SPI driver. I was just trying to read the ID from the flash. Parts of of my code related to this as follows

//Initaialising SPI driver
Board_initSPI();

SPI_Handle masterSpi;

masterSpi = SPI_open(Board_SPI0, NULL);
if (masterSpi == NULL) {
System_abort("Error initializing SPI\n");
}
else {
System_printf("SPI initialized\n");
}
SSIFlashIDGet(masterSpi);

void
SSIFlashIDGet(SPI_Handle spi)
{
Bool transferOK=false;
UShort transmitBuffer[4];
UShort recieveBuffer[2];
transmitBuffer[0]=0x90;
transmitBuffer[1]=0x00;
transmitBuffer[2]=0x00;
transmitBuffer[3]=0x00;

spiTransaction.count = 4;
spiTransaction.txBuf =(Ptr) transmitBuffer;
spiTransaction.rxBuf =(Ptr) recieveBuffer;
transferOK==SPI_transfer(spi,&spiTransaction);
if (transferOK){
System_printf("Tranfer OK\n");
}else{
System_printf("Tranfer ERROR\n");
}

}

 

I am giving only part of my code as there so many other things in between.

In my function SSIFlashIDGet , The function 'SPI_transfer' always returns false.

Can you guide me in identifying the issue.?

Do you have any sample program for SPI flash using TI-RTOS drivers for DK-TM4C129X?

With regards

Suresh

Suresh