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.

CCS/CC2640R2F: Can't Read and Write External Flash IS25LP256D using CC2640R2F based custom board.

Part Number: CC2640R2F

Tool/software: Code Composer Studio

Hi,

I am using an External Flash, IS25LP256D which is interfaced with a custom board havingCC2640R2F MCU. I used SPI protocol to communicate with MCU and External Flash.

First of all I tried to read the ID of the external flash by sending the instruction specified in the datasheet of flash. i.e 0xAB or 0x90. But, i am getting a value in the rxbuff as ' 2 ', which is not referred in the datasheet.

The MOSI, CLK and CS lines are checked with DSO and I am getting waveform which are identical to expected wave forms from other forums and tutorials. Form this I hope there is no hardware or PIn assignment issue. 

But, I was not able to write or read a character or integer from the External Flash. 

Here, I am attaching the Code for the same. Kindly share your ideas to check whether I am doing this in the right way.

/*---------------------------------SPI Initialization--------------------------*/

void spi_init()
{
//PIN_init(BoardGpioInitTable);

/* Open LED pins */
pinHandle = PIN_open(&pinState, spipinTable);
if(!pinHandle) {
System_abort("Error initializing board pins\n");
}
spiParams.mode = SPI_MASTER;
spiParams.dataSize = 8;
spiParams.transferMode = SPI_MODE_BLOCKING;
spiParams.transferTimeout = SPI_WAIT_FOREVER;
spiParams.bitRate = 1000000;IT WAS 12000000 THEN I CHANGED TO 600000 BUT THERE WAS NO EFFECT.
spiParams.custom =(uintptr_t) NULL;
spiParams.frameFormat = SPI_POL1_PHA1;
spiParams.transferCallbackFxn = NULL;
//SPI_Params_init(&spiParams); // Initialize SPI parameters
// 8-bit data size
SPI_init(); // Initialize the SPI driver
spi = SPI_open(Board_SPI0, &spiParams);
if (spi == NULL)
System_abort("Error initializing spi\n"); // SP

printf("spi initialised\n");
}

/*-----------------------------------PIN Initilization---------------------------------*/

CC2640R2_LAUNCHXL_SPI0_MOSI | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master out - slave in */
CC2640R2_LAUNCHXL_SPI0_MISO | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI master in - slave out */
CC2640R2_LAUNCHXL_SPI0_CLK | PIN_INPUT_EN | PIN_PULLDOWN, /* SPI clock */

I configured the CS pin as DIO_18.

/* SPI Board */
#define CC2640R2_LAUNCHXL_SPI0_MISO IOID_19 /* RF1.20 */
#define CC2640R2_LAUNCHXL_SPI0_MOSI IOID_16 /* RF1.18 */
#define CC2640R2_LAUNCHXL_SPI0_CLK IOID_17 /* RF1.16 */
#define CC2640R2_LAUNCHXL_SPI0_CSN PIN_UNASSIGNED

Please Help.

  • Hi Vishnu,

    You say that you have checked MOSI, CLK and CS lines and that they look OK but what about MISO? Do you get any traffic on the MISO line?

    Can you post a waveform from when you are trying to read the ID?

    Best Regards,
    R.M
  • Hi Vishnu,

    I haven’t heard from you for almost two weeks so I’m assuming you were able to resolve your issue. If this isn’t the case, please click the "This did NOT resolve my issue" button and reply to this thread with more information. If this thread locks, please click the "Ask a related question" button and in the new thread describe the current status of your issue and any additional details you may have to assist us in helping to solve your issues.

    Regards,
    R.M