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.

CC1310: Configuration of "User Manages SPI Chip Select" to connect to External Flash Memory

Part Number: CC1310


Hello all,

We have developed our own custom-made board consist of CC1310 MCU and External Flash memory (The same chip as CC1310 Launchpad).  

The following pins have been assigned to activate SPI communication with Flash:

MISO-->DIO14

MOSI-->DIO13

CLK-->DIO15

CS-->DIO23

I have modified Board.h, CC1310_LAUNCHXL.c, CC1310_LAUNCHXL.h and CC1310_LAUNCHXL_fxns.c to set the above-mentioned configuration.

CC1310_LAUNCHXL.h:

#define CC1310_LAUNCHXL_SPI_FLASH_CS          IOID_23

#define CC1310_LAUNCHXL_SPI1_MISO             IOID_14

#define CC1310_LAUNCHXL_SPI1_MOSI             IOID_13

#define CC1310_LAUNCHXL_SPI1_CLK              IOID_15

#define CC1310_LAUNCHXL_SPI1_CSN              PIN_UNASSIGNED

 

CC1310_LAUNCHXL.c:

As I'm not using NVSSPI25X Driver Manages Chip Select (which uses IOID_20 as chip select) I have assigned NVSSPI25X_SPI_MANAGES_CS to spiCsnGpioIndex (reference: https://software-dl.ti.com/simplelink/esd/simplelink_msp432_sdk/2.40.00.10/docs/tidrivers/doxygen/html/_n_v_s_s_p_i25_x_8h.html)

/* Hardware attributes for NVS External Regions */

const NVSSPI25X_HWAttrs nvsSPI25XHWAttrs[1] = {

    {

        .regionBaseOffset = 0,

        .regionSize = SPIREGIONSIZE,

        .sectorSize = SPISECTORSIZE,

        .verifyBuf = verifyBuf,

        .verifyBufSize = VERIFYBUFSIZE,

        .spiHandle = NULL,

        .spiIndex = 1,

        .spiBitRate = 4000000,

        .spiCsnGpioIndex = NVSSPI25X_SPI_MANAGES_CS,

        .statusPollDelayUs = 100,

    },

};

But the problem is still there and it cannot recognize DIO23 as SPI chip select.

I think I have to use User Manages Chip Select which requires using the gollowing 4 functions:

void NVSSPI25X_initSpiCs(NVS_Handle nvsHandle, uint16_t csId);

void NVSSPI25X_deinitSpiCs(NVS_Handle nvsHandle, uint16_t csId);

void NVSSPI25X_assertSpiCs(NVS_Handle nvsHandle, uint16_t csId);

void NVSSPI25X_deassertSpiCs(NVS_Handle nvsHandle, uint16_t csId);

 

I have no idea how and where to use them. For example, where should I define the SPI Chip Select in those functions? What should I write in .spiCsnGpioIndex?

Would you please proved an example?

Thank you so much