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.

MCU-PLUS-SDK-AM263X: HTTP Webserver Question

Part Number: MCU-PLUS-SDK-AM263X

Hi All,

I am struggling. a bit with the "Enet LwIP HTTP Server On Bare Metal (No-RTOS)" example inside the AM263x MCU+ SDK  08.05.00.

  1. I could successfully start the demo, the website is showing up Slight smile

The Question:

Where is this webpage and the image coming from? I found about 4 different locations in the SDK but my changes on all of them had no effects. I also can't find any included .c or .h files containing the binary data of it.

Could someone please give me a short guide on how to handle it?

Thanks a lot!

Cheers,

Chris

  • Hi Chris,

    The file you need to modify is "mcu_sdk_path/source/networking/lwip/lwip-stack/src/apps/http/fsdata.c"

    This aforementioned file has the data that will be displayed in various cases such as:

    1) data of index.html

    2) data when HTTP return status is 404

    3) Data of the sics_gif 

    @Line 172, you can find the below variable which has the data in hexadecimal format for "index.html", which can be changed to your desired data, 
    static const unsigned char FSDATA_ALIGN_PRE data__index_html[] FSDATA_ALIGN_POST = {}

    @Line 30, you can find the data for the sics gif which is displayed in index.html page
    static const unsigned char FSDATA_ALIGN_PRE data__img_sics_gif[] FSDATA_ALIGN_POST = {}
    @Line 106, you can find the data to be displayed when return status code is 404
    static const unsigned char FSDATA_ALIGN_PRE data__404_html[] FSDATA_ALIGN_POST = {}
    Steps to get the data in hex format from an HTML document:
    1) Bash command: xxd -i filename.html output_hex.h
    2) The file output_hex.h will contain the data of filename.html, in hexadecimal format.
    Hope this helps you out.
    Regards,
  • Hi Shaunak,

    Thanks a lot for your reply with the given path.

    I could approve that the data inside the fsdata.c is the binary data from the index.html, the sics.gif and the 404. As a quick test, I just changed one letter in the hex data (inside fsdata.c) and recompiled the project.

    But this did not helped, I could not see my change, after reloading the webpage (on 192.168.x.x)

    Could you point me in the source code to the include where the fsdata.c is linked in the "enet_cpsw_rawhttpserver_am263x-lp_r5fss0-0_nortos_ti-arm-clang" example?

    Thanks a lot!

    Cheers,

    Chris

  • Hi Chris,

    I locally tried changing it on my end and I could see the http:/IP_Addr/index.html file changing.

    Instead of just changing one letter, can you please change/ remove a hefty chunk of data or maybe multiple chunks of data from the binary array.

    My assumption is since the binary dump is of an HTML file, the hex character might not have been something related to the actual content of the page but some HTML tag such as <p> (paragraph tag) or a <div> tag, which will produce no significant change in the output.

    Please try removing/changing a larger chunk of data.

    Regards,

    Shaunak

  • Also just a point to be noted,

    Rebuilding a project through CCS (Code Composer Studio) will not rebuild the corresponding libraries, they will have to be manually rebuilt (lwip-stack in your case).

    The file which we are modifying belongs to the lwip-stack and thus the whole lwip-stack needs to be rebuilt and then the project needs to be rebuilt.

    Regards,

    Shaunak

  • Hi Shaunak,

    Thanks for your quick reply. It makes sense that this file is part of the stack and not of the CCS project. I think that's the reason why a change has no effect on my computer. Thats also the reason why I could not find any references to these data from the CCS project.

    Anyhow, two questions:

    1. Is there a CCS example project, where the LWIP stack is inside the CSS-Project - so a rebuild would also cause a rebuild of the LWIP stack?

    2. Is there a tutorial on how to rebuild the LWIP stack on a windows machine?

    Thanks for your answers,

    Best

    Chris

  • Hi Chris,

    1. No, any CCS project won't have the whole LwIP stack within the example, as it would buff up the example size. which would not be recommend by TI itself.
        There are some LwIP examples where some files from LwIP have been included in the examples itself. For this to be replicated, it would involve some effort to port all the required files from Stack to the Example.

    2. You can follow this guide to setup the "GMAKE" build system, then build the lwip-libraries in the SDK.
    AM263x MCU+ SDK: Using SDK with Makefiles (ti.com)
    For convenience, i will share the gmake commands you can use to build the libs and example.


    LwIP libs:
    gmake -sj -f makefile.am263x lwip-nortos_r5f.ti-arm-clang PROFILE=debug
    gmake -sj -f makefile.am263x lwip-contrib-nortos_r5f.ti-arm-clang PROFILE=debug
    gmake -sj -f makefile.am263x lwipif-cpsw-nortos_r5f.ti-arm-clang PROFILE=debug

    Other libs:

    gmake -sj -f makefile.am263x enet-cpsw_r5f.ti-arm-clang PROFILE=debug
    gmake -sj -f makefile.am263x board_r5f.ti-arm-clang PROFILE=debug
    gmake -sj -f makefile.am263x drivers_r5f.ti-arm-clang PROFILE=debug
    gmake -sj -f makefile.am263x nortos_r5f.ti-arm-clang PROFILE=debug

    Building example:

    gmake -sj -C examples/networking/lwip/enet_cpsw_rawhttpserver/am263x-cc/r5fss0-0_nortos/ti-arm-clang PROFILE=debug all