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: Could SPI 0 be used for NPI?

Part Number: CC2640R2F


Tool/software: Code Composer Studio

in npi_config.h there is a note that SPI 1 must be used for NPI!?

#if (NPI_FLOW_CTRL == 1)
#  ifdef NPI_USE_SPI
    //NOTE: Board_SPI1 SPI module must be used for NPI.
    #define MRDY_PIN Board_PIN_BUTTON0
    #define SRDY_PIN Board_PIN_BUTTON1
#  elif defined(NPI_USE_UART)
    #define MRDY_PIN Board_PIN_BUTTON0
    #define SRDY_PIN Board_PIN_BUTTON1
#  endif

Is this mandatory (because of conflicts with display on some boards)? or could SPI 0 be used? by just defining it like below, and assigning MRDY and SRDY to the correct pins?

#if !defined(NPI_SPI_CONFIG)
	#define NPI_SPI_CONFIG Board_SPI0
#endif

In npi_task.c for SPI_0 portBoardID = 0 should be used?

/* Default NPI parameters structure */
const NPI_Params NPI_defaultParams = {
    .stackSize          = 1024,
    .bufSize            = 530,
    .mrdyPinID          = IOID_UNUSED,
    .srdyPinID          = IOID_UNUSED,
#if defined(NPI_USE_UART)
    .portType           = NPI_SERIAL_TYPE_UART,
    .portBoardID        = 0,                     /* CC2650_UART0 */
#elif defined(NPI_USE_SPI)
    .portType           = NPI_SERIAL_TYPE_SPI,
#if (defined(CC2650DK_5XD) ||  defined(CC2650DK_4XS )) && !defined(TI_DRIVERS_DISPLAY_INCLUDED)
    .portBoardID        = 0,                     /* CC2650_SPI0, conflicts with SRF06 display so both can't be enabled */

  • Hi Cristian,

    The NPI uses the SPI module pointed by the symbol Board_SPI1 (this is configured in npi_config.h). You cannot easily change this.

    However, you can safely modify the pins used by each SPI. You can also change the definition of the symbol Board_SPI1 (in Board.h) to use the SPI module you want (CC2640R2_LAUNCHXL_SPI0 or CC2640R2_LAUNCHXL_SPI1).  In that case be sure to properly define all the pins required by the SPI chosen :)

    I hope this will help,

    Best regards,