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.

RTOS/TM4C1294NCPDT: How to access received ethernet frames

Part Number: TM4C1294NCPDT

Tool/software: TI-RTOS

Hello,

I am looking at the Ti-RTOS Ethernet tcp/ip echo example (it works 100%) and want to access the data bytes that come in (for example, to print to console.) I see that the tcpEchoIpv6.c file has some tasks that seem to be responsible for receiving/sending data but when I step through the code after pinging the controller the code never gets to them (only executing functions in the emacsnow.c file.) How can I access the data that comes in over ethernet without writing code in the emacsnow.c file?

It seems to me that this should be possible since emcasnow.c is a standard TI-RTOS library that would be used by the specific implementation (tcp/ip echo program) to receive the packets, extract data from them, and then send them back.

Thank you,

svl123

  • Hi svl123,

    "Ping" is handled in the NDK's stack, so it never gets to the application layer.

    If you want to dump out the all packets that are coming into the device, you can add code into emacsnow.c. The easiest thing is to add EMACSnow.c into your project and modify as needed.

    You can get some debug output from the NDK also ("Global Debug Configuration" in the NDK's User Guide). It will not give you packet by packet output though.

    Here we usually use wireshark on a laptop that is connect into the network via a hub (that the target is connected to also) to see all the packet data both to and from the target.

    Todd
  • Todd,

    Thank you for the clarification - I have no experience with tcp/ip and this is all very new to me.

    I am away from the board now but looking at the function EMACSnow_handleRx() in emacsnow.c, I can access the received packet directly via the "&EMACSnow_private.PBMQ_rx" pointer?

    Thank you,
    svl123
  • You can use the pvBuffer1 and ui32Count fields in the pDescList->pDescriptors[pDescList->ulRead] structure.
  • Todd,

    What do you mean by "add emacsnow to project"?

    When I insert breakpoints into this file then they trigger and I can step through the code in this file. However, when I add my own code to it the program runs as if there are no modifications to it and even if I add code that I know is wrong and should trigger errors the project compiles fine and the example works. This means that the file is not added to the project? But if it is not added then how am I able to step through it via breakpoints?

    -svl123

  • Right click on the project and select "Adding Files...". Then navigate to the EMACSnow.c file (e.g. C:\ti\tirtos_tivac_2_16_01_14\products\tidrivers_tivac_2_16_01_13\packages\ti\drivers\emac) and select the .c file.

    I'd select the "Copy files" option then (it's the default) so you don't touch the one in the product.

    Now edit away and when you rebuild, it will pick up your version before the one in the library.

    Todd
  • Hi Todd,

    I've been able to copy the file into my project and am accessing individual frames. Thank you for your help.

    -svl123