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-AM243X: Link error when using LWIP_HTTPD_CGI

Part Number: MCU-PLUS-SDK-AM243X


Tool/software:

Using: CCS Version: 20.0.2.5__1.6.2, TI Launchpad kit with Sitara AM243x MCU


I'm trying to add a CGI handler to one of the demo applications (ti/mcu_plus_sdk_am243x_10_01_00_32/source/networking/enet/core/examples/lwip/cpsw_lwip_https), I added httpd.h and httpd_opts.h headers, created and included lwipopts.h with these defines

#define LWIP_HTTPD 1
#define LWIP_HTTPD_CGI 1
#define LWIP_HTTPD_SUPPORT_POST 1

I'm calling http_set_cgi_handlers from App_setupNetworkStack function, everything compiles but it does NOT link, i get the following output:
undefined first referenced
symbol in file
--------- ----------------
http_set_cgi_handlers ./app_main
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "cpsw_lwip_https_am243x-lp_r5fss0-0_freertos_ti-arm-clang.out" not built
The ${MCU_PLUS_SDK_PATH}/source/networking/enet/lib and ${MCU_PLUS_SDK_PATH}/source/networking/lwip/lib directories are in the linker library search path.
what am I missing?
what do i need to add to the project in order to successfully build?


Thanks
  • Hi Omar Ordaz,

    Thanks for your query and having patience for long.

    I was out of office for couple of weeks. will check on this and get back to you.

    Regards

    Ashwani

  • Hi,

    • Please check if the httpd.c file is present in the make file:
      source/networking/lwip/makefile.stack_freertos.am243x.r5f.gcc-armv7 under source files
    • Do the changes as belowm in in source/networking/lwip/lwip-config/am243x/lwipopts.h
      #define LWIP_HTTPD 1
      #define LWIP_HTTPD_CGI 1
      #define LWIP_HTTPD_SUPPORT_POST 1

    • Build libs. (make -s -j4 libs)

      CCS compilation does not do lib compilation, recompile the libs (debug and release)

    • No need to do ‘I added httpd.h and httpd_opts.h headers”

    Regards

    Ashwani

  • Hi Ashwani, 

    I tried the change you suggested and I'm not getting the original error but i get a set of new errors. 

     

    /source/networking/enet/core/examples/lwip/cpsw_lwip_https/httpd.c:979:7: error: use of undeclared identifier 'http_cgi_paramcount'
    /source/networking/enet/core/examples/lwip/cpsw_lwip_https/httpd.c:981:11: error: use of undeclared identifier 'httpd_num_cgis'
    /source/networking/enet/core/examples/lwip/cpsw_lwip_https/httpd.c:981:29: error: use of undeclared identifier 'httpd_cgis'
    /source/networking/enet/core/examples/lwip/cpsw_lwip_https/httpd.c:982:25: error: use of undeclared identifier 'httpd_num_cgis'

     
    and a few more 

    looking at httpd.c (where http_cgi_paramcount is defined) I saw the definition is isnide an "#if LWIP_HTTPD_CGI" block, so it should be compiled and included in the new library, but I still get those errors.

     

    if i revert the changes to lwipopts.h I get back to my original error. 

     

    Any idea of what am I missing?

  • Hi Omar,

    I raised the issue with dev team.

    Will keep you posted as I get any update here.

    Regards

    Ashwani