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.

CC3235SF: About sl_ Send() failed to send and returned - 11

Part Number: CC3235SF
Other Parts Discussed in Thread: UNIFLASH, SYSCONFIG,

Hi,

When I use sl_send() to send data to the server, I find that - 11 is often returned. After testing for 60s, 211 times - 11 is returned. What is the reason for this and how to solve it? I found the error code to retry, but I want to know what causes the sending failure? How to solve and optimize it?

Urgent,please help me.

Thanks.

  • it doesn't make sense. something is not right in the way you print it.

    could you locate the file eventually?

    The TxPoolCnt should start with a high value and as soon as you consume packets for transmissions it should decrease but then increase again when the packets get acknowledged. in any case it should not go below 2.

    please check you code or try to debug step-by-step to make sure you see reasonable values.

  • Hi,

    I added its header file and printed it out after using sl_send(), is that ok?

    I print all zeros. What's wrong with that?

  • not sure why but there is no option to reply on your latest response so I am replying on this.

    the code looks OK but all 0 doesn't make sense.

    try to go inside the sl_Send() in debug mode and understand what is wrong in your code.

    I tested on my side and it looks normal. see a capture of 20 sl_Send() rounds:

  • Hi,

    I can see the value when I dubug, but why is it all 0 in print?
    So now that you can see that these two variables have values what do you need to do?

  • i need these values during runtime for debug and not just a snapshot.

    you need to find a way to print those values during runtime, not sure why it is all 0 in your case.

    maybe you can print it inside the sl_Send() and see if it works.

  • Hi,

    Why does it have a value when I debug, but 0 when I print it? And the printing function used is also the function provided by the call routine. What's wrong with that?

  • I tried to print it inside the sl_send(), but it didn't print.When I debug, I check that it has value, but it prints out 0, and the printing function also uses the function in the routine. What's wrong with this? Is there any other way to get it

  • Hi,

    Because I 1ms will call SL_ Send() is sent once. Is it because the sending rate is too low that - 11 is returned? If you want to increase the transmission rate and bandwidth, how should you modify it?

  • Seems like any step we take for debug is not working for you (NWP logs, simple printouts, etc).

    It is really impossible to debug this way.

    What I am trying to understand is the TX pool count as reported by the NWP to understand if we are running out of buffers for some reason or not. If we run out of buffers or as a result of a bug this parameter is reported as low, then it is possible that the host driver report back the -11 error.

    But, without a stable working setup I cannot debug.

  • So can I send you the engineering code and help me see what's wrong?

  • How soon can I call sl_ send() ?

  • What is the time interval between two consecutive calls to the sl_send() function.

  • Reviewing the entire code theoretically without a way to reproduce on my side is not a good option. since in your case there are many unclear behaviors, I suggest first checking the optimization level in which your code is compiled with. can you tell what level of optimization you are using? I suggest to use no optimization at all and retest (hopefully, you will be able to see printouts).

    As for the sl_Send, there is no limitation. if you try to send a frame and there is no available buffer, you would get -11 error from the host driver itself (i.e. the frame would not even go to the NWP). You can see it in the following code:

    since you are able to print string (but not variables), maybe you can add a printout inside this function to indicate if/when you get into the conditional if statement saying you have no buffers. The if is: if(g_pCB->FlowContCB.TxPoolCnt <= FLOW_CONT_MIN + allocTxPoolPkts)

  • I don't know what level of optimization to use. Where should I check this?

    I'll send you the engineering code, and then you can see where the code is used. What's wrong? Is there anything you need to pay attention to about the use of socket or the setting of Compiler? Such as the size of the system stack and so on.

  • depending on your IDE, it should be under the compiler options.

    For CCS, see below.

    I suggest you follow my recommendations on how to debug.

  • Why does the system not lose a lot of packets when I use the mobile hotspot for connection, but when I use the router for connection and use the network cable for connection, packet loss often occurs at this time? Why?

  • When debugging, I found that the following if statement could not be entered.

  • Is the connection, sending, receiving and other functions of the TCP socket port I sent earlier standardized or problematic in code?

  • 1. Please tell me how to increase the size of TCP socket send buffer and how to get the size of send buffer?
    2. Also, where did you print the txpoolcnt? Please take a screenshot.
    3. Please check the relevant codes about TCP socket I sent before, and then tell me whether this programming is correct and whether it is caused by non-standard use? Now I use the mobile hotspot to connect. At this time, there will be several packet losses in more than ten minutes, that is, SL_ Send() returns - 11
    Please reply as soon as possible, urgent and important.

  • You do not have control on the size of the buffers. The buffers are of constant size and are placed in the chip itself (not the host application).

    If you claim that you do not enter to the "if" conditional and if this is reliable, it means you are not out of buffers so you have enough buffers in the NWP.

    Again, without being able to print anything or to fetch NWP logs, I will not be able to further assist. It is impossible to debug this way.

    It seems like something is wrong on your host application and not the setup or the NWP code.

    You also didn't reply regarding your optimization level.

  • optimization level

    If there is a problem with the host application, why do you lose a few packets occasionally? How to judge whether the packet loss is caused by network problems?

  • the optimization looks OK.

    You do not loose packets, you simply cannot transmit them so the transmission is deferred and you need to call the API again.

    your original question was for the -11 error which means "try again".

    in some networks it may happen sometimes. for example, if you push packets too fast (probably not your case) or if the other side is pushing back by lowering its window size to 0. this is how TCP works in terms of congestion and acknowledgements.

    Without looking on an air sniffer, I wouldn't be able to know if the other side is pushing back or not.

  • I have resend it in the code, and if the sending is unsuccessful, I will send it five times in a row and then exit.
    Is there an installation package and operation guide for air sniffer? Please send it to me and tell me how to operate it.

  • I cannot recommend on anything specific.

    I am using Omnipeek with a Cisco dongle but it is not free.

    Maybe there are free ones that uses wireshark as their application and a dongle as the Wi-Fi card.

  • Then I use Wireshark tool to capture the package and send it to you. Can you analyze it?

  • wireshark is only the tool, you need a right Wi-Fi dongle and capture the air.

    if you have a log, i can analyze it.

  • I have emptied the pin18 on the board, so how can I get the NWP log?

  • I have emptied the pin18 on the board, and carried out the following operations according to Chapter 20 of the document to obtain the NWP log. Check whether this is correct.

    1423.teraterm.log
    �8��8��<�<�8�8�8�<<�8��8x���<<��888��8<x�<8��8��8���<��<88��8�8�<��<�8�<�<�8���<��8�8x���8<��<���8��88<��<�8�8�8�<��8��8�88�<<��8��8��8��<<��<�<x�<x�8x�8��8�8��8<��<�<��<�8���<�8�<�8���<�<<��8��8��8��<��<8��8��8��<��<��8��<�<��<�<8<��<x�8�8��<��<��<�8x��<���8���8�8x����<��8x��������������������8<������8�����8����8x8��<��<�<�8�<8<<�<��<�8���<�8�<�8�<x�<�<<8�8��8<x�<��8��8��<�<��8�8��<��<��8��8<<��<x<<��8��88<��<��88��<��<�<�88�8x���<���8��8<��<<��8��8�8��<��8��8x8��<�8��88��8�8��8�<���8�<�8�<���8�88��<��8��8��8��8<��8��8��8��<��<��8�8��<�<<8��8x�8�8��8��8��<�<x��8���<���8�8x����<��<x��������������������88������8�����8����<x<��8��8�8�8�<888�8��8�<���8�<�8�<�<x�8�8<<�8��88x�8��<��<��8�8��<�8��8��<��<��<88��8x8�888x8��<��<��8��8��8��<��<��<��8��8��<��<��<��8��8��<��<��<��8��8��8��<��<��8��8��8��<��<��<��8��8��<��<��<��<��8��8��<��<��<��8��8��<���8<8x����88��<��<<��8��8�8x��<�8�<��8�8�8x<x�<�<88��<�<�<�88��<<��<��8��<�8�<�<x�����8x���<x��888x<��<��8��8��8��<��<��<��8��8��<��<��<��8��8��<��<��<��8��8��8��<��<��<��8��8��<��<��<��8��8��8��<��<��<��8��8��<��<��<��8��8��<��<���88�88<x��8�<8���<��<��<�����<��<���888x�<�88x��������8x����8x��<x���88<x�8�<����������8x���<x��8x�������<<<x���<�8�8������<x��<���8x��8x��888x���8��8��8x�������������<<<x��<��<�<���������<x��8x���8x���<���888x�<�88�8<��<��8x�8��<�<�<x������<x����������8�������8��������<x��<���8��8�<<<x8��8��<��<��<��8��8��8��<��<��8��8��8��<��<��<��8��8��<��<��<��<��8��8��<��<��<��8��8��<��<��<��8��8��8��<��<��8��8��8��<��<��<��8���8<<��8��8<<��<��88�<<��8��8��8��<<��<��8��8���<x�<��8��8��<�<��8�88<���8��8�8<<<��888<��<<��8��8�����<���8��8�<��<��<�8��8��88��8�<��<<��8�8��<�8���<�<�<�<���<�<8��<��<��<��8��88��<��<��<��8��8��<�8��8�8<<��<x�<�<��<��8��8�8x��8���<���<�<x����8��<x��������������������<<������<�����<����8x8��8��8�8�<�8<88�8��<�8���<�<�<�<�8x�8�<88�<��<8x�8��8��<��<�8��<�<��<��8��8��<<<��8x8�<88��8��8<<��8��88�<��8��8��8��8��<8��8��8��8��<��8�8x�<�<��8��8��8x8<��8��8<<��<�<x�<�8<��8��8x�8��<�<�<�<x��<�<���������8x�����<x����8x����88�88<��<��888��8�8�88�8x��<����8x����<����8�����8����8��<8�<<��8�8�8��8x�����<x���8�8��8�<�8x�8��8��8<��<��8�88��8��<��<��8�8x�<�<��<��8��8��8�<8�888�<�<��<��8��8��8<��<�8��8��8<x�<��8�<x���8��<<x�8��8��<��<��8��8��8<��<x<�<88�<�<��<��<��8��8<��<�<��8��8<x�<��<�<x��8��<��<��<��88��8���<8x�8<<�8�8��8<��<��<��8�<��<��<<8��8��8�8�����88�<x���88��<<<��<8x�8<��<��<�<x�<���<x��<<���<�<x���88��<<<��88x�8��<��<x��88���8�<��<<��8��8���<�8�<<8�8���<��8�8�8��8x�����8x���8�8��8�<�8<�8�8�����8��<�8���8��88��<���8�<�888�<���8�88��<�8�8��8x�����8x���<�8��8�8�8x���<8��8�88��<�<�����8��8��<��8��88<��<����88��<�<�8��8x�����8x���<�8��8�<��<��8��8�8�<�������<��<<��8�<�8��8x�����8x���8�8��8�<�8x���88��8�8<��<�8�����8��<��8��8��88<��<�<����88��8�8�8��<x�����<x���8�8��<�8��8��8��8�<�8�������8��8����88��8�8�<��<x�����8x���8�<��<�8�88�8�8�����<��8�8x���<8��8���8<��<�8�8��8��<��<�<<��8�<�<��8x�����8x���<�<��<�8�88�8�<�����<��8���<����8�88�8�8<8�<��8��<��<���88��8��<��<�88��8�8�8��8x�����<x���8�8��8�<�<<�8�8�����8��<���8�����<�<<�8�<8<�8��<��8��8���<<��<��8��8�<<��8�8�8��8x�����<x���8�8��8�<�<8�8�8�����8��<���8���8<��<x�8��88��8�<��8��8��<<��<8��8��<��<��<��8x�8�88��<��<��8�88��8�<�8��8x�����8���8�88�8�<�<888�<�8�<��<��8�8�8�8x�<��<8��8��8x�<��<<��8��8��8�8x�<�8<��<�<�<��8x�����<���<�<8�8�8�8x���<��8�8��8x�8��<<��8��8x�8��<<��8��8��8�8x�<�<<��8�8�<��<x�����8x���8�<��<�8�8���8��<�8��8x�8��8<��<���8��8<x�<��8��8��8�8x�<�<<��8�8�<��<x�����<���8�8<�<�8�8���<��<�8��8x�8��8<��<��8x�8��8<��<��8��8�8x�<�<<��<�<�<��<x�����8x���<�<��<�8�8x���<��<�<��8x�<��<<��8���<��<<x�<��8��8��8�8x�<�<<8�8<<��<��8�8�<�<����8�<8�888��<��8�8�8�8����8�<8�8<8��8��8�<�<�<����8�<8�8<<��8��8�<�<�<����8�<8�8<<��8��8�<�<�<����8�<��8��<<��<��8x��8���������<x�8�<�<x�<��<x�8x��8�<�8<�<<8�8�8��8��<��<��88��8�<��<��<8x�8��8�8x���<��88x�8��8��<��8��8��8��8<��<x<8�<�8x�<��<x�8���8��8x�����<��8�8�8<��<��88��8��<���8������8�<�<x���8���8��<��<8��88��8��<���8��888�<�<��88��8��8��<�8����<��<��8��88��8�<���<8�8<<�<x��8��<<�88��8��8��<��<<��8��8��8x8�888�<�<��<��8��8��88��<�8��8��88x�8��<�<x���8��88x�<��<��8��8��8��<��<8��8x88�<�<x�8��8x�8���<��<x�����8��8�<�<8��8��8<��<��8���8������<�8�8x���8���<��8��88��8<��<��8���8��8<<�8�8��88��<��<��8�8�8��8��<��<��88��8�<���<<�88<�<x��8��8<�<8��8��8��8��<<��8��8��8x8�<88�8�8��<��<��8��88��8�<��<��88x�8��8�8x���8��88x�8��<��8��8��8��8��<<��8x88�<�<x�<��8x�8���<��8x�����8��8�<�8<��8��88��<��<���8������8�8�<x���8���<��<��88��88��<��<���8��88<�8�8��88��8��<��<�8�8��8��<��<��<8��8�8���<<�888�8x��8��88�<<��8��8��8��8<��<��8��8x8�<<8�8�8��8��<��<��88��8�<��<��<8x�8��8�8x���<��88x�8��8��<��8��8��8��8<��<x<8�<�8x�<��<x�8���8��8x�����<��8�<�8<��<��88��<��<���8������8�<�<x���8���8��<��<8��88��8��<���8��888�<�<��88��8��8��<�8�8��8��8��8��<<��8�8���<8�888�8x��<��88�8<��<��8��8��88��<��<��8x8�8<<�8�8��8��8��<��<8��8�<��<��<<x�8��8�8x���<��<8x�8��8��<��<��8��8��88��<x<<�<�8x�8��<x�<���8��8x�����<��<�8�88��<��88��8��<���8������8�<�8x���8���8��8��<<��88��8��8���8��888�<�<��<8��8��8��8�<�<��8��8��8��8<��<�8���88�888�8x��<��88�88��<��<��8��88��8��<��<x<�88<�8�8��8��8��8��<<��8�8��8��8<x�<��8�<x���<��<8x�8��8��<��<��<��8��88��<x<<�<�8x�8��8x�<���8��<x�����8��<�8�88��8��<8��8��8���8������8�<�8x���8���8��8��<<��88��8��8���<��<88�8�8��<<��8��8��8�<�<��<��8��8��88��<�8���88�<88�8x��<��88�88��<��<��8��88��8��<��<x<�888�<�<��8��8��8��8<��<�8��8��88x�<��<�<x���8��<<x�8��8��8��<��<��8��88��8x8<�<�8x�8��8x�<���8��<x�����8��<�8�<8��8��<<��8��8���<������<�8�8x���<���8��8��8<��<8��8��8���<��<88�8�8��<<��<��8��8�8�8��<��<��8��88��8�<���88�8<<�<x��8��<8�88��8��<��<��88��8��8��<x<�888�<�<��<��8��8��88��<�8��8��88x�8��<�<x���8��8<x�<��8��8��8��<��<��88��8x88�<�8x�8��8x�8���<��<x�����8��8�<�<8��8��8<��<��8���<������<�8�8x���<���8��8��88��<<��8��8���<��<<8�8�8��8<��<��8��8�8�8��<��<��<��88��8�<���8<�88<�<x��8��<<�88��8��8��<��<8��8��8��8x8�888�<�<��<��8��8��88��<�<��<��88x�8��8�<x���8��88x�8��<��8��8��8��<��<8��8x88�<�<x�8��8x�8���<��<x�����8��8�<�<8��8��8<��<��<���8������<�8�8x���8���<��<��88��8<��<��8���8��8<<�8�8��88��<��<��8�8�8��8��<��<��88��8�8���<<�88<�<x��8��8<�<8��8��8��8��<<��8��8��8x8�<88�8�8��<��<��8��88��8�<��<��88x�8��8�8x���8��88x�8��<��<��8��8��8��<<��8x<8�<�<x�<��8x�8���<��8x�����8��8�<�8<��8��88��<��<���8������8�<�<x���8���<��<��<8��88��<��<���8��88<�8�8��88��8��<��<�8�8��8��8��<��<8��8�8���<<�888�8x��8��88�<<��8��8��8��8<��<��8��8x8

  • Please reply to me as soon as possible.

  • This capture is bad, please see my explanation on picking an alternative pin.

    with PIN_18 the mode is different than MODE_1.

    MAP_PinTypeUART(PIN_18, PIN_MODE_3);

    Also make sure you capture the log with 921600bps and in binary mode.

  • 4621.teraterm.log
    CONFIG_ADC_0 initializing success!
    BUTTON Init success!
    SL Disconnect...
    
    Device came up in Station mode
    
    [WLAN EVENT] STA Connected to the AP: TP-Link_yinrui , BSSID: 34:f7:16:5c:5a:f0
    
    
    	============================================
    
    	   CANNANO-SEMG-ARMBAND Example Ver: 0.1.0
    
    	============================================
    
    
    	 CHIP: 0x31100019
    
    	 MAC:  3.7.0.1
    
    	 PHY:  3.1.0.26
    
    	 NWP:  4.11.0.0
    
    	 ROM:  8738
    
    	 HOST: 3.0.1.71
    
    	 MAC address: 4c:24:98:d6:8b:5d
    
    
    	============================================
    
    Device disconnected from the AP on application's request 
    
    [WLAN EVENT] STA Connected to the AP: TP-Link_yinrui , BSSID: 34:f7:16:5c:5a:f0
    
    [NETAPP EVENT] IP acquired by the device
    
    
    Device has connected to TP-Link_yinrui
    
    Device IP Address is 192.168.1.4 
    
    
    Device Mac is 4c2498d68b5d 
    
    
    [GEN::INFO] profile added TP-Link_yinrui
    
    
    tcp_connect_start, start connect
    
    tcp_connect_start, connect OK,tcp_client_socket = 0
    
     Initializing I2C
    SPI initialized
    SPI_open SUCCESS
    [GEN::INFO] ADS129x_Init SUCCESS
    
    
    [GEN::INFO] Init ads129x device 0 
    
    [GEN::INFO] CONFIG1: 0X0
    
    [GEN::INFO] Init ads129x device 1 
    
    [GEN::INFO] CONFIG1: 0Xd4
    
    [GEN::INFO] ADS129X Init finshed
    
    
    [GEN::INFO] ADS1299_0 RDATAC mode open
    
    
    [GEN::INFO] ADS1299_1 RDATAC mode open
    
    
    [GEN::INFO] ADS1299_1 already to data conversion
    
    
    [GEN::TRACE] app_emg_Thread created.
    
    
    [GEN::TRACE] imuThread created.
    
    
    [GEN::INFO] emg Thread Started.
    
    
    [GEN::TRACE] emgThread created.
    
    
    [GEN::INFO] imu Thread Started.
    
    
    Pack loss = 0
    Pack loss = 0
    Pack loss = 0
    Pack loss = 0
    [line:1023, error:-1]
    
    tcp_connect_start, start connect
    
    Error [-2005] at line [940] in function [tcp_client_connect]  
    
    tcp is disconnected
    
    tcp_connect_start, start connect
    
    Error [-2005] at line [940] in function [tcp_client_connect]  
    
    tcp is disconnected
    
    tcp_connect_start, start connect
    
    Error [-2005] at line [940] in function [tcp_client_connect]  
    
    tcp is disconnected
    
    tcp_connect_start, start connect
    
    Error [-2005] at line [940] in function [tcp_client_connect]  
    
    tcp is disconnected
    
    tcp_connect_start, start connect
    
    Error [-2005] at line [940] in function [tcp_client_connect]  
    
    tcp is disconnected
    
    tcp_connect_start, start connect
    
    Error [-2005] at line [940] in function [tcp_client_connect]  
    
    tcp is disconnected
    
    tcp_connect_start, start connect
    
    Error [-2005] at line [940] in function [tcp_client_connect]  
    
    tcp is disconnected
    
    tcp_connect_start, start connect
    
    Error [-2005] at line [940] in function [tcp_client_connect]  
    
    tcp is disconnected
    
    tcp_connect_start, start connect
    
    Error [-2005] at line [940] in function [tcp_client_connect]  
    
    tcp is disconnected
    
    tcp_connect_start, start connect
    
    Error [-2005] at line [940] in function [tcp_client_connect]  
    
    tcp is disconnected
    
    

    See if this works.

  • where is the binary log?

  • The following attachment is the binary NWP log. Is this OK?

    5148.teraterm.log
    �<��<��8�8�<�<�8�88�<��<x���88��<<<��88x�<<��<��8���8��<<8��8�8�<��<�8�<�<�<���<��8�8x���<<��<���8��<<<��<�8�8�<�<��8��8�<<�88��8��<��<��<8��8�8x�8x�<x�<�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

  • IS OK?

    Please reply as soon as possible

  • No, this is still not OK.

    I explained before how to check yourself if the log is OK: "To be able to check on your side, If the NWP logs are captured successfully from cold boot, you should see some ASCII plaintext in the raw binary logs, most notably the /sys/servicepack.ucf NWP SP file. Furthermore, the 2 bytes of binary data preceding that string will be 0x27 0xCA. If you check for the string + those 2 bytes and see it in your logs, and also see that there are null characters present, then it should be captured correctly and decodable by my tools."

  • I will MAP_PinTypeUART(PIN_18, PIN_MODE_3) as described by you; Put it after SPI_init(), then set the baud rate of Tera Term to 921600, and set NWP log to binary storage, and then burn the program in. Is there a problem with this operation? Or what parts or connections are missing? The chip I use is cc3235sf chip.

  • Hi,

    Do you have connected PIN18 to UART RX?

    Jan

  • the code looks OK.

    You also need to make sure that you have a shared ground pin.