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.

CC3220SF-LAUNCHXL: CC3220MODASF sl_Start generates reboot

Part Number: CC3220SF-LAUNCHXL
Other Parts Discussed in Thread: CC3220SF, CC3220S

Hi,

I use an CC3220MODASF module in my own application.

Used the modified Pinmux files.
By the way: when using TI-Pinmux tool there is still an error in this app, the IO-pins are not listed in .h and .c files.

Using FreeRTOS.

When calling sl_Start (without previous call to SPI_init()) an error occurs.
When calling sl_start (with previous call to SPI_init()) the system reboots.

The same behaviour is on CC3220SF launchpad.

Any ideas?

Regards
Jörg

  • Hi Jörg,

    The SPI_init() is required to establish the communication between host MCU and NWP.

    Please verify that you have started sl_Task before calling any of the sl APIs.


    Regards,
    Toby

  • Hi Toby,

    in main task (FreeRTOS) I have this code:

        SPI_init();
        GPIO_init();
        I2C_init();

        InitTerm();

        clock_settime(CLOCK_REALTIME, &ts);

        // sl_Task
        pthread_attr_init(&pAttrs_spawn);
        priParam.sched_priority = 9;
        RetVal = pthread_attr_setschedparam(&pAttrs_spawn, &priParam);
        RetVal |= pthread_attr_setstacksize(&pAttrs_spawn, 2048);
        RetVal = pthread_create(&g_SpawnThread, &pAttrs_spawn, sl_Task, 0);
        if(RetVal)
        {
            Report("Unable to create sl_Task thread\r\n");
            while(1);
        }

        RetVal = sl_Start(0, 0, 0);

    But when executing sl_Start() the module restarts.

    Regards
    Jörg

  • Hi Jörg,

    I not use FreeRTOS but I think your code-flow in main is not correct. You call sl_Start() before you starts scheduler (by vTaskStartScheduler()). Please see how are designed FreeTROS examples in SDK.

    In brief... Create another thread with sl_Start() and other network code. At end your your main you need call vTaskStartScheduler()

    Jan
  • Hi Jan,

    but that's what I'm doing:

    void *mainThread(void *arg)
    {
        int32_t RetVal;
        pthread_attr_t pAttrs_spawn;
        struct sched_param priParam;
        struct timespec ts = {0};

        SPI_init();
        GPIO_init();
        I2C_init();

        InitTerm();

        clock_settime(CLOCK_REALTIME, &ts);

        // sl_Task
        pthread_attr_init(&pAttrs_spawn);
        priParam.sched_priority = 9;
        RetVal = pthread_attr_setschedparam(&pAttrs_spawn, &priParam);
        RetVal |= pthread_attr_setstacksize(&pAttrs_spawn, 2048);
        RetVal = pthread_create(&g_SpawnThread, &pAttrs_spawn, sl_Task, 0);
        if(RetVal)
        {
            Report("Unable to create sl_Task thread\r\n");
            while(1);
        }

        RetVal = sl_Start(0, 0, 0);

        return 0;
    }

    int main()
    {
        pthread_t thread;
        pthread_attr_t pAttrs;
        struct sched_param priParam;
        int retc;
        int detachState;

        CC3220SF_LAUNCHXL_initGeneral();

        pthread_attr_init(&pAttrs);
        priParam.sched_priority = 1;

        detachState = PTHREAD_CREATE_DETACHED;
        retc = pthread_attr_setdetachstate(&pAttrs, detachState);
        if(retc)
        {
            while(1);
        }

        pthread_attr_setschedparam(&pAttrs, &priParam);
        retc |= pthread_attr_setstacksize(&pAttrs, 4096);
        if(retc)
        {
            while(1);
        }

        retc = pthread_create(&thread, &pAttrs, mainThread, 0);
        if(retc)
        {
            while(1);
        }

        vTaskStartScheduler();

        return 0;
    }

    Regards
    Jörg

  • Hi Jörg,

    Can you try with original CC3220S_LAUNCHXL.c/h files from SDK? Do you use original linker files from SDK?

    Jan
  • Jörg,

    Load an example from the SDK that calls sl_Start (eg. out_of_box).

    Let us know if you still see the issue on a launchpad.


    Regards,
    Toby
  • Hi Toby,

    finally I found the error:
    The GND pins of the module were not connected to any net.
    So when one of the SOP pins was directly connected to GND (not via resistor) the module gets the GND signal through that pin.
    Starting the main processor works, but when starting the NWP the consumed power is too much for this single SOP pin with GND on it.

    Regards
    Jörg

  • I already took the examples from SDK. But I can't get them run.
  • Jörg,

    I'm glad you found the issue.


    Regards,
    Toby