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: Can i modify function in "sockets.c", "tcpip.c" file

Part Number: LP-AM243


Dear TI support team.

I am working with: "enet_lwip_cpsw_am243x-lp_r5fss0-0_freertos_ti-arm-clang" example.

I need to modify some functions to send and receive data in file: "sockets.c", "tcpip.c" in path: "$/mcu_plus_sdk_am243x_08_01_00_36\source\networking\lwip\lwip-stack\src\ap"

Q1: Can i modify these file?? Because i try to did it but it seem nothing happened after did the change.

Even i try to delete ";' after syntax "int i;" --> "int i" in "sockets.c" file. I also can build the program without error @@.

Q2: Can I using DebugP_log() function in "sockets.c", "tcpip.c" to run debug??

If not what function help me print log in "sockets.c", "tcpip.c"? 

thanks and best regards,

  • Q1: Can i modify these file?? Because i try to did it but it seem nothing happened after did the change.

    Yes, you can modify. Please make sure you build the "libraries" again to take the change. You need to build libraries via command line option and then build application.

    AM243x MCU+ SDK: Using SDK with Makefiles (ti.com)

    Regards,

    Prasad 

  • Hello Mr Prasad,

    Can you answer me ASAP?

    C:\ti\mcu_plus_sdk_am243x_08_01_00_36                                        

          

    do i need install gmake?

  • Hello Mr Prasad,

    Thank you for your quick reply.

    I did like your suggestion link.

    GNU make file already installled. you can see this PIC below:

    GNU Make 4.1
    Built for Windows32
    Copyright (C) 1988-2014 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <gnu.org/.../gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

        

    ---------------------------------------------------------------------------------------------------------------------------------------------------------------------

    But when running library building. it have some issue like that.

    I dont know libary is built or not?

    It always notify issue,:
    C:/ti/ccs1100/ccs/utils/cygwin/mkdir -p obj/am243x/ti-arm-clang/debug/r5f/lwip-freertos
    process_begin: CreateProcess(NULL, C:/ti/ccs1100/ccs/utils/cygwin/mkdir -p obj/am243x/ti-arm-clang/debug/r5f/lwip-freertos, ...) failed.

         

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------

    So if i want to rebuild some file "sockets.c, "tcpip.c",..  in path folder: "C:\ti\mcu_plus_sdk_am243x_08_01_00_36\source\networking\lwip\lwip-stack\src\api"

    Which syntax i need to do with command prompt?

    Can you try to rebuild "sockets.c" on your computer, and capture a picture for me?

    If so i can know exactly what happen when library is build successful.

    Path folder:

    thanks and best regards,

  • Hi Duong, 

    As I can see from your build snapshot, your library is not building correctly. There is an error "system can't find specified file".

    Can you please check all the paths are configured correctly (in Windows environment variables)?

    Regards,

    Prasad

  • hi Mr Prasad,

    Today it seem i fixed issue rebuild library.

    I try to test rebuild library process successful by delete ";" from "int i;" to "int i" in "sockets.c" file .

    But i don't see any error message after rebuild becauseof missing ";" . Why is it?

    Clean library with: >gmake -s libs clean PROFILE=release

    Rebuild library with  : >gmake -s libs PROFILE=release

    Question:

    1. ordinal to rebuild is clean command-->build command or build command -->clean command?

    2. What function can use to print variable, message when i want to debug  in  *.c file example: sockets.c, tcpip.c,...

        Can i use DebugP_log() function?

    Do i rebuild library successful??

    Clean snapshoot

       

    Build snapshoot                                                                                    

    {SDK_INSTALL_PATH}>gmake -s libs PROFILE=release     |      Archiving: lwip-freertos.am243x.r5f.ti-arm-clang.release.lib Done !!!

                                                                                                                i don't see any error message after rebuild "sockets.c" becauseof missing ";" of  "int i"

                    

  • Hi Duong, 

    I tried building updated sockets.c and is able to build and use successfully in my application.

    As you can see in below snapshot, when add error in the file, compiler is catching it.

    I cleaned the app project (removed binaries etc.) and rebuild the app and I was able to see changes. 

    Can you please confirm you are editing the correct files? Also clean the application so linking of new libs happens instead of old.

    Regards,

    Prasad

  • Hi Mr Prasad,

    Now, I can rebuild library successful.

    How can i printf log or variale value when running API functions in "sockets.c", "tcpip.c"

    Which function we can use?

    Can you please guide me how to add these function?

    thanks and best regards,

  • Hello Duong,

    For adding prints, you can use any of available print function like DebugP_logPlease make sure to add prototype for the print function to avoid compiler warning. It is available in source\kernel\dpl\DebugP.h

    After that, you can use this function like below -

    DebugP_log("my log....\r\n");

    Also, note that, lwIP has debug flags per module, so they will have to enable the corresponding flag in lwipopts.h

    i.e. #define TCPIP_DEBUG LWIP_DBG_ON etc.

    Regards,

    Prasad