Part Number: MSP432P401R
Tool/software: TI-RTOS
I'm using the source code provided in TIDEP-0091.
In that one, MSP432P401R SPI is used in Slave mode to communicate with IWR1443 (working as SPI master).
When there's no data coming from IWR1443 (Master), MSP432P401R SPI hangs forever.
the msp_spi.c file of TIDEP-0091 uses following init of SPI
/* Initialize SPI handle in slave mode */ SPI_Params_init(&spiParams); spiParams.mode = SPI_SLAVE; spiParams.frameFormat = SPI_POL0_PHA0; // spiParams.frameFormat = SPI_POL1_PHA1; // spiParams.transferMode = SPI_MODE_CALLBACK; // spiParams.transferCallbackFxn = spiTransferCompleteCallback; spiParams.transferMode = SPI_MODE_BLOCKING; //comment spiParams.transferTimeout = SPI_WAIT_FOREVER; //comment spiParams.bitRate = 1000000; spiParams.dataSize = 16;
When I change SPI_WAIT_FOREVER to a number value, still the function waits forever for SPI data.
I checked the "ti/simplelink_msp432_sdk1_40_01_00/source/ti/drivers/spi.h" and it says "Transfer timeout in system ticks (Not supported with all implementations" as below.
typedef struct SPI_Params_ { SPI_TransferMode transferMode; /*!< Blocking or Callback mode */ uint32_t transferTimeout; /*!< Transfer timeout in system ticks (Not supported with all implementations */ SPI_CallbackFxn transferCallbackFxn;/*!< Callback function pointer */ SPI_Mode mode; /*!< Master or Slave mode */ uint32_t bitRate; /*!< SPI bit rate in Hz */ uint32_t dataSize; /*!< SPI data frame size in bits */ SPI_FrameFormat frameFormat; /*!< SPI frame format */ void *custom; /*!< Custom argument used by driver implementation */ } SPI_Params;
Is it possible to implement a timeout for SPI slave mode here? if could someone point out how to impelment the timeout for SPI slave transaction please?
cheers
Randy