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.

SIMPLELINK-MSP432-SDK: LwIP TCP Client

Part Number: SIMPLELINK-MSP432-SDK
Other Parts Discussed in Thread: EK-TM4C129EXL, NDKTCPIP, MSP-EXP432E401Y

Hi 

I really hope someone can help point out the source of the subtle but significant issue I'm experiencing.

I am having a really fustrating time trying to get a TCP client working using static IP allocation, it just wont establish a connection to a server (I'm running both socektest and hurcules). My client app works fine if DHCP is specified and the server examples provided in simplelink_msp432e4_sdk_4_20_00_12\examples\nortos\MSP_EXP432E401Y\lwip work when either DHCP or static IP allocation is used to initialize the lwIP library, just not my client app.

I have tried the same code on the EK-TM4C129EXL which similarly runs a Cortex M4 and I experience the same issue when running a LwIP v2 port.

However, the Tivaware SDK comes with LwIP 1.4.1 and this estblishes a connection and allows messages to be sent back and forth regardless of whether DHCP or static IP allocation is used, which therefore leads me to, possibly incorrectly, believe its not my app but a configuration setting (I've ensured that LWIP_DHCP and LWIP_AUTOIP are enabled and disabled when switching between DCHP and static allocation respectivey) but at this stage I have run out of ideas. Any suggestions/ help would be gratefully recieved.

Thanks HL

2604.lwipopts.h

enet_tcpecho_client.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//*****************************************************************************
//
// enet_tcp_echo_server.c - Sample Echo Server Application using lwIP.
//
// Copyright (c) 2019-2020 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
//
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Hairy,

    There a several posts on this topic.  Have you seen this one -> SIMPLELINK TCP CLIENT EXAMPLE

  • Hi Dennis,

    Thanks, I have undertaken a trawl of the forum and agree there are a number of posts regarding TCP Client applications. Unfortunately none seem to cover my specific issue, the closest being by Utsav who has authored the post you kindly provided a link to and who has previously reported an issue with Static IP allocation. However, it appears that Utsav is using TI-RTOS and in turn NDKTCPIP; not LwIP.

    If my client application didn’t work at all I could understand it, but given it works for both DHCP and Static IP allocation in LwIP 1.4.1, but only DHCP in LwIP 2.x, with the exact same application code, it is somewhat more difficult to get my head around.

    HL

  • So I've had a development. 

    If I don’t run the code through the (IAR) debugger, but instead leave the application to boot up and run on target (albeit still a debug build), it establishes a connection when Static IP allocation is used. It seems repeatable as the same behaviour is exhibited whether I use my MSP-EXP432E401Y or EK-TM4C129EXL.

    I have been wondering if it might be a timing issue. Any suggestions as to what might be the cause of this timing descrepancy? 

  • Hi Hairy,

    It's been a couple of days so I wanted to check on your progress.  I asked around, but there doesn't seem to be anyone that has a clue on this one.

  • I've not made any further progress unfotunatley. Tho my focus has been elsewhere. It's a puzzling and concerning one which I suspect is going to take a while to get to the bottome of.

    Thanks,

    HL

  • Hi Hairy,

    As I'm looking around for other possible causes...

    If I don’t run the code through the (IAR) debugger, but instead leave the application to boot up and run on target (albeit still a debug build), it establishes a connection when Static IP allocation is used.

    From what I can piece together about IAR is, when creating a debug version of your project, some code may not be optimized.  Since this could potentially change the timing of the SW I thought this might be a clue, but you go on to say you run the target without the debugger attached, and with the debug code build, so this shoots down that theory.  This does seem to point the finger at the debugger tool itself as the potential cause.  You may want to reach out to IAR to see if they can provide any help from their side.

  • Hi Hairy,

    It's been a few days since I have heard from you so I’m assuming you were able to resolve your issue.
    I will mark this posting as RESOLVED. If this isn’t the case, please click the "This did NOT resolve my issue" button and reply to this thread with more information.
    If this thread locks, please click the "Ask a related question" button and in the new thread describe the current status of your issue and any additional details you may have to assist us in helping to solve your issues.

  • Unfortunately I’ve not got the bottom of this due to other commitments. I’m just drafting a ticket to IAR now. If i do get a resolution I'll let you know