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.

PROCESSOR-SDK-AM64X: Compilation error

Part Number: PROCESSOR-SDK-AM64X

Hi Team,

Our customer encountered an error when he compiled the libraries and source code using the GNU compiler. According to our customer,

I have a question about compiling code for the AM64x eval board. I had compiled the libraries and source code using the GNU compiler and when I run an example app I get the following errors on the UART.

The error messages start:

EnetUdma_openRxRsvdFlow: [Enet UDMA Error] Cq ring allocation failed !!: -1
Cpsw_openInternal: failed to open default flow.

If I run the same app compiled with the TI clang compiler it works without a problem.

I was not able to find any LwIP or enet libraries compiled with the GNU compiler. Is there a makefile to build these libraries using a GNU compiler?

I want to compile with GNU for two reasons. a. We have a C++ code base and your ti-clang compiler does not support many new features. 2. our C++ code base uses exceptions and you ti-clang compile does not support exceptions.

I put some logging in the Sciclient_service() function and see that when compiling with TI-clang the following messages were sent to the DMSC before main() starts.
0x0201 TISCI_MSG_GET_DEVICE
0x0201 ditto
0x0201 ditto
0x0101 TISCI_MSG_GET_CLOCK
0x0104 TISCI_MSG_GET_NUM_CLOCK_PARENTS
0x0103 TISCI_MSG_GET_CLOCK_PARENT
0x0100 TISCI_MSG_SET_CLOCK
0x0102 TISCI_MSG_SET_CLOCK_PARENT
0x010D TISCI_MSG_QUERY_FREQ
0x010C TISCI_MSG_SET_FREQ
When compiling with the GNU comiler these messages are not sent. Does the ti-clang compiler call some special code beofre main that the GNU compiler does not?

  • Danilo,

    can you share the example which is causing the error and the version of SDK you are using. I am assuming you are using AM64xGP EVM

    Regards

    Anshu

  • Yes I am using the AM64x GP EVM with the following version of the SDK.
    mcu_plus_sdk_am64x_08_02_00_31-windows-x64-installer.exe

    I have just spotted that you have just released verion 08.03.00.18 on the 20th June 2022. Let me try with this SDK and I will try and provide an example using this new version.

  • I have created an example to demonstrate the issue.  I have put the changes in a github repro, https://github.com/mike-colls-kollmorgen/mcu_plus_sdk_am64x.git. This repro contains a copy of version 08.03.00.18 of the mcu_plus_sdk_am64x with my changes added a commits on the "lwip_with_gcc" branch.

    a. You can use the following command to clone the repro.
    git clone github.com/.../mcu_plus_sdk_am64x.git --branch lwip_with_gcc a

    b. To allow me to build the enet, lwip-stack and kwip-contrib libraries using the GCC ARM compiler.
    I have added the following files.
        source\networking\enet\makefile.cpsw.am64x.r5f.gcc-armv7
        source\networking\lwip\makefile.contrib.am64x.r5f.gcc-armv7
        source\networking\lwip\makefile.stack.am64x.r5f.gcc-armv7

    and I edited the following files.
        imports.mak
        makefile.am64x
        source\networking\lwip\lwip-config\am64x\lwipopts.h
        source\networking\lwip\lwip-port\freertos\include\arch\cc.h

    c. I also added the following two files to allow me to build the enet_lwip_cpsw example app using the GCC ARM compiler.
        examples\networking\lwip\enet_lwip_cpsw\am64x-evm\r5fss0-0_freertos\gcc-armv7\linker.cmd
        examples\networking\lwip\enet_lwip_cpsw\am64x-evm\r5fss0-0_freertos\gcc-armv7\makefile

    d. I was able to build using the following commands.
        gmake -s -f makefile.am64x enet-lwip-cpsw_r5f.gcc-armv7 PROFILE=release
        gmake -s -f makefile.am64x lwip-freertos_r5f.gcc-armv7 PROFILE=release
        gmake -s -f makefile.am64x lwip-contrib_r5f.gcc-armv7 PROFILE=release
        gmake -s -C examples/networking/lwip/enet_lwip_cpsw/am64x-evm/r5fss0-0_freertos/gcc-armv7 all PROFILE=release

    e. When I load the enet_lwip_cpsw.release.out executable onto my eval board using Code Composer and run it I get the following on the terminal.

    ==========================
    ENET LWIP App
    ==========================
    Enabling clocks!
    EnetPhy_bindDriver:1718
    EnetPhy_bindDriver:1718
    PHY 0 is alive
    PHY 3 is alive
    Starting lwIP, local interface IP is dhcp-enabled
    EnetDma_openTxCh:1061
    EnetDma_openRxCh:367
    Assertion @ Line: 388 in C:/ti/mcu_plus_sdk_am64x_08_03_00_18/source/networking/enet/utils/enet_udmautils.c: *pRxFlowHandle != NULL : failed !!!
    Cpsw_handleLinkUp:1972
    Cpsw_handleLinkUp:1972
    MAC Port 1: link up
    MAC Port 2: link up

    f. If I load the version build with the ti-arm-clang compiler the terminal output is

    ==========================
    ENET LWIP App
    ==========================
    Enabling clocks!
    EnetPhy_bindDriver:1718
    EnetPhy_bindDriver:1718
    PHY 0 is alive
    PHY 3 is alive
    Starting lwIP, local interface IP is dhcp-enabled
    Host MAC address: ac:1f:0f:85:08:01
    [LWIPIF_LWIP] Enet has been started successfully
    [LWIPIF_LWIP] NETIF INIT SUCCESS
    status_callback==UP, local interface IP is 0.0.0.0
    UDP server listening on port 5001
    Cpsw_handleLinkUp:1972
    Cpsw_handleLinkUp:1972
    MAC Port 1: link up
    MAC Port 2: link up
    link_callback==UP
    status_callback==UP, local interface IP is 192.168.86.21
    5. 42s : CPU load = 1.86 %
    10. 42s : CPU load = 1.27 %

  • Michael, apologies for the delay, I have downloaded the code and trying to recreate the issue at my end , please expect response in a day or two.

    regards

    Anshu

  • Anshu, Thank-you for looking at this. Is there anything else I can provide to help?

  •  Dear  ,

    apologies for the delay. I have downloaded your workspace and could not find your make files in the workspace?

    can you please share the below files?

    source\networking\enet\makefile.cpsw.am64x.r5f.gcc-armv7
    source\networking\lwip\makefile.contrib.am64x.r5f.gcc-armv7
    source\networking\lwip\makefile.stack.am64x.r5f.gcc-armv7

    Regards,

    S.Anil.

  • The files are in the github repro.  Are you using the "lwip_with_gcc" branch?

  • Dear ,

    Sorry for inconvience. TI will not support networking Drivers compilation through GCC compilers.

    Please look at the below link and image for more details.

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM64X/08_03_00_18/exports/docs/api_guide_am64x/RELEASE_NOTES_08_03_00_PAGE.html#autotoc_md67

    Regards,

    S.Anil.

  • Our code base uses C++17 with exceptions and your R5 clang compiler does not support this combination. Do you have any suggestions how can I evaluate your part?

  • Dear ,

    Please allow me some time to discuss the solutions with the team and get back with the most appropriate solution. 

    Regards,

    S.Anil.

  •  Dear  ,

    apologies for the delay. I checked with our experts and they confirmed it

    tiarmclang compiler does not support C++17.  For further details, please see Characteristics of Arm C++ from the tiarmclang online manual.

    Regards,

    S.Anil.

  • Hello Michael

    I followed up with the compiler team on this. 

    On the positive side I did find out support for C++ exceptions will be available in TI Arm Clang v3.x. Timeline wise this will be available towards the end of the year. If your final application requires functional safety, we do strongly recommend using TI CLANG , as not only is all of SDK testing/validation done with TI CLANG , you get the benefit of getting the compiler qualification kit

    https://www.ti.com/tool/SAFETI_CQKIT

    Can you share some more details on which features of C++17 you are using in your code base. I will route this feedback to the compiler team. 

     Meanwhile do you have any way to make progress with our existing compiler offering for your evaluation?

  • Thank you for the update. It is good to hear that a version of the TI clang compiler that supports exceptions will be available towards the end of the year.

    It is difficult to say which specific C++17 features we use as we have our current GNU compiler set to enable these features and our team are free to use the language and library features appropriate to the task.

    If I avoid using LwIP and use the GNU compiler from ARM I think I will be able to make some progress.

  • Hello Michael,
    Thanks for your reply . 

    Please continue your work with GNU ARM compilers other than the LwIP feature and we are trying to see what's the best possible solution we can provide.

    I can share this feedback to compiler team.

    Regards,

    S.Anil.