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.

LP-AM243: LwIP Examples - DCHP Server not assigning IP and Static IP not working? (PROC109A)

Part Number: LP-AM243

On the following hardware/software, I have been unsuccessful in getting the LP-AM243 to receive an IP address from the DHCP server.
Could I have someone confirm if the PROC109A and LwIP examples from 9_00_00_35 SDK work?

*EDIT: See my follow-up post below. DHCP / Static LwIP apps don't work with 1Gbps connections; but works with 100Mbps Full-Duplex.
Other posts on E2E seems to show no issues with earlier SDK and E3 boards; so assumption is some software changes are the cause...?

DHCP Server: TP-Link Home Router

Confirmed the router assigns IP address to connected devices.
(i.e. plugged in a BeagleBoneBlack to the router with short LAN cable (same cable used in all tests).
It was assigned an IP from the DHCP server's pool automatically; confirmed on BBB with "ifconfig eth0" command)
"ping xxx.xxx.xxx.xxx also works to talk between PC / BBB"

LP-AM243 (PROC109A(001))

  • mcu_plus_sdk_am243x_09_00_00_35 (Windows) installed to C:/ti/
  • Followed online documentation to setup the EVM (using NULL Bootloader so no launch scripts / gel in CCS)

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
Starting NULL Bootloader ...
DMSC Firmware Version 9.0.7--v09.00.07 (Kool Koala)
DMSC Firmware revision 0x9
DMSC ABI revision 3.1
INFO: Bootloader_runCpu:155: CPU r5f1-0 is initialized to 800000000 Hz !!!
INFO: Bootloader_runCpu:155: CPU r5f1-1 is initialized to 800000000 Hz !!!
INFO: Bootloader_runCpu:155: CPU m4f0-0 is initialized to 400000000 Hz !!!
INFO: Bootloader_loadSelfCpu:207: CPU r5f0-0 is initialized to 800000000 Hz !!!
INFO: Bootloader_loadSelfCpu:207: CPU r5f0-1 is initialized to 800000000 Hz !!!
INFO: Bootloader_runSelfCpu:217: All done, reseting self ...
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • In CCS, imported/built the following:
    ...<SDK>/examples/networking/lwip/enet_cpsw_tcpserver for the LP-AM243
  • Connected to R5_0_0, loaded the built binary, ran...

But the LP-AM243 was never assigned an IP address from the DHCP server.
I checked the TP-Link router settings page, but LP-AM243 was not detected/assigned IP.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2023.09.11 12:00:59 =~=~=~=~=~=~=~=~=~=~=~=
Starting NULL Bootloader ...
DMSC Firmware Version 9.0.7--v09.00.07 (Kool Koala)
DMSC Firmware revision 0x9
DMSC ABI revision 3.1
INFO: Bootloader_runCpu:155: CPU r5f1-0 is initialized to 800000000 Hz !!!
INFO: Bootloader_runCpu:155: CPU r5f1-1 is initialized to 800000000 Hz !!!
INFO: Bootloader_runCpu:155: CPU m4f0-0 is initialized to 400000000 Hz !!!
INFO: Bootloader_loadSelfCpu:207: CPU r5f0-0 is initialized to 800000000 Hz !!!
INFO: Bootloader_loadSelfCpu:207: CPU r5f0-1 is initialized to 800000000 Hz !!!
INFO: Bootloader_runSelfCpu:217: All done, reseting self ...
==========================
CPSW LWIP TCP ECHO SERVER
==========================
Enabling clocks!
EnetAppUtils_reduceCoreMacAllocation: Reduced Mac Address Allocation for CoreId:1 From 4 To 2
Mdio_open: MDIO Manual_Mode enabled
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Static IP Tests

Next, I followed some E2E posts on modifying app_main.c to change from DHCP to static IP.

  • Set BBB IP address to static (192.168.0.55)
  • Set PC IP address to static (192.168.0.27)
  • Set LP-AM243 address to static (192.168.0.10) (modified app_main.c)

BBB <---> LP-AM243
Connection works; I can ping LP-AM243 from BBB, and the "enet_cspw_tcpserver" code works.
(I used a simple python program with "socket" to send a message from BBB, and I get the TI message from LP-AM243 in response)

Fullscreen
1
2
3
4
debian@beaglebone:~/projects/networking$ python pyclient.py
Connected to Host!
Sending data...
Greetings from Texas Instruments!
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

BBB <---> PC
Connection works, I can ping the IP addresses from each other.
So I know the PC IP/Netmask/Gateway settings allow communication.

PC <---> LP-AM243
Connection doesn't work..."ping" command can't access the LP-AM243...

  • == Update ==

    Sorry for posting this so soon, but I think I see what is happening.

    • If LP-AM243 negotiates 1Gbps, the LwIP examples won't work.
    • If LP-AM243 negotiates 100Mbps (Full-Duplex), the LwIP examples work.

    Above, I described failed DHCP IP assignment / Static IP address operation at 1Gbps negotiated link.
    But it works when connected to BBB, which is a 100Mbps link.

    So I changed my PC Ethernet Adapter settings from "Auto-Negotiation" (which results in a 1Gbps link),
    to force a 100Mbps (Full-Duplex) link. (reference: Intel).

    In doing this, the LP-AM243 and PC connect via 100Mbps Full-Duplex link,
    and the LwIP examples now work without issue.

    If someone could please confirm on PROC109A hardware with most recent SDK?
    I think this needs to be rolled into future updates of the SDK...anyone using the LwIP examples with 1Gbps LAN connections are going to run into trouble.

  • Hi Keito,

    I'll look into the issue and try to reproduce it and verify for the auto IP assignment.

    For the Static IP assignment, can you share what changes did you make in app_main.c?

    Regards.

    Shaunak

  • Hi Shaunak,

    Attached the app_main.c files (only files edited) for your comparison.

    app_main.c = original code
    app_main_mod.c = modified code

    /cfs-file/__key/communityserver-discussions-components-files/908/tcpserver.zip

  • Hi Keito,

    thanks for the source files, I'll review them and get back to you.

    Regards,

    Shaunak

  • Hi Keito, 

    I had an alignment with the networking team internally, to diagnose the issue further, we would need the MAC port statistics, I am sharing the link to steps to get MAC port statistics. Based on the statistics, I can support further,

    (1) [FAQ] MCU-PLUS-SDK-AM243X: How do I get CPSW diagnostic statistics using debug gels in MCU+ SDK Enet LLD? - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    Can you please try the above and share your statistics

    Regards,
    Shaunak

  • Hi Keito, 

    I am also sharing a code snippet to allocate Static IP to the NetIFs,

    The only precautions you need to take are:

    1. Not assigning the same IP address to multiple NetIFs for obvious reasons,

    2. Making sure you don't call  App_allocateIPAddress() function

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    static void App_setupNetif()
    {
    ip4_addr_t ipaddr[2], netmask[2], gw[2];
    ip4_addr_set_zero(&gw[0]);
    ip4_addr_set_zero(&ipaddr[0]);
    ip4_addr_set_zero(&netmask[0]);
    ip4_addr_set_zero(&gw[1]);
    ip4_addr_set_zero(&ipaddr[1]);
    ip4_addr_set_zero(&netmask[1]);
    gw[0].addr = ((uint32_t)0x0100A8C0UL); // 192.168.0.1
    ipaddr[0].addr = ((uint32_t)0x0a00A8C0); // 192.168.0.10
    netmask[0].addr = ((uint32_t)0x00FFFFFF);// 255.255.255.0
    gw[1].addr = ((uint32_t)0x0100A8C0UL); // 192.168.0.1
    ipaddr[1].addr = ((uint32_t)0x0300A8C0); // 192.168.0.3
    netmask[1].addr = ((uint32_t)0x00FFFFFF);// 255.255.255.0
    DebugP_log("Starting lwIP, local interface IP is dhcp-enabled\r\n");
    hlwipIfApp = LwipifEnetApp_getHandle();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    I tested the ping functionality, and it works as expected. Do let me know if you face any issues once you try it out.
    Regards,
    Shaunak
  • Hi Shaunak,

    Thanks for the code snippet.
    With the above "Static IP" code, did you verify the ping functionality with 1Gbps connection, or 100Mbps?

  • Hi Keito,

    I verified it with 1 Gbps link

    Regards,
    Shaunak