1 Reply Latest reply on Nov 9, 2015 12:21 PM by userc_14767

    Bug with TCP connection retries with LwIP in SDK 3.3.1

    userc_14767

      Hi.

      I've been maintaining platform support for using WICED with EMW3165 and EMW3162 from MXCHIP that has a STM32F411CE and BCM43362.

      A user of this platform brought to my attention that running the snip.tcp_client app with LwIP stops working after a connection failure, while NetX_Duo works fine.

       

      A description of the issue and reproduction steps can be found here: Using LwIP can make TCP connections and/or re-transmits fail. (upstream issue) · Issue #15 · MXCHIP-EMW/WICED-for-EMW ·

       

      I'll reproduce the description here:

      This is an upstream WICED issue, but serious enough for me to want to address it here.

      Reproduction steps:
      1. Edit apps/snip/tcp_client and change the include/default_wifi_config_dct.h access point setting to fit your environment.
      1. Run ./make EMW3162-FreeRTOS-LwIP-snip.tcp_client download run
      1. Watch the serial console output.
      1. Try starting the echo server by running python27 apps/snip/tcp_client/tcp_echo_server.py
      1. Notice how the echoing doesn't start working.
      1. Reset the EMW module
      1. Notice the echo working
      1. You can at this point try killing the echo server and restarting it and see how it fails to start echoing again, but
      1. Run ./make EMW3162-snip.tcp_client download run to build ThreadX-NetX instead of FreeRTOS-Lwip and continue from step 2. See how the echoing resumes when the server becomes available.

      I reproduced this on EMW3162, but as this seems to be an upstream issue, reported on the WICED forums, this most likely applies to the EMW3165 too.

       

      I've changed the recommendations for the platforms I support for people to use ThreadX-NetX instead of FreeRTOS-LwIP until this is fixed. That is a bit of a problem, mostly due to the limited on-chip flash on the STM32F411CE and the increased image size of ThreadX-NetX vs. FreeRTOS-LwIP. There is no chance to do a debug build, as it ends up being way too big.

       

      Any chance anyone has found a proper solution for this? I've seen a few passing mentions of this issue on the forum, but none with proper repro steps or much engagement by Broadcom.

       

      Possibly related:

      BCM43340: is there an API to debug the internal state machine

      tcp packet sending returns ERR_WOULDBLOCK for lwip stack

      Here is one reporting that using the WICED API doesn't work, but using WWD and LwIP does:

      wiced_tcp_send_packet() failed and WWD questions