Hi,
I have downloaded the SDK v1.1.0 for the CC3100 and ported it to a STM32F106 MCU using FreeRTOS.
To get this running, I needed to disable a task switch during _SlDrvMsgWrite and _SlDrvRxHdrRead using taskENTER_CRITICAL and taskEXIT_CRITICAL.
My changes to driver.c:
_SlReturnVal_t _SlDrvMsgWrite(_SlCmdCtrl_t *pCmdCtrl,_SlCmdExt_t *pCmdExt, _u8 *pTxRxDescBuff)
{
....
taskENTER_CRITICAL();
#ifdef SL_START_WRITE_STAT
sl_IfStartWriteSequence(g_pCB->FD);
#endif
...
#ifdef SL_START_WRITE_STAT
sl_IfEndWriteSequence(g_pCB->FD);
#endif
taskEXIT_CRITICAL();
return SL_OS_RET_CODE_OK;
}
_SlReturnVal_t _SlDrvRxHdrRead(_u8 *pBuf, _u8 *pAlignSize)
{
_u32 SyncCnt = 0;
_u8 ShiftIdx;
taskENTER_CRITICAL();
#ifndef SL_IF_TYPE_UART
/* 1. Write CNYS pattern to NWP when working in SPI mode only */
NWP_IF_WRITE_CHECK(g_pCB->FD, (_u8 *)&g_H2NCnysPattern.Short, SYNC_PATTERN_LEN);
#endif
/* 2. Read 4 bytes (protocol aligned) */
NWP_IF_READ_CHECK(g_pCB->FD, &pBuf[0], 4);
_SL_DBG_SYNC_LOG(SyncCnt,pBuf);
/* Wait for SYNC_PATTERN_LEN from the device */
while ( ! N2H_SYNC_PATTERN_MATCH(pBuf, g_pCB->TxSeqNum) )
{
/* 3. Debug limit of scan */
//VERIFY_PROTOCOL(SyncCnt < SL_SYNC_SCAN_THRESHOLD);
if( SyncCnt > SL_SYNC_SCAN_THRESHOLD ) {
Uart_Puts("CC3100: Lost sync!\n");
taskEXIT_CRITICAL();
while(1) {
}
}
...
}
taskEXIT_CRITICAL();
...
}
Is this a known bug?