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.

CC3220MOD: Occur error -2005 at sl_Send in case of SDK 2.20.

Part Number: CC3220MOD
Other Parts Discussed in Thread: CC3220SF

Hello,

I open new thread because this is different issue from original one.
Attached program transmits 24KB TCP traffic every 0.16s.
This program runs normally with SDK 2.10, but with SDK 2.20 stops abnormally after sending some packets.
At that time, the return value from sl_Send is -2005(=SL_API_ABORTED).

Why?

Sample program usage:
1) Import serial_wifi_CC3220SF_LAUNCHXL_tirtos_ccs from SDK.
2) Replace serial_wifi.c in the project with attached file.
3) Set SSID, security key, ip address in the source code.
4) Build, load, and run.

I'm using SocketTest v3.0.0 as the receiver side software.
It's downloaded from sourceforge.
sourceforge.net/.../

Regards,
Nobuhiro

#include <stddef.h>
#include <ti/drivers/Timer.h>
#include <ti/drivers/SPI.h>
#include <ti/drivers/net/wifi/slnetifwifi.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/devices/cc32xx/inc/hw_types.h>
#include <ti/devices/cc32xx/inc/hw_memmap.h>
#include <ti/devices/cc32xx/inc/hw_ints.h>
#include <ti/devices/cc32xx/inc/hw_timer.h>
#include <ti/devices/cc32xx/driverlib/timer.h>
#include <ti/devices/cc32xx/driverlib/prcm.h>
#include <ti/devices/cc32xx/driverlib/rom_map.h>
#include <ti/devices/cc32xx/driverlib/interrupt.h>
#include "pthread.h"
#include "Board.h"

#define INTR_PERIOD_COUNTS_VALUE  16000 // 200us
#define AP_SSID "SSID"    // Access Point
#define PAYLOAD_SIZE (24*1024)      // 24KB
#define SEND_PERIOD_INT 800         // WLAN send interval 160ms

Timer_Params timerParams;
Timer_Handle timerHandle = 0;

pthread_t gSpawnThread = (pthread_t)NULL;
pthread_attr_t pAttrs_spawn;
struct sched_param  priParam;

Task_Params taskParams;
Task_Struct taskStruct;
Char taskStack[4096];

Semaphore_Params semParams;
Semaphore_Struct semStruct;
Semaphore_Handle semHandle;

int32_t sock;
SlNetCfgIpV4Args_t ipV4;
SlSockAddrIn_t sAddr;
SlWlanSecParams_t secParams;

unsigned long send_count = 0;
unsigned char payload[PAYLOAD_SIZE] = {};
unsigned long interruptCount = 0;
int status = 0;

// Callback Functions from SimpleLink Wifi Driver - must be defined
void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent) {}
void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent) {}
void SimpleLinkHttpServerEventHandler(SlNetAppHttpServerEvent_t *pHttpEvent, SlNetAppHttpServerResponse_t *pHttpResponse) {}
void SimpleLinkGeneralEventHandler(SlDeviceEvent_t *pDevEvent) {}
void SimpleLinkSockEventHandler(SlSockEvent_t *pSock) {}
void SimpleLinkFatalErrorEventHandler(SlDeviceFatal_t *slFatalErrorEvent){}
void SimpleLinkNetAppRequestEventHandler(SlNetAppRequest_t *pNetAppRequest, SlNetAppResponse_t *pNetAppResponse) {}
void SimpleLinkNetAppRequestMemFreeEventHandler(uint8_t *buffer) {}


// WLAN send
void sendTask(UArg arg0, UArg arg1)
{
    int i;
    unsigned char dummy_data;

    for (;;) {
        Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
        send_count++;
        dummy_data = 0x30 + (send_count % 8);
        for (i = 0; i < PAYLOAD_SIZE; i++) {
            if ((i % 64) == 0) {
                payload[i] = '\n';
            } else {
                payload[i] = dummy_data;
            }
        }
        status = sl_Send(sock, payload, sizeof(payload), 0);
        if (status < 0) {
            while(1);
        }
    }
}


void timerCallback(void)
{
    MAP_TimerIntClear(TIMERA2_BASE, 0x2FFF);

    interruptCount++;
    if (interruptCount % SEND_PERIOD_INT == 0) {
        Semaphore_post(semHandle);
    }
}


void *mainThread(void *arg0)
{
    SPI_init();

    Semaphore_Params_init(&semParams);
    semParams.mode = Semaphore_Mode_BINARY;
    Semaphore_construct(&semStruct, 0, &semParams);
    semHandle = Semaphore_handle(&semStruct);

    // Create sl_Task
    pthread_attr_init(&pAttrs_spawn);
    priParam.sched_priority = 9;
    pthread_attr_setschedparam(&pAttrs_spawn, &priParam);
    pthread_attr_setstacksize(&pAttrs_spawn, 4096);
    pthread_create(&gSpawnThread, &pAttrs_spawn, sl_Task, NULL);

    // Create send task
    Task_Params_init(&taskParams);
    taskParams.stackSize = 4096;
    taskParams.stack = &taskStack;
    taskParams.priority = 10;
    Task_construct(&taskStruct, (Task_FuncPtr)sendTask, &taskParams, NULL);

    // Establish connection to AP
    sl_Stop(10000);
    if (sl_Start(0, 0, 0) != ROLE_STA) {
        sl_WlanSetMode(ROLE_STA);
        sl_Stop(10000);
        sl_Start(0, 0, 0);
    }
    ipV4.Ip =        (_u32)SL_IPV4_VAL(192, 168, 0, 6); // my(sender) ip
    ipV4.IpMask =    (_u32)SL_IPV4_VAL(255, 255, 255, 0);
    ipV4.IpGateway = (_u32)SL_IPV4_VAL(192, 168, 0, 1); // dummy
    ipV4.IpDnsServer=(_u32)SL_IPV4_VAL(192, 168, 0, 1); // dummy
    sl_NetCfgSet(SL_NETCFG_IPV4_STA_ADDR_MODE, SL_NETCFG_ADDR_STATIC, sizeof(SlNetCfgIpV4Args_t), (uint8_t *)&ipV4);
    secParams.Key = "security key";
    secParams.KeyLen = strlen(secParams.Key);
    secParams.Type = SL_WLAN_SEC_TYPE_WPA_WPA2;
    sl_WlanConnect(AP_SSID, strlen(AP_SSID), 0, &secParams, 0);

    Task_sleep(5000);   // wait 5s

    // Create socket
    sAddr.sin_family = SL_AF_INET;
    sAddr.sin_port = sl_Htons(5001);
    sAddr.sin_addr.s_addr = sl_Htonl(SL_IPV4_VAL(192, 168, 0, 108));    // receiver's ip
    sock = sl_Socket(SL_AF_INET, SL_SOCK_STREAM, 0);
    sl_Connect(sock, (const SlSockAddr_t *)&sAddr, sizeof(SlSockAddrIn_t));

    // Create timer

    /* Initialize hardware timer */
    MAP_PRCMPeripheralClkEnable(PRCM_TIMERA2, PRCM_RUN_MODE_CLK);
    MAP_IntDisable(INT_TIMERA2A);
    MAP_IntDisable(INT_TIMERA2B);
    MAP_TimerIntDisable(TIMERA2_BASE, TIMER_CAPB_EVENT | TIMER_CAPB_MATCH | TIMER_TIMB_TIMEOUT | TIMER_CAPA_EVENT | TIMER_CAPA_MATCH | TIMER_TIMA_TIMEOUT);
    MAP_TimerDisable(TIMERA2_BASE, TIMER_BOTH);
    MAP_TimerIntClear(TIMERA2_BASE, TIMER_CAPB_EVENT | TIMER_CAPB_MATCH | TIMER_TIMB_TIMEOUT | TIMER_CAPA_EVENT | TIMER_CAPA_MATCH | TIMER_TIMA_TIMEOUT);

    /* set timer interrupt to 0, highest app priority */
    MAP_IntPrioritySet(INT_TIMERA2A, 0<<5);
    MAP_IntPrioritySet(INT_TIMERA2B, 0<<5);

    /* Configure timer as periodic count-down with period of INTR_PERIOD_COUNTS_VALUE ticks */
    MAP_TimerConfigure(TIMERA2_BASE, TIMER_CFG_PERIODIC);
    MAP_TimerLoadSet(TIMERA2_BASE, TIMER_A, INTR_PERIOD_COUNTS_VALUE);
    MAP_TimerIntRegister(TIMERA2_BASE, TIMER_A, timerCallback);

    /* Start the timer */
    MAP_IntEnable(INT_TIMERA2A);
    MAP_TimerIntEnable(TIMERA2_BASE, TIMER_TIMA_TIMEOUT);
    MAP_TimerEnable(TIMERA2_BASE, TIMER_A);

    return (NULL);
}

  • Nobuhiro,

    Can you verify you are receiving the data on the other end? also, can add debug prints to your WLAN event handlers and Socket Handler? Using this, we can check and make sure you are not losing connection to the access point, or that you are losing the connection to the server.

    Also, if you ignore the -2005 error, and continue to try to transmit, does the code work?

    Regards,

    Vince Rodriguez
  • Hello Vincent,

    Thanks for your quick reply.

    > Can you verify you are receiving the data on the other end?

    Until error happened, the receiver could get the data from sender normally.


    > also, can add debug prints to your WLAN event handlers and Socket Handler?

    Attached program is added the feature that displays events from NWP.
    The results is below.

    SL_WLAN_EVENT_CONNECT: STA Connected to AP: APSSID , BSSID: XX:XX:XX:XX:XX:XX
    SL_NETAPP_EVENT_IPV4_ACQUIRED: IPv4 acquired: IP = 192.168.0.6

    [ERROR] - FATAL ERROR: Driver Abort detected.

    There are nothing special events occured, I think.


    > Also, if you ignore the -2005 error, and continue to try to transmit, does the code work?

    Next screenshot indicates error_history.
    Once error -2005 happens, transmission is stopped, and never send again even if program ignores error.

    Regards,
    Nobuhiro

    #include <stddef.h>
    #include <ti/drivers/Timer.h>
    #include <ti/drivers/SPI.h>
    #include <ti/drivers/net/wifi/slnetifwifi.h>
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/knl/Semaphore.h>
    #include <ti/devices/cc32xx/inc/hw_types.h>
    #include <ti/devices/cc32xx/inc/hw_memmap.h>
    #include <ti/devices/cc32xx/inc/hw_ints.h>
    #include <ti/devices/cc32xx/inc/hw_timer.h>
    #include <ti/devices/cc32xx/driverlib/timer.h>
    #include <ti/devices/cc32xx/driverlib/prcm.h>
    #include <ti/devices/cc32xx/driverlib/rom_map.h>
    #include <ti/devices/cc32xx/driverlib/interrupt.h>
    #include "uart_term.h"
    #include "pthread.h"
    #include "Board.h"
    
    
    #define INTR_PERIOD_COUNTS_VALUE  16000 // 200us
    #define AP_SSID "SSID"    // Access Point
    #define PAYLOAD_SIZE (24*1024)      // 24KB
    #define SEND_PERIOD_INT 800         // WLAN sending occurs every 800 interrupts (160ms).
    
    Timer_Params timerParams;
    Timer_Handle timerHandle = 0;
    
    pthread_t gSpawnThread = (pthread_t)NULL;
    pthread_attr_t pAttrs_spawn;
    struct sched_param  priParam;
    
    Task_Params taskParams;
    Task_Struct taskStruct;
    Char taskStack[4096];
    
    Semaphore_Params semParams;
    Semaphore_Struct semStruct;
    Semaphore_Handle semHandle;
    
    int32_t sock;
    SlNetCfgIpV4Args_t ipV4;
    SlSockAddrIn_t sAddr;
    SlWlanSecParams_t secParams;
    
    unsigned long send_count = 0;
    unsigned char payload[PAYLOAD_SIZE] = {};
    unsigned long interruptCount = 0;
    int status = 0;
    int error_history[32768] = {};
    int error_count = 0;
    
    // Callback Functions from SimpleLink Wifi Driver - must be defined
    void SimpleLinkWlanEventHandler(SlWlanEvent_t *pWlanEvent)
    {
        if(pWlanEvent == NULL)
        {
            UART_PRINT("SimpleLinkWlanEvent: pWlanEvent is NULL\n\r");
            return;
        }
    
         switch(pWlanEvent->Id)
         {
            case SL_WLAN_EVENT_CONNECT:
                UART_PRINT("SL_WLAN_EVENT_CONNECT: STA Connected to AP: %s , BSSID: %x:%x:%x:%x:%x:%x\n\r", pWlanEvent->Data.Connect.SsidName, pWlanEvent->Data.Connect.Bssid[0], pWlanEvent->Data.Connect.Bssid[1],
                           pWlanEvent->Data.Connect.Bssid[2], pWlanEvent->Data.Connect.Bssid[3], pWlanEvent->Data.Connect.Bssid[4], pWlanEvent->Data.Connect.Bssid[5]);
                break;
    
            case SL_WLAN_EVENT_DISCONNECT:
                UART_PRINT("SL_WLAN_EVENT_DISCONNECT\n\r");
                break;
    
            case SL_WLAN_EVENT_STA_ADDED:
                UART_PRINT("SL_WLAN_EVENT_STA_ADDED\n\r");
                break;
    
            case SL_WLAN_EVENT_STA_REMOVED:
                UART_PRINT("SL_WLAN_EVENT_STA_REMOVED\n\r");
                break;
    
            default:
                UART_PRINT("Unknown SimpleLinkWlanEvent Id: %d\n\r", pWlanEvent->Id);
                break;
        }
    }
    
    
    void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent)
    {
        if(pNetAppEvent == NULL)
        {
            UART_PRINT("SimpleLinkNetAppEvent: pNetAppEvent is NULL\n\r");
            return;
        }
    
        switch(pNetAppEvent->Id)
        {
            case SL_NETAPP_EVENT_IPV4_ACQUIRED:
                UART_PRINT("SL_NETAPP_EVENT_IPV4_ACQUIRED: IPv4 acquired: IP = %d.%d.%d.%d\n\r",\
                    (uint8_t)SL_IPV4_BYTE(pNetAppEvent->Data.IpAcquiredV4.Ip,3),\
                    (uint8_t)SL_IPV4_BYTE(pNetAppEvent->Data.IpAcquiredV4.Ip,2),\
                    (uint8_t)SL_IPV4_BYTE(pNetAppEvent->Data.IpAcquiredV4.Ip,1),\
                    (uint8_t)SL_IPV4_BYTE(pNetAppEvent->Data.IpAcquiredV4.Ip,0));
                break;
    
            case SL_NETAPP_EVENT_DHCPV4_LEASED:
                UART_PRINT("SL_NETAPP_EVENT_DHCPV4_LEASED\n\r");
                break;
    
            case SL_NETAPP_EVENT_DHCPV4_RELEASED:
                UART_PRINT("SL_NETAPP_EVENT_DHCPV4_RELEASED\n\r");
                break;
    
            default:
                UART_PRINT("Unknown SimpleLinkNetAppEvent: %d\n\r", pNetAppEvent->Id);
                break;
       }
    }
    
    
    void SimpleLinkHttpServerEventHandler(SlNetAppHttpServerEvent_t *pHttpEvent, SlNetAppHttpServerResponse_t *pHttpResponse) {}
    
    
    void SimpleLinkGeneralEventHandler(SlDeviceEvent_t *pDevEvent)
    {
        if(pDevEvent == NULL)
        {
            UART_PRINT("SimpleLinkGeneralEvent: pDevEvent is NULL\n\r");
            return;
        }
    
        UART_PRINT("[GENERAL EVENT] - ID=[%d] Sender=[%d]\n\n", pDevEvent->Data.Error.Code, pDevEvent->Data.Error.Source);
    }
    
    
    void SimpleLinkSockEventHandler(SlSockEvent_t *pSock)
    {
        if(pSock == NULL)
        {
            UART_PRINT("SimpleLinkSockEvent: pSock is NULL\n\r");
            return;
        }
    
        switch (pSock->Event)
        {
            case SL_SOCKET_TX_FAILED_EVENT:
                switch (pSock->SocketAsyncEvent.SockTxFailData.Status)
                {
                    case SL_ERROR_BSD_ECLOSE:
                        UART_PRINT("[SOCK ERROR] - close socket (%d) operation "
                                "failed to transmit all queued packets\n\r", pSock->SocketAsyncEvent.SockTxFailData.Sd);
                        break;
                    default:
                        UART_PRINT("[SOCK ERROR] - TX FAILED  :  socket %d , "
                                "reason (%d) \n\n", pSock->SocketAsyncEvent.SockTxFailData.Sd, pSock->SocketAsyncEvent.SockTxFailData.Status);
                        break;
                }
                break;
            case SL_SOCKET_ASYNC_EVENT:
            {
                UART_PRINT("[SOCK ERROR] an event received on socket %d\r\n",pSock->SocketAsyncEvent.SockAsyncData.Sd);
                switch(pSock->SocketAsyncEvent.SockAsyncData.Type)
                {
                    case SL_SSL_NOTIFICATION_CONNECTED_SECURED:
                        UART_PRINT("[SOCK ERROR] SSL handshake done");
                        break;
                    case SL_SSL_NOTIFICATION_HANDSHAKE_FAILED:
                        UART_PRINT("[SOCK ERROR] SSL handshake failed with error %d\r\n", pSock->SocketAsyncEvent.SockAsyncData.Val);
                        break;
                    case SL_SSL_ACCEPT:
                        UART_PRINT("[SOCK ERROR] Recoverable error occurred during the handshake %d\r\n",pSock->SocketAsyncEvent.SockAsyncData.Val);
                        break;
                    case SL_OTHER_SIDE_CLOSE_SSL_DATA_NOT_ENCRYPTED:
                        UART_PRINT("[SOCK ERROR] Other peer terminated the SSL layer.\r\n");
                        break;
                    case SL_SSL_NOTIFICATION_WRONG_ROOT_CA:
                        UART_PRINT("[SOCK ERROR] Used wrong CA to verify the peer.\r\n");
                        break;
                    default:
                        break;
                }
                break;
            }
            default:
                UART_PRINT("[SOCK EVENT] - Unexpected Event [%x0x]\n\n", pSock->Event);
                break;
        }
    }
    
    
    void SimpleLinkFatalErrorEventHandler(SlDeviceFatal_t *slFatalErrorEvent)
    {
        if(slFatalErrorEvent == NULL)
        {
            UART_PRINT("SimpleLinkFatalErrorEvent: slFatalErrorEvent is NULL\n\r");
            return;
        }
    
        switch (slFatalErrorEvent->Id)
        {
            case SL_DEVICE_EVENT_FATAL_DEVICE_ABORT:
            {
                UART_PRINT("\n\r[ERROR] - FATAL ERROR: Abort NWP event detected: "
                            "AbortType=%d, AbortData=0x%x\n\r",
                            slFatalErrorEvent->Data.DeviceAssert.Code,
                            slFatalErrorEvent->Data.DeviceAssert.Value);
            }
            break;
    
            case SL_DEVICE_EVENT_FATAL_DRIVER_ABORT:
            {
                UART_PRINT("\n\r[ERROR] - FATAL ERROR: Driver Abort detected. \n\r");
            }
            break;
    
            case SL_DEVICE_EVENT_FATAL_NO_CMD_ACK:
            {
                UART_PRINT("\n\r[ERROR] - FATAL ERROR: No Cmd Ack detected "
                            "[cmd opcode = 0x%x] \n\r",
                                            slFatalErrorEvent->Data.NoCmdAck.Code);
            }
            break;
    
            case SL_DEVICE_EVENT_FATAL_SYNC_LOSS:
            {
                UART_PRINT("\n\r[ERROR] - FATAL ERROR: Sync loss detected n\r");
            }
            break;
    
            case SL_DEVICE_EVENT_FATAL_CMD_TIMEOUT:
            {
                UART_PRINT("\n\r[ERROR] - FATAL ERROR: Async event timeout detected "
                            "[event opcode =0x%x]  \n\r",
                                        slFatalErrorEvent->Data.CmdTimeout.Code);
            }
            break;
    
            default:
                UART_PRINT("\n\r[ERROR] - FATAL ERROR: Unspecified error detected: %d \n\r", slFatalErrorEvent->Id);
            break;
        }
    }
    
    
    void SimpleLinkNetAppRequestEventHandler(SlNetAppRequest_t *pNetAppRequest, SlNetAppResponse_t *pNetAppResponse) {}
    
    
    void SimpleLinkNetAppRequestMemFreeEventHandler(uint8_t *buffer) {}
    
    
    // WLAN send
    void sendTask(UArg arg0, UArg arg1)
    {
        int i;
        unsigned char dummy_data;
    
        for (;;) {
            Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);
            send_count++;
            dummy_data = 0x30 + (send_count % 8);
            for (i = 0; i < PAYLOAD_SIZE; i++) {
                if ((i % 64) == 0) {
                    payload[i] = '\n';
                } else {
                    payload[i] = dummy_data;
                }
            }
            status = sl_Send(sock, payload, sizeof(payload), 0);
            if (status < 0) {
                if (error_count < 16384) {
                    error_history[error_count * 2] = send_count;
                    error_history[error_count * 2 + 1] = status;
                    error_count++;
                }
            }
        }
    }
    
    
    void timerCallback(void)
    {
        MAP_TimerIntClear(TIMERA2_BASE, 0x2FFF);
    
        interruptCount++;
        if (interruptCount % SEND_PERIOD_INT == 0) {
            Semaphore_post(semHandle);
        }
    }
    
    
    void *mainThread(void *arg0)
    {
        SPI_init();
        /* Configure the UART */
        InitTerm();
    
        Semaphore_Params_init(&semParams);
        semParams.mode = Semaphore_Mode_BINARY;
        Semaphore_construct(&semStruct, 0, &semParams);
        semHandle = Semaphore_handle(&semStruct);
    
        // Create sl_Task
        pthread_attr_init(&pAttrs_spawn);
        priParam.sched_priority = 9;
        pthread_attr_setschedparam(&pAttrs_spawn, &priParam);
        pthread_attr_setstacksize(&pAttrs_spawn, 4096);
        pthread_create(&gSpawnThread, &pAttrs_spawn, sl_Task, NULL);
    
        // Create send task
        Task_Params_init(&taskParams);
        taskParams.stackSize = 4096;
        taskParams.stack = &taskStack;
        taskParams.priority = 10;
        Task_construct(&taskStruct, (Task_FuncPtr)sendTask, &taskParams, NULL);
    
        // Establish connection to AP
        sl_Stop(10000);
        if (sl_Start(0, 0, 0) != ROLE_STA) {
            sl_WlanSetMode(ROLE_STA);
            sl_Stop(10000);
            sl_Start(0, 0, 0);
        }
        ipV4.Ip =        (_u32)SL_IPV4_VAL(192, 168, 0, 6); // my(sender) ip
        ipV4.IpMask =    (_u32)SL_IPV4_VAL(255, 255, 255, 0);
        ipV4.IpGateway = (_u32)SL_IPV4_VAL(192, 168, 0, 1); // dummy
        ipV4.IpDnsServer=(_u32)SL_IPV4_VAL(192, 168, 0, 1); // dummy
        sl_NetCfgSet(SL_NETCFG_IPV4_STA_ADDR_MODE, SL_NETCFG_ADDR_STATIC, sizeof(SlNetCfgIpV4Args_t), (uint8_t *)&ipV4);
        secParams.Key = "secure key";
        secParams.KeyLen = strlen(secParams.Key);
        secParams.Type = SL_WLAN_SEC_TYPE_WPA_WPA2;
        sl_WlanConnect(AP_SSID, strlen(AP_SSID),0,&secParams,0);
    
        Task_sleep(5000);   // wait 5s
    
        // Create socket
        sAddr.sin_family = SL_AF_INET;
        sAddr.sin_port = sl_Htons(5001);
        sAddr.sin_addr.s_addr = sl_Htonl(SL_IPV4_VAL(192, 168, 0, 108));    // receiver's ip
        sock = sl_Socket(SL_AF_INET, SL_SOCK_STREAM, 0);
        sl_Connect(sock, (const SlSockAddr_t *)&sAddr, sizeof(SlSockAddrIn_t));
    
        // Create timer
    
        /* Initialize hardware timer */
        MAP_PRCMPeripheralClkEnable(PRCM_TIMERA2, PRCM_RUN_MODE_CLK);
        MAP_IntDisable(INT_TIMERA2A);
        MAP_IntDisable(INT_TIMERA2B);
        MAP_TimerIntDisable(TIMERA2_BASE, TIMER_CAPB_EVENT | TIMER_CAPB_MATCH | TIMER_TIMB_TIMEOUT | TIMER_CAPA_EVENT | TIMER_CAPA_MATCH | TIMER_TIMA_TIMEOUT);
        MAP_TimerDisable(TIMERA2_BASE, TIMER_BOTH);
        MAP_TimerIntClear(TIMERA2_BASE, TIMER_CAPB_EVENT | TIMER_CAPB_MATCH | TIMER_TIMB_TIMEOUT | TIMER_CAPA_EVENT | TIMER_CAPA_MATCH | TIMER_TIMA_TIMEOUT);
    
        /* set timer interrupt to 0, highest app priority */
        MAP_IntPrioritySet(INT_TIMERA2A, 0<<5);
        MAP_IntPrioritySet(INT_TIMERA2B, 0<<5);
    
        /* Configure timer as periodic count-down with period of INTR_PERIOD_COUNTS_VALUE ticks */
        MAP_TimerConfigure(TIMERA2_BASE, TIMER_CFG_PERIODIC);
        MAP_TimerLoadSet(TIMERA2_BASE, TIMER_A, INTR_PERIOD_COUNTS_VALUE);
        MAP_TimerIntRegister(TIMERA2_BASE, TIMER_A, timerCallback);
    
        /* Start the timer */
        MAP_IntEnable(INT_TIMERA2A);
        MAP_TimerIntEnable(TIMERA2_BASE, TIMER_TIMA_TIMEOUT);
        MAP_TimerEnable(TIMERA2_BASE, TIMER_A);
    
        return (NULL);
    }
    

  • Hi Nobuhiro,

    I have replicated your issue with your code on my own setup. Thanks for providing your detailed instructions to follow, as it saves me a great deal of time. As you point out, your code works with SDK version v2.10, but not with the latest v.2.20.

    Looking at the abort status code, it appears to be SL_DEVICE_EVENT_FATAL_DRIVER_ABORT . This indicates that the problem is within the Wi-Fi host driver of the CC3220, and not with the NWP. Indeed, looking at the NWP logs I've collected while running your code, there doesn't seem to be any abort or error on the NWP side.

    The host driver has changed quite a bit from v.2.10 to v.2.20, so I'm still debugging the possible spots in the host driver which have changed and could cause the abort condition. I appreciate your patience, and will bring this up with the R&D team which updated the host driver tomorrow.

    Regards,
    Michael
  • Hello Michael,

    Thanks for your reply.

    RTOS/LAUNCHCC3220MODASF: interrupt latency periodically get longer
    <e2e.ti.com/.../674855>

    Because of above issue, I wrote the sample code with DriverLib instead of TI Driver.
    I've not confirmed the operation with SDK 2.20, but please let me know if there is information on the timing of addressing it.

    Regards,
    Nobuhiro

  • Hi Nobuhiro,

    As part of my debug, I tried replacing the driverlib timer with a TI drivers timer, but that resulted in the same behavior. I also tried removing the timer entirely, and just have the sendTask() do sl_Send() non-stop without a timer with the same result.

    Given those tests, the problem is almost certainly in the host driver. I brought it up with our R&D team this morning, and they mentioned that they will take a look. The host driver has changed a great deal going from v.2.10 to v.2.20, and while they have done substantial testing, there is the possibility that there is some error case that they failed to find in their testing. I greatly appreciate your patience, and will update once they have replicated your error on their end and done their investigation.

    Regards,
    Michael
  • Hi Nobuhiro,

    We have finished our debug, and have concluded that the issue was caused due to mixing POSIX and TIRTOS-native objects.

    See the attached file for code demonstrating how when POSIX is used exclusively, the problem is fixed.

    /cfs-file/__key/communityserver-discussions-components-files/968/serial_5F00_wifi.c

    Let me know if that doesn't solve your issue, or if you need more help.

    Regards,

    Michael

  • Hello Michael,

    Thanks for your reply.
    I made sure the issue was fixed in the sample program.

    Regards,
    Nobuhiro