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.

BOOSTXL-CC3120MOD: sl_Start returns

Part Number: BOOSTXL-CC3120MOD
Other Parts Discussed in Thread: UNIFLASH, CC3120

Hello,

I have ported the ti-simplelink library to the mbed-rtos and using it for FRDM K64 platform. The sl_Start function is always returning ROLE_RESERVED code.

How do I handle it to switch ROLE_STA or ROLE_AP ?

Thanks & Best Regards

Eser

  • Hi Eser,

    If you have not set the mode before, try calling sl_WlanSetMode(<ROLE_STA or ROLE_AP>) then performing a restart of the NWP with a call to sl_Stop(0xFF) followed by sl_Start() again.

    Alternatively, you can set the mode when you program the servicepack via UniFlash by going to  System Setting -> General Settings and selecting the desired role under the Start Role drop down.

    Best,

    Ben M

  • Hello Ben,

    Actually I have already tried all the things (including General Settings) what you have said in your mail. And the result is same it's ROLE_RESERVED.

    Could you please check the printf output of my code while communicating with the host interface. And also I am sending part of my code.

    By the way do I need to do anything when the Host IRQ is called ?

    Eser

    Code snippet for starting the CC3120

    wifi_init();

    pc.printf("***************************************************************************\r\n");

    pc.printf("***************************************************************************\r\n");

    int16_t ret = sl_WlanSetMode(ROLE_STA);

    sl_Stop(0);

    int16_t Role = sl_Start(0, 0, 0);

    if (ROLE_STA == Role) {

    pc.printf("CC3120 is in ROLE_STA mode...\r\n");

    } else if (ROLE_AP == Role) {

    pc.printf("CC3120 is in ROLE_AP mode...\r\n");

    }

    Output of the Host Interface Driver...

    CC3120 is reseted...

    CC3120 is initiliazed...

    Reset pin is 1, Hib is 0, CS is 1 and IRQ is pulled down...

    ***************************************************************************

    ***************************************************************************

    Timer is set   ......... 

    Semaphore is created ... Address : 0x20002ce8 -- pSemHandle : 0x200002d4

    Semaphore is pended  ... Address : 0x200002d4 -- pSemHandle : 0x200002d4

    Mutex is created ....... Address : 0x20002d00 -- pMutexHandle : 0x200028dc

    Mutex is created ....... Address : 0x20002d20 -- pMutexHandle : 0x200002d0

    Semaphore is created ... Address : 0x20002d40 -- pSemHandle : 0x20000250

    Semaphore is pended  ... Address : 0x20000250 -- pSemHandle : 0x20000250

    Semaphore is created ... Address : 0x20002d58 -- pSemHandle : 0x2000025c

    Semaphore is pended  ... Address : 0x2000025c -- pSemHandle : 0x2000025c

    Semaphore is created ... Address : 0x20002d70 -- pSemHandle : 0x20000268

    Semaphore is pended  ... Address : 0x20000268 -- pSemHandle : 0x20000268

    Semaphore is created ... Address : 0x20002d88 -- pSemHandle : 0x20000274

    Semaphore is pended  ... Address : 0x20000274 -- pSemHandle : 0x20000274

    Semaphore is created ... Address : 0x20002da0 -- pSemHandle : 0x20000280

    Semaphore is pended  ... Address : 0x20000280 -- pSemHandle : 0x20000280

    Semaphore is created ... Address : 0x20002db8 -- pSemHandle : 0x2000028c

    Semaphore is pended  ... Address : 0x2000028c -- pSemHandle : 0x2000028c

    Semaphore is created ... Address : 0x20002dd0 -- pSemHandle : 0x20000298

    Semaphore is pended  ... Address : 0x20000298 -- pSemHandle : 0x20000298

    Semaphore is created ... Address : 0x20002de8 -- pSemHandle : 0x200002a4

    Semaphore is pended  ... Address : 0x200002a4 -- pSemHandle : 0x200002a4

    Semaphore is created ... Address : 0x20002e00 -- pSemHandle : 0x200002b0

    Semaphore is pended  ... Address : 0x200002b0 -- pSemHandle : 0x200002b0

    Semaphore is created ... Address : 0x20002e18 -- pSemHandle : 0x200002bc

    Semaphore is pended  ... Address : 0x200002bc -- pSemHandle : 0x200002bc

    Mutex is created ....... Address : 0x20002e30 -- pMutexHandle : 0x200002e0

    Semaphore is created ... Address : 0x20002e50 -- pSemHandle : 0x200002e4

    SPI is enabled  ........ 

    Mutex is locked   ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is unlocked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is locked   ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is unlocked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is locked   ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is unlocked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Power Off : nHib is 0... 

    Host IRQ is enabled ....

    Power On  : nHib is 1... 

    Host IRQ is called  ....

    Semaphore is pended  ... Address : 0x20000250 -- pSemHandle : 0x20000250

    Mutex is locked   ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is unlocked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is locked   ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is unlocked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

  • Hello Ben,

    Actually I have already tried all the things (including General Settings) what you have said in your mail. And the result is same it's ROLE_RESERVED.

    Could you please check the printf output of my code while communicating with the host interface. And also I am sending part of my code.

    By the way do I need to do anything when the Host IRQ is called ?

    Eser

    Code snippet for starting the CC3120

    wifi_init();

    pc.printf("***************************************************************************\r\n");

    pc.printf("***************************************************************************\r\n");

    int16_t ret = sl_WlanSetMode(ROLE_STA);

    sl_Stop(0);

    int16_t Role = sl_Start(0, 0, 0);

    if (ROLE_STA == Role) {

    pc.printf("CC3120 is in ROLE_STA mode...\r\n");

    } else if (ROLE_AP == Role) {

    pc.printf("CC3120 is in ROLE_AP mode...\r\n");

    }

    Output of the Host Interface Driver...

    CC3120 is reseted...

    CC3120 is initiliazed...

    Reset pin is 1, Hib is 0, CS is 1 and IRQ is pulled down...

    ***************************************************************************

    ***************************************************************************

    Timer is set .........

    Semaphore is created ... Address : 0x20002ce8 -- pSemHandle : 0x200002d4

    Semaphore is pended ... Address : 0x200002d4 -- pSemHandle : 0x200002d4

    Mutex is created ....... Address : 0x20002d00 -- pMutexHandle : 0x200028dc

    Mutex is created ....... Address : 0x20002d20 -- pMutexHandle : 0x200002d0

    Semaphore is created ... Address : 0x20002d40 -- pSemHandle : 0x20000250

    Semaphore is pended ... Address : 0x20000250 -- pSemHandle : 0x20000250

    Semaphore is created ... Address : 0x20002d58 -- pSemHandle : 0x2000025c

    Semaphore is pended ... Address : 0x2000025c -- pSemHandle : 0x2000025c

    Semaphore is created ... Address : 0x20002d70 -- pSemHandle : 0x20000268

    Semaphore is pended ... Address : 0x20000268 -- pSemHandle : 0x20000268

    Semaphore is created ... Address : 0x20002d88 -- pSemHandle : 0x20000274

    Semaphore is pended ... Address : 0x20000274 -- pSemHandle : 0x20000274

    Semaphore is created ... Address : 0x20002da0 -- pSemHandle : 0x20000280

    Semaphore is pended ... Address : 0x20000280 -- pSemHandle : 0x20000280

    Semaphore is created ... Address : 0x20002db8 -- pSemHandle : 0x2000028c

    Semaphore is pended ... Address : 0x2000028c -- pSemHandle : 0x2000028c

    Semaphore is created ... Address : 0x20002dd0 -- pSemHandle : 0x20000298

    Semaphore is pended ... Address : 0x20000298 -- pSemHandle : 0x20000298

    Semaphore is created ... Address : 0x20002de8 -- pSemHandle : 0x200002a4

    Semaphore is pended ... Address : 0x200002a4 -- pSemHandle : 0x200002a4

    Semaphore is created ... Address : 0x20002e00 -- pSemHandle : 0x200002b0

    Semaphore is pended ... Address : 0x200002b0 -- pSemHandle : 0x200002b0

    Semaphore is created ... Address : 0x20002e18 -- pSemHandle : 0x200002bc

    Semaphore is pended ... Address : 0x200002bc -- pSemHandle : 0x200002bc

    Mutex is created ....... Address : 0x20002e30 -- pMutexHandle : 0x200002e0

    Semaphore is created ... Address : 0x20002e50 -- pSemHandle : 0x200002e4

    SPI is enabled ........

    Mutex is locked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is unlocked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is locked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is unlocked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is locked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is unlocked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Power Off : nHib is 0...

    Host IRQ is enabled ....

    Power On : nHib is 1...

    Host IRQ is called ....

    Semaphore is pended ... Address : 0x20000250 -- pSemHandle : 0x20000250

    Mutex is locked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is unlocked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is locked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0

    Mutex is unlocked ...... Address : 0x200002d0 -- pMutexHandle : 0x200002d0
  • Hi Eser,

    Have you updated the service pack on the device? Does the issue occur with multiple CC3120 devices?

    If so, I believe the issue is with how the data received from the CC3120 is being stored or interpreted on that platform.

    Please take a look at the data returned in the host driver from the sl_Start() call. Specifically, you can see what the message is that is passed to the _SlDeviceGetStartResponseConvert() function call inside of sl_Start(). This will show the actual data returned from the interface, prior to being translated into a device role from the StartResponseLUT.

    Best Regards,
    Ben M