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.

CCS/AM3359: TCP/IP socket status

Part Number: AM3359

Tool/software: Code Composer Studio

Hi,

I'm using BIOS 6.72.2, NDK 3_60_00_3 and PDKam335x_1_0_15.

I can open a server connection without issue and echo data back to the client, however, if the client closes the connection how do I get the status of the connection? I tried looking at the error code for NDK_recv and it the same code regardless of data not being received or connection is closed.

Thanks in advance!

Rob

  • Hi,

    From the NDK level, you just know there is no packet received. If you want to determine if the connection is still there or not, this can be queried at PHY level. Please refer to pdk_am335x_1_0_15\packages\ti\board\src\<an AM335 board name>\device\enet_phy.c. Function int32_t ENETPHY_Tic(ENETPHY_Handle hPhyDev,uint32_t* mdioStatus).

    Regards, Eric

  • Hi,

    Been out for a couple of days. Thanks for the info I will looking to that approach. It does seem straight there is no TCP/IP connect statue or Phy status at a higher level.

     /////////////////////////

    In addition, I thought It was solved/understood, however, it is not solved. It has to do with pinging. using the BBblack example (no modifications) it will ping for hours (ping /t option), but if you stop for a few mins it will not restart or it takes awhile before it restarts. It seems like the stack goes to sleep and may wakeup or not.

    complier GNU v7.2.1, pdk 1.0.15, NDK 3.60.0.13, sys bios 6.75.2.00 target gnu.tragets.arm.A8F

    Is there some configuration that needs to be done? Wireshark show msg going out to the BBBlack but no response.

    Rob

  • Rob,

    I tried the basic example NIMU_BasicExample_evmAM335x_armExampleproject on AM335x GP EVM (sorry, we don't have any working BBB) without any change. I pinged it for a few minutes, then stopped the ping for 1 minutes and ping again. I saw the response from the EVM is immediate, so there is no ping loss. Attached is a wireshark capture, I stopped the ping at time 44, then I re-started at time 105 seconds.

    I can't reproduce your issue. ping_am335x.pcapng

    Regards, Eric 

  • Thanks!!

    It must be something with the phy chip settings or auto-negation. I'll do some tests.  I was able to get the link status and also the tcpip connection status. Link per your suggestion and connection status by low level call to SockGetTP. My next big thing is to be able to truly close the connection and then reconnect. Certainly the example are good to get on the network up, send data and they just close the app. However, seem to lack full connect, disconnect and reconnect API. I'm definitely getting more familiar with the NDK though.

    Rob