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.

CC3235S: CC3235S

Part Number: CC3235S

Board: CC3235s

SDK: SimpleLink CC32xx SDK- 3.40.0.05

Service Pack File name: sp_4.9.0.2_3.7.0.1_3.1.0.26.bin

When our board wake up from lpds mode, we use a task to  select sokcet fd,

we can wakeup successfully, but we can  not select anymore. Our sl_select can't

return. 

1. why our sl_select can't return while wake up from lpds ?

  • Hi Yankai,

    Is there a specific reason you chose to use the 3.40.0.05 version of the CC32XX SDK? This contains the latest CC3x35 service pack, which is sp_4.11.0.0_3.7.0.1_3.1.0.26.bin.

    Can you try again with this SDK and service pack and let me know the results?

    Thanks,

    Jacob

  • Dear Jacob,

         I already update the binfile which name is sp_4.11.0.0_3.7.0.1_3.1.0.26.bin.

    I still saw the situation which awake from server then we can receive command once, and then select function can not return again.

    If we do not run Power_enablePolicy() and Power_disablePolicy()  the situation can not happen.

  • Hello Yankai,

    I left out the latest SDK version in my last post. You are using the latest service pack sp_4.11.0.0_3.7.0.1_3.1.0.26.bin sp_4.11.0.0_3.7.0.1_3.1.0.26.bin from the latest SDK (5.20.00.06)? 

    If we do not run Power_enablePolicy() and Power_disablePolicy()  the situation can not happen

    Do I understand you correctly that when you run Power_enablePolicy() and Power_disablePolicy(), you are able to return from sl_Select?

    Thanks,
    Jacob 

  • Dear jacob,

          I use sp_4.11.0.0_3.7.0.1_3.1.0.26.bin and last SDK (5.20.00.06).

    but the situation is same.

          Do I understand you correctly that when you run Power_enablePolicy() and Power_disablePolicy(), you are able to return from sl_Select?

           It just can return once, and when the web send command after web send wake up command. The select api can not return again.

  • Hi Yankai,

    Can you provide a code snippet of your sl_Select implementation? How are you using this function in your program?

    Thanks,
    Jacob

  •     SL_SOCKET_FD_ZERO(&r_set);
        SL_SOCKET_FD_SET(tcp_client_fd, &r_set);
        SL_SOCKET_FD_SET(udp_fd[0], &r_set);
        SL_SOCKET_FD_SET(udp_fd_audio[0], &r_set);
        nfds = (udp_fd[0] > tcp_client_fd) ? udp_fd[0] : tcp_client_fd;
        nfds = (udp_fd_audio[0] > nfds) ? udp_fd_audio[0] : nfds;
        nfds = nfds + 1;
        while (1) {
            read_set = r_set;
            ret = sl_Select(nfds, &read_set, NULL, NULL, &time_out);
            if (ret < 0) {
                bpi_error("sl_Select failed\n");
                break;
            } else if (ret == 0) {
                //bpi_error("sl_Select return 0 which is unexpected\n");
                //break;
                continue;
            } else {
                if (SL_SOCKET_FD_ISSET(tcp_client_fd, &read_set)) {
                    ret = process_tcp_msg(tcp_client_fd);
                    if (ret <= 0) {
                        break;
                    }
                }
                if (SL_SOCKET_FD_ISSET(udp_fd[0], &read_set)) {
                    ret = process_udp_msg(udp_fd[0]);
                    if (ret >= 0) {
                        bpi_debug("Exit cmd received\n");
                        goto exit;
                    } else {
                        break;
                    }
                }
                #if 1
                if (SL_SOCKET_FD_ISSET(udp_fd_audio[0], &read_set)) {
                    do {
                         ret = audio_data_pool_query_mem(&data_info);
                         if (!data_info.used) {
                             break;
                         } else {
                             if (ret != 0) {
                                 bpi_info_time("Query audio data memory failed, try again\n");
                             }
                         }
                     } while (0);
    
                     if (!data_info.used /*&& data_info.data*/) {
                         if(ret = sl_RecvFrom(udp_fd_audio[0], data_info.data, size, 0, (SlSockAddr_t *)&Addr, (SlSocklen_t*)&AddrSize) < 0) {
                             bpi_error("get udp data failed\n");
                             break;
                         }
                         //bpi_info("audio - %x %x %x %x\n",data_info.data[0],data_info.data[1],data_info.data[2],data_info.data[3]);
                         //bpi_info("audio size - %d\n",size);
                         data_info.size = size;
                         audio_data_pool_query_mem_done(&data_info);
                     }
                }
                #endif
            }
        }

  • Dear Jacob,

           We need to receive socket from a server, out message size is 512 bytes. But we only set our buffer size is 300 bytes.

    Can our select function trigger two times? 

    Maybe the root cause is when the socket receive one time, then I destroy the socket select task.

    Because our device can into lpds mode, we need to destroy the task.

    I create the task again, the above reason can cause the NWP select can't return again. Is the reason correct?

  • Hi Yankai,

    Is the buffer size you refer to for UDP or TCP? If it is for UDP, the buffer size should be bigger than what you expect. You can monitor the return value to see the actual size of the received packet.

    Why do you need to destroy your task to enter LPDS? Sl_Select should pend on a semaphore allowing you to go into LPDS. 

    Thanks,

    Jacob