CC3301: Channel-specific scanning feature in R7 version

Part Number: CC3301

Tool/software:

In the current R7 wifi driver, wifi scan uses the below API which performs a full spectrum scan:
ret = ctrlCmdFw_WLSendCommand(WLAN_SCAN, &cmd, sizeof(wlan_scan_cmd_t), &complete, sizeof(wlan_scan_complete_t));


This approach has several limitations:

Performance: Full spectrum scanning is time-consuming and resource-intensive
Reliability: The AP we expected is not found in scan results sometimes

We want TI to provide an enhanced API to improve scanning stability and performance:
Channel-specific scanning: only scan specific channels and eliminate unnecessary scanning of all channels
Ssid-specific scanning: only scan specified AP with ssid.
Mac-specific scanning: only scan specified AP with Mac address.

  • for the connection api, we also have the same requirement.

    wifi connecting api have below parameter:

    typedef struct
    {
    cmd_header_t hdr;
    signed char pName[33]; //ssid up to 32 chars + null termination
    int NameLen;
    unsigned char pMacAddr[6];
    char SecType;
    char pPass[64]; //passphrase can be 8-63 characters long + Null termination
    char PassLen;
    char padding[3];
    }wlan_connect_cmd_t;


    This api has a limitation: before it start a connection, it will perform a scan operation to find the AP's channel.

    we want add a parameter for channel (which we can provide), if the fw knows the AP's channel, it can either skip scan operation or speed up scan operation during the connection process.

  • Our overall goal is to connect as quickly and reliably as possible. CC3301 seems to first do scanning with a wildcard SSID, on all channels. Then, after it hears the requested SSID it connects. This is not optimal since we already know the channel. In this example, the connection could have been at least ~1s faster by immediately doing the ProbeReq with the correct SSID on the correct channel.

    16:35:16.846] WiFi: MAC address: xx:xx:xx:xx:xx:xx                                                                               
    16:35:16.849] WiFi: Requested country_code: DE, using EU instead.                                                                
    16:35:16.850] WiFi: Updated ssid in context:xx-xxxxxx, country code:EU                                                           
    16:35:16.850] WiFi: WIFI config saved                                                                                            
    16:35:16.868] WiFi: Connecting...                                                                                                
    16:35:16.871] WiFi: Updating wifi status: CONNECTING  error: 0 isp_error: ISP_ERR_OK(0) rssi: 16777215                           
    16:35:16.890] WiFi: ISP Wifi transitioning from state DISCONNECTED to CONNECTING                                                 
    16:35:16.894] WiFi: Pending action: CONNECT                                                                                      
    16:35:16.895] WiFi: Updating wifi status: CONNECTING  error: 0 isp_error: ISP_ERR_OK(0) rssi: 16777215                           
    16:35:16.895] WiFi: Initializing network stack...                                                                                
    16:35:16.895] WiFi: Starting network...                                                                                          
    16:35:16.902] CC33xx wifi driver version: R_7                                                                                    
    16:35:16.906] select scio 2                                                                                                      
    16:35:17.135] scio_init2: pre_init failed, got to reset init                                                                     
    16:35:17.139] sdio_change_clk: set sdio clock 25000000                                                                           
    16:35:17.139] sdio_set_buswidth_4bit: card_bus_width_switch to 4bit                                                              
    16:35:17.140] sdio function num=2, wifi_run_flag=0, err = 0                                                                      
    16:35:17.140] sdio_wifi_init sdio2 ret=0                                                                                         
    16:35:17.141] Hardware init DONE!                                                                                                
    16:35:17.141] Starting FW download.....                                                                                          
    16:35:17.396] Download RAM-BTL                                                                                                   
    16:35:17.400] Download FW                                                                                                        
    16:35:17.448] cc33xx_rev: 1.7.6.310                                                                                              
    16:35:18.709] Download IniParams                                                                                                 
    16:35:18.714] FW Download complete                                                                                               
    16:35:18.714] wifi init done                                                                                                     
    16:35:18.722] Wlan_Start: set mac xx:xx:xx:xx:xx:xx                                                                              
    16:35:18.726] Chosen domain is EU                                                                                                
    16:35:18.727] Wlan_RoleUp ROLE_STA!                                                                                              
    16:35:18.743] WiFi: [wl0] NETIF_LINK_STATUS_UP                                                                                   
    16:35:18.747] WiFi: [wl0] NETIF_LINK_STATUS_DOWN                                                                                 
    16:35:18.747] WiFi: [wl0] Link is down as part of re-/activation                                                                 
    16:35:18.755] [WLAN EVENT] Device disconnected from the AP, ReasonCode: 200                                                      
    16:35:19.409] scan 10 find ssid xx-xxxxxx (len 9)                                                                                
    16:35:19.421] security type: WPA2_PLUS                                                                                           
    16:35:19.422] connect to xx-xxxxxx, sectype: 11                                                                                  
    16:35:29.415] connect timeout                                                                                                    
    16:35:29.425] connect to xx-xxxxxx, sectype: 11                                                                                  
    16:35:39.416] connect timeout                                                                                                    
    16:35:39.427] connect to xx-xxxxxx, sectype: 11                                                                                  
    16:35:40.159] connect SSID: xx-xxxxxx                                                                                            
    16:35:40.170] BSSID: xx:xx:xx:xx:xx:xx                                                                                           
    16:35:40.171] WiFi: [wl0] NETIF_LINK_STATUS_ON                                                                                   
    16:35:40.172] WiFi: [wl0] Setting manual IP config (ip=192.168.x.xx, netmask=255.255.255.0, gateway=192.168.x.x, dns=192.168.x.x)
    16:35:40.172] WiFi: [wl0] NETIF_LINK_STATUS_UP                                                                                   
    16:35:40.176] WIFI Connected!                                                                                                    
    16:35:40.177] WiFi: Connected                                                                                                    

    In the logs above, the connection is 23.308 sec. Even if scanning all channels, this takes a very long time. Does the CC3301 continue scanning the whole time?

  • We are looking into the feasibility of these requests and will update you on it