AM2434: am2434

Part Number: AM2434
Other Parts Discussed in Thread: LP-AM243, TMS320F28388D

Tool/software:

Subject: Request for a Multicore Example Using lwIP on AM2434

Dear E2E members,

I am looking for an example of how to implement a multicore communication system on the AM2434 using lwIP. Specifically, my setup involves:

  • Core R00 handling full-duplex 1Gb UDP communication.
  • Other cores receiving messages from Core R00 by IPC, processing them, and returning the output messages.
  • Core R00 forwarding the processed output messages back to its host via UDP.

If you have any relevant examples, documentation, or guidance on setting up efficient inter-core communication in this scenario, I would greatly appreciate your help.

Thank you for your time and support.

Best regards,
baruch einziger

  • Hi ,

    Thanks for your query.

    Can you please refer below example and let me know if you need further help ?

    AM64x MCU+ SDK: Intercore Ethernet Packet Exchange With ICSSG, Using LwIP Bridge

    Regards

    Ashwani


  • Subject: Assistance with lwIP UDP Stack on Core R00

    Dear Ashwani Goel,

    I am working with lp-am243 Evb. Core R00 using the lwIP UDP stack and a receive callback. My goal is to utilize 64 buffers of 2 KB each in shared memory, starting at address 0x70000000. I intend to send a pointer to the received data to another core for processing via IPC. After the message is handled, Core R00 should receive a pointer back through IPC and send the data to its host.

    I am implementing this using a callback function, but I encountered an issue when trying to create a PCB with udp_new(). The following error occurs:

    swift
    CopyEdit
    Function called without core lockASSERT: 5.115172s: /nightlybuilds/mcupsdk_internal/jenkins/mcu_plus_sdk_am243x_10_01_00_32/source/networking/lwip/lwip-port/freertos/src/sys_arch.c: sys_check_core_locking:614: 0 failed

    I am trying to resolve this issue but need your guidance. Could you help me identify the cause and suggest a solution?

    Thank you for your time and assistance.

    Best regards,
    Baruch

  • Hi Baruch,

    I have added IPC expert to the thread. Please allow some time to review and get back to you.

    Regards

    Ashwani

  • Dear

    Ashwani Goel

    ,

    I hope this message finds you well.

    I am reaching out because I am currently facing an issue with activating the UDP client along with its receiver callback routine. Despite several attempts, the setup has not functioned as expected.

    Could you kindly provide guidance or suggest resources that might help me effectively activate the UDP client and ensure the receiver callback routine is correctly operational? Your assistance would be greatly appreciated.

    Thank you very much for your time and support.

    Best regards,

    baruch

  • Hi Baruch, probably we need to "peel the onion" a bit to understand better your implementation and issue. 

    I would suggest trying below two OOB examples in your setup to get some baseline

     AM64x MCU+ SDK: Intercore Ethernet Packet Exchange With ICSSG, Using LwIP Bridge

    AM64x MCU+ SDK: IPC RPMessage 

    With respect to IPC fundamentals and debugging we have good material in AM64x academy which mostly apply to AM243x. Let me share some links 

    IPC basics: https://dev.ti.com/tirex/explore/node?a=7qm9DIS__LATEST&node=A__AUE83PRMo.8eEVGecstaxg__AM64-ACADEMY__WI1KRXP__LATEST 

    MCU+SDK examples (points back MCU+SDK user guide examples, but anyways let me share it): Getting started with MCU+ to MCU+ IPC examples 

    Debug tips (you can ignore the Linux part but get some ideas on how to debug): Debug the remote core through CCS

    thank you,

    Paula

  • Dear Paula,

    I'm currently attempting to activate the LWIP receiver callback similarly to how I've successfully done it on the TMS320F28388D. However, upon implementing this approach using a callback function on the LP-AM243, I encountered an issue when creating a PCB with udp_new(). Specifically, the following error message was triggered:

    Function called without core lockASSERT: 5.115172s:/nightlybuilds/mcupsdk_internal/jenkins/mcu_plus_sdk_am243x_10_01_00_32/source/networking/lwip/lwip-port/freertos/src/sys_arch.c:sys_check_core_locking:614: 0 failed

    My current constraint is the extremely limited memory available—just 2MB RAM shared across all cores in my initial software deployment on the LP-AM243.

    Could you please provide guidance or suggest solutions to resolve this issue?

    Thank you very much for your assistance.

    Best regards,

    Baruch

  • Hi Baruch,

    Function called without core lockASSERT:

    Did you make any changes in lwip driver code ?

    Did you build llibs successfully before example ?

    Regards

    Ashwani

  • Dear  Ashwani

    I am currently working with lwIP on the AM2434 and have encountered a few challenges.

    1. UDP Send Issue:
      After building my custom PCB, I found that udp_sendto does not work, yet no errors are reported. I am unsure what might be causing this and would appreciate any guidance on debugging this issue.
    2. lwIP Customization & Memory Optimization:
      • I am working with all cores and using lwIP without modifications for now. However, I am unsure if I need to rebuild the lwIP library.
      • I am currently investigating how to activate my receiver callback function efficiently.
      • Eventually, I need to reduce my project's size by disabling unused features like TCP, DHCP, and other functionalities that are not required. My project is currently too large for the LP-AM243 evaluation board.

    Any advice on resolving the UDP send issue and optimizing lwIP for a minimal UDP-only configuration would be greatly appreciated.

    Thank you,
    Baruch

  • Function called without core lockASSERT:

    This issue indicated you are not using locking and unlocking during LwIP APIs usage.

    C:\ti\mcu_plus_sdk_am243x_10_01_00_32\source\networking\enet\core\examples\lwip\enet_cpsw_udpclient\app_main.c

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    static void App_allocateIPAddress()
    {
    sys_lock_tcpip_core();
    for (uint32_t i = 0U; i < ENET_SYSCFG_NETIF_COUNT; i++)
    {
    dhcp_set_struct(g_pNetif[NETIF_INST_ID0 + i], &g_netifDhcp[NETIF_INST_ID0 + i]);
    const err_t err = dhcp_start(g_pNetif[NETIF_INST_ID0 + i]);
    EnetAppUtils_assert(err == ERR_OK);
    }
    sys_unlock_tcpip_core();
    return;
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards

    Ashwani

  • Subject: Request for Assistance with UDP Callback Function and IP Address Issue

    Dear Ashwani Goel,

    I hope this message finds you well.

    I am currently working on modifying this example the udp_client to use a callback function and send a message via usb_sendto. I used LOCK_TCPIP_CORE() and UNLOCK_TCPIP_CORE() around the send operation, but udp_sendto is returning an error code -4.

    Additionally, I'm encountering an issue with IP address assignment. When I use IP4_ADDR(&ipaddr, 192, 168, 1, 200) or IP4_ADDR(&ipaddr, 192, 168, 1, 4), the function returns without any error, but it doesn't seem to work. I print out the IP address, the resulting values are 0xc801a8c0 and 0x0401a8c0, respectively, which appear inconsistent like big endind.

    However, when I set the address manually using ipaddr.addr = 0xC0A801C8, it seems correct. Even then, when I attempt to send data, usb_sendto returns an error.

    Could you please advise on what might be causing these issues and suggest how I can resolve them?

    Thank you for your support.

    Best regards,
    Baruch

  • Hi Baruch,

    Can you please summarize the progress/ fix we made in call yesterday?

    It will help others to follow-up the discussion.

    Regards

    Ashwani

  • Dear Ashwani Goel,

    I am currently working on a project based on the UDP client from SDK 10.01 and encountering two distinct issues.

    Issue 1:

    Initially, I used the macro:

    IP4_ADDR(&ipaddr, 192,168,1,200);

    When checking the value of ipaddr, it returns 0xc801a8c0, and no error code is shown. However, the udp_sendto function does not transmit data to my server. I suspect that there might be corruption or misconfiguration related to the netmask.

    If I directly assign the expected IP address like this:

    ipaddr.addr = 0xC0A801C8; // 192.168.1.200

    the udp_sendto function returns an error code of -4. It appears that this IP configuration is correct for my application, but there may be an issue related to socket management—perhaps a socket not properly opened or closed within the initialization routine (app_main.c).

    Issue 2:

    Additionally, I am unable to use two PCBs simultaneously. Attempting to bind or write to the same port with a second PCB results in an error.

    Please let me know if reviewing my project files would help resolve these issues; I can send them over at your convenience. i am working with 

    Thank you for your assistance.

    Best regards,
    Baruch

  • Hi Baruch,

    Thanks for update.

    I am discussing this internally. Will get back to you in couple of days.

    Regards

    Ashwani

  •  

    Dear Ashwani Goel,

    I have conducted an additional test. When I set my IP address using:

    IP4_ADDR(&ipaddr, 192, 168, 1, 200);

    and checked its value, it correctly returned 0xc801a8c0, and no error codes were reported. However, using Wireshark with a filter set on my MAC address, I observed that udp_sendto did not send any data to the Ethernet interface.

    My code is based on the example project enet_cpsw_udpclient_am243x-lp_r5fss0-0_freertos_ti-arm-clang from SDK version mcu_plus_sdk_am243x_10_01_00_32. I suspect the issue may relate to socket initialization or usage.

    Could you please advise on how to resolve this?

    Thank you for your assistance.

    Best regards

    Baruch

  • Hi Ashwani,

    I have been working with an example based on the project enet_cpsw_udpclient_am243x-lp_r5fss0-0_freertos_ti-arm-clang from SDK version mcu_plus_sdk_am243x_10_01_00_32. While reviewing this example, I noticed that it correctly generates the IP address and successfully executes functions such as PCB creation, bind, connect, and udp_sendto without errors.

    However, in my implementation, the udp_sendto function does not transmit packets to the Ethernet interface at all. I've compared configurations, including the netif settings, but haven't identified any differences that would explain this issue. Using Wireshark, filtered by the MAC addresses of my LP-AM243 board, I confirmed no packets are sent by my implementation.

    Interestingly, a similar project using sockets operates correctly, but my current project, which relies directly on udp_sendto, is facing issues.

    I can share the full CCS project written for the LP-AM243 using CCS version 12.8.1.00005 and SDK version 10.01, if that would help you investigate further.

    I appreciate your assistance and look forward to your guidance.

    Thank you,

    Baruch

  • Interestingly, a similar project using sockets operates correctly, but my current project, which relies directly on udp_sendto, is facing issues.

    Not sure, which of your local changes causing the problem.

    Additionally, I am unable to use two PCBs simultaneously. Attempting to bind or write to the same port with a second PCB results in an error.

    To understand your issue:

    • Single PCB is working fine. Packet are going out correctly?
    • Adding 1 more PCB causing all errors?

    Regards

    Ashwani

  • Dear Ashwani Goel,

    As previously communicated, I am currently using a single PCB for both the callback and udp_sendto functions. I earlier mentioned that the error encountered with udp_sendto was due to an incorrect IP address, which I confirmed by comparing it with a functioning example. This was detailed in our meeting summary.

    Presently, I encounter no runtime errors; however, the udp_sendto function does not appear to transmit any data. This issue was confirmed using Wireshark with filters set for both possible MAC addresses. My primary concern at this stage is understanding why the PCB is not functioning as expected despite the absence of runtime errors.

    Thank you for your assistance.

    Best regards,

    Baruch

  • hi Ashwani

    there is no load gels in  ccs Version: 12.8.1.00005 

    please let me know what to do.

    thanks baruch

  • there is no load gels in  ccs Version: 12.8.1.00005 

    okay

    Can you check "LWIP_STATS" ?

    Regards

    Ashwani

  • hi Ashwani

    #define LWIP_STATS              1 

    i know how to load and activate the script.  

    that the result:

    MAIN_Cortex_R5_0_0: AM2434_ALX
    MAIN_Cortex_R5_0_0: GEL Output: CPU reset (soft reset) has been issued through GEL.
    MAIN_Cortex_R5_0_1: AM2434_ALX
    MAIN_Cortex_R5_0_1: GEL Output: CPU reset (soft reset) has been issued through GEL.
    MAIN_Cortex_R5_1_0: AM2434_ALX
    MAIN_Cortex_R5_1_0: GEL Output: CPU reset (soft reset) has been issued through GEL.
    MAIN_Cortex_R5_1_1: AM2434_ALX
    MAIN_Cortex_R5_1_1: GEL Output: CPU reset (soft reset) has been issued through GEL.
    BLAZAR_Cortex_M4F_0: GEL Output: CPU reset (soft reset) has been issued through GEL.
    MAIN_Cortex_R5_0_0: GEL Output: --->>> CPSW Gel Load In Progress... <<<---
    MAIN_Cortex_R5_0_0: GEL Output: --->>> CPSW Gel Load DONE! <<<---
    MAIN_Cortex_R5_0_0: GEL Output: STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: PORT0 STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: PORT1 STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: PORT0 STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: PORT1 STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: PORT0 STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: PORT1 STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: PORT0 STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_RXGOODFRAMES = 0x00000001
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_RXBROADCASTFRAMES = 0x00000001
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_RXOCTETS = 0x00000040
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_TXGOODFRAMES = 0x0000022D
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_TXBROADCASTFRAMES = 0x000000C3
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_TXMULTICASTFRAMES = 0x00000169
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_TXOCTETS = 0x0000B378
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_OCTETFRAMES64 = 0x000000AB
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_OCTETFRAMES65T127 = 0x00000183
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_NETOCTETS = 0x0000B3B8
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_TX_PRI_REG [0]= 0x0000022D
    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_TX_PRI_BCNT_REG [0]= 0x0000B378
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: PORT1 STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_RXGOODFRAMES = 0x0000022D
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_RXBROADCASTFRAMES = 0x000000C3
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_RXMULTICASTFRAMES = 0x00000169
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_RXOCTETS = 0x0000B378
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_TXGOODFRAMES = 0x00000001
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_TXBROADCASTFRAMES = 0x00000001
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_TXOCTETS = 0x00000040
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_OCTETFRAMES64 = 0x000000AB
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_OCTETFRAMES65T127 = 0x00000183
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_NETOCTETS = 0x0000B3B8
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_ALE_UNKN_MLT = 0x0000001B
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_ALE_UNKN_MLT_BCNT = 0x00000974
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_ALE_UNKN_BRD = 0x0000000D
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_ALE_UNKN_BRD_BCNT = 0x000003AE
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_TX_PRI_REG [0]= 0x00000001
    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_TX_PRI_BCNT_REG [0]= 0x00000040
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: PORT2 STATS
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: EST Global Config (CONTROL)
    MAIN_Cortex_R5_0_0: GEL Output: --------------------------------
    MAIN_Cortex_R5_0_0: GEL Output: CPSW_CONTROL = 0x00000000
    MAIN_Cortex_R5_0_0: GEL Output: EST_ENABLE = 0
    MAIN_Cortex_R5_0_0: GEL Output: IET_ENABLE = 0
    MAIN_Cortex_R5_0_0: GEL Output: P0_ENABLE = 0
    MAIN_Cortex_R5_0_0: GEL Output: VLAN_AWARE = 0
    MAIN_Cortex_R5_0_0: GEL Output: S_CN_SWITCH = 0
    MAIN_Cortex_R5_0_0: GEL Output: other fields are intentionally omitted
    MAIN_Cortex_R5_0_0: GEL Output:

  • MAIN_Cortex_R5_0_0: GEL Output: STAT_0_RXGOODFRAMES = 0x00000001

    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_TXGOODFRAMES = 0x00000001

    MAIN_Cortex_R5_0_0: GEL Output: STAT_0_TXGOODFRAMES = 0x0000022D

    MAIN_Cortex_R5_0_0: GEL Output: STAT_1_RXGOODFRAMES = 0x0000022D

    Packets seems to be arriving on CPSW ports. 

    But, Can you please check why Rx_port0= Tx_port1 and Rx_port1 = Tx_port1?

    Are you working on a loopback setup?

    Regards

    Ashwani

  • Dear Ashwani,

    I am not working with loopback.

    I tried to use the initialization code that originally worked with a socket, and modified it to work with a PCB using udp_sendto and a UDP callback for input. That’s all.

    Thanks,
    Baruch