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.
Hello,
I'm trying since several days to make the CC3100 working in AP Mode with the SimpleLink STM32F4 library, with the HttpServer example, no RTOS
The second call to 'mode = sl_Start(0, 0, 0);' after a 'sl_Stop(SL_STOP_TIMEOUT);' always ends with a timeout !! (GENERAL EVENT code = 5)
I get a SL_API_ABORT after 'retVal = _SlDrvSyncObjWaitTimeout(&g_pCB->ObjPool[ObjIdx].SyncObj, INIT_COMPLETE_TIMEOUT, SL_DRIVER_API_DEVICE_SL_START);'
in sl_Start function.
Increasing or decreasing timeout value does not help...
I had already on comment out the line retVal = configureSimpleLinkToDefaultState(); to by-pass the first sl_Stop/sl_Start
So, it seems the CC3100 only tolerates juts one sl_Start !?
I'm using the STM32F407 discovery board on a STM32F4 Discovery Shield, the CC3100 is mounted on a Mikroe CC3100 Click Module (www.mikroe.com/cc3100-click)
Thank you for your help
Regards,
J.
Hi,
What is the return value of the first sl_Start?
Did you try other sl commands following the first sl_Start? did you verify that worked?
This looks like an issue with the porting of the host interface (SPI, interrupt line) but we need more details to be able to help.
Br,
Kobi
Hi Kobi,
Returned value on 1st sl_Start = 2 (= ROLE_AP)
Yes, there are other commands: 3 x 'sl_WlanSet(...)' after 1st sl_Start, if you look the code of C:\ti\CC3100SDK_1.3.0\cc3100-sdk\examples\http_server\main.c, you have in sequence:
- mode = sl_Start(0, 0, 0);
=> returns mode = 2 (ROLE_AP)
- retVal = sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SSID, pal_Strlen(SSID_AP_MODE), (_u8 *)SSID_AP_MODE);
=> returns retVal = 0
- retVal = sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SECURITY_TYPE, 1, (_u8 *)&SecType);
=> returns retVal = 0
- retVal = sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_PASSWORD, pal_Strlen(PASSWORD_AP_MODE), (_u8 *)PASSWORD_AP_MODE);
=> returns retVal = 0
- retVal = sl_Stop(SL_STOP_TIMEOUT);
=> returns retVal = 0
- [Then the 2nd problematic sl_Start] mode = sl_Start(0, 0, 0);
=> returns retVal = 0, *instead of 2* which ends up in LOOP_FOREVER !!
if (ROLE_AP == mode)
{
// If the device is in AP mode, we need to wait for this event before doing anything
while(!IS_IP_ACQUIRED(g_Status)) { _SlNonOsMainLoopTask(); }
}
else
{
CLI_Write("! 1. Device couldn't come in AP mode \n\r");
LOOP_FOREVER();
}
J.
Probably an issue with the NWP Reset/nHIB line.
Please verify that the line toggles when you reset the device (sl_Stop/sl_Start).
The GPIO is toggled within the simplelink porting layer (typically within the NwpPowerOn/Off() methods in simplelink/cc_pal.c).
Br,
Kobi
Okay, I - temporary - solved my problem:
Instead this line: retVal = sl_Stop(SL_STOP_TIMEOUT); (now commented)
And as the manual says 'sl_WlanSetMode takes effect after a reset'
So, I did this:
mode = sl_WlanSetMode(ROLE_AP); // ROLE_AP = 2 & ROLE_STA = 0 see device.c
CLI_Write("TOGGLE RESET PIN\r");
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_10, 0);
HAL_Delay(1000);
HAL_GPIO_WritePin(GPIOE, GPIO_PIN_10, 1);
HAL_Delay(1000);
CLI_Write("RESTARTING CC3100 AFTER PIN RESET\r");
g_Status = 0;
mode = sl_Start(0, 0, 0);
... now in back AP Mode (instead of Station mode) !! And waiting client connection !
I can connect to 192.168.1.1 which displays a status/config page but, now, how to get browser's requests...that's another story...
J.
Hello Kobi
Posting at the very same time ! Yes, toggling reset pin "manually" seems to solve the problem !
Thank you for your help
J.