The following code in SimplciTI file mrfi_radio.c is misbehaving.
#ifdef MRFI_ASSERTS_ARE_ON
#define TEST_VALUE 0xA5
mrfiSpiWriteReg( PKTLEN, TEST_VALUE );
MRFI_ASSERT( mrfiSpiReadReg( PKTLEN ) == TEST_VALUE ); /* SPI is not responding */
#endif
The behavior is that if I place a break point at mrfiSpiWriteReg( PKTLEN, TEST_VALUE ); line and then proceed via steps it works. If I place a break point at MRFI_ASSERT( mrfiSpiReadReg( PKTLEN ) == TEST_VALUE ); /* SPI is not responding */ OR do not place a break point at all, the code for assert goes into an infinite loop.
To me it seems to be a timing issue but I can't figure it out. I placed a 100us delay BSP_Delay(100); before the code but it has not helped.
I am using SysBIOS and SimpliciTI using CCS5. The MCU is MSP430F5324 and the Radio is CC2500. I've not modified the clock so the MCU is at about 8Mhz set by SysBIOS and the same is reflected in bsp_config.h #define BSP_CONFIG_CLOCK_MHZ_SELECT 8 /* approximate MHz */
and thus...
#elif (BSP_CONFIG_CLOCK_MHZ_SELECT == 8)
#define BSP_CONFIG_CLOCK_MHZ 8.0
#define BSP_CONFIG_MSP430_BCSCTL1 CALBC1_8MHZ /* factory calibrated value from flash */
#define BSP_CONFIG_MSP430_DCOCTL CALDCO_8MHZ /* factory calibrated value from flash */
I've also checked that the value of sIterationsPerUsec is 1 and therefore the software timer of void BSP_Delay(uint16_t usec) loops for as many iterations as the count of usec.
Any help would be highly appreciated.