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 everyone!
This is what I would like to achive:
After calling sl_Start, i dont want to wait and until it finishes initializing itself, because I would like to collect data from my sensors.
Is it possible to get an interrupt that tells me, that the cc3100 is finished with initializing and I can start working with it?
If so, could someone explain it to me?
Best Regards,
Bálint
Dear Hnz,
Thank you for replying to my post.
The link you posted was very usefull ( i somehow skipped through that chapter). I tried to implement it in a simple test code, but i wasnt very successful. Could you please tell me where i went wrong? I included my test code below. I am using the msp430f5529 launchpad with the cc3100.
void InitCallBack(_u32 Status){ CLI_Write("init done"); } int main(int argc, char** argv){ WDTCTL = WDTPW + WDTHOLD; initClk(); CLI_Configure(); // tera term void (*fptr) (_u32)=InitCallBack; CLI_Write("WLAN AP MODE\n\r"); sl_Start(NULL, NULL, fptr);// init CC3100 sl_WlanSetMode(ROLE_AP); // CC3100 to AP mode while(1){}; }
Dear Jan,
Thank you for replying.
If I dont use the callback mode and use this code:
sl_Start(NULL, NULL, NULL); // init CC3100 sl_WlanSetMode(ROLE_AP); // CC3100 to AP mode
or if i use the callback mode like this:
void InitCallBack(_u32 Status){ CLI_Write("init done"); sl_WlanSetMode(ROLE_AP); // CC3100 to AP mode } int main(int argc, char** argv){ WDTCTL = WDTPW + WDTHOLD; initClk(); CLI_Configure(); // tera term void (*fptr) (_u32)=InitCallBack; CLI_Write("WLAN AP MODE\n\r"); sl_Start(NULL, NULL, fptr);// init CC3100 while(1){}; }
than i get the same result.
The sl_Start function's return value is SL_RET_CODE_OK, which is the expected value.
Tbh, i dont really understand the initialization of the cc3100.
Hi,
In asynchronous handler you cannot call sl_ API at CC3100 devices. I expect this will be same with init-callback as well.
Your code should look like:
int init_done = 0; void InitCallBack(_u32 Status){ CLI_Write("init done"); init_done = 1; } int main(int argc, char** argv){ WDTCTL = WDTPW + WDTHOLD; initClk(); CLI_Configure(); void (*fptr) (_u32)=InitCallBack; CLI_Write("WLAN AP MODE\n\r"); sl_Start(NULL, NULL, fptr); while(init_done == 0) {
// your code till is init of CC3100 done...
} sl_WlanSetMode(ROLE_AP); while(1){}; }
Jan
Dear Jan,
I copied your code, but the InitCallBack function is not called, and i get stuck in the while.
This is the code i run:
int init_done = 0; void InitCallBack(_u32 Status){ CLI_Write("init done"); init_done = 1; } int main(int argc, char** argv){ WDTCTL = WDTPW + WDTHOLD; initClk(); CLI_Configure(); void (*fptr) (_u32)=InitCallBack; CLI_Write("WLAN AP MODE\n\r"); sl_Start(NULL, NULL, fptr); while(init_done == 0) { CLI_Write("-"); } // your code till is init of CC3100 done... sl_WlanSetMode(ROLE_AP); while(1){}; }