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: Simple TCP-Server with LWIP and C++

Part Number: MCU-PLUS-SDK-AM263X
Other Parts Discussed in Thread: SYSCONFIG

Hi Slight smile

Could someone please give me a hint on how to handle this unresolved variable error?

I am trying to build a C++ application, based on the "Hello_world.cpp" example from the resource explorer. I now want to add the TCP functionality and program a simple server.

Therefore I am using the LWIP Stack as also used in the "enet_cpsw_tcpserver_am263x-lp_r5fss0-0_freertos_ti-arm-clang" example. I copied the sysconfig 1:1.

My c++ class can not compile because of this unresolved variable: EnetApp_driverOpen(). Anyhow this object was build in sysconfig I have a "ti_enet_open_close.o" file in my /Debug/syscgf/ folder.

My Network class looks as followed and is compiling as long as the line with "EnatApp_driverOpen" is commented out.

 
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#pragma once
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include "FreeRTOS.h"
#include "task.h"
/* lwIP core includes */
#include "lwip/opt.h"
#include "lwip/sys.h"
#include "lwip/tcpip.h"
#include "lwip/dhcp.h"
#include <networking/enet/utils/include/enet_apputils.h>
#include <networking/enet/utils/include/enet_board.h>
#include "ti_board_config.h"
#include "ti_drivers_open_close.h"
#include "ti_enet_config.h"
#include "ti_enet_open_close.h"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



I am also not sure if I have to recompile the whole Library with the CPLUSPLUS flag?

Thanks for you support!
Chris

  • Hi Chris,

    I tried to reproduce the issue locally, I'll note down the steps that need to be followed, you can check if you are missing out on some step that is causing the error:

    1. Take the out-of-box hello world example
    2. Add the app_cpswconfighandler.c and app_cpswconfighandler.h files to the project folder.
    3. Copy the example.syscfg file as you mentioned.
    4. Modify the project makefile and add app_cpswconfighandler.c in the list of files to be compiled. Add Enet and LwIP include paths, required libs in makefile (Compare it with the enet_lwip_tcpserver example's makefile
    5. Recompile the libraries with CPLUSPLUS_BUILD=yes
    6. Rebuild the example with CPLUSPLUS_BUILD=yes

    Let me know if you still face the error.

    Regards,
    Shaunak

  • Along with what TI has already suggested, ensure that the library containing EnetApp_driverOpen() is included in your project settings or build configuration. If you are using an IDE, make sure the library or object file (ti_enet_open_close.o) is added to the project or build script.

  • Hi Shaunak,

    Thanks for your support. I am still struggling, first I use Code Composer Studio on a Windows machine for developing, therefore the makefiles all will be generated.

    Anyhow I copied all the Path and libraries in the linker as it was on the TCP example:

    I could compile the libraries locally with the CPLUSPLUS_BUILD=yes flag:
    gmake -s -f makefile.am263x libs CPLUSPLUS_BUILD=yes

    (here I had to change the imports.mak file, since the path of CCS and SysConfig was not correct).

    I would like to not to link to the example app_cpswconfighandler since it would be a mess to maintain. I would more like to use the API calls used for LWIP directly out of my software.

    Anyhow, also with the C++ build libraries I still have the same issue Disappointed.

    Would you have another suggestion?

    Cheers and thanks in advance,
    Chris

     

  • Thanks for your response.
    I think that's the only thing missing here. But I don't know how I can add the .o file to Code Composer Studio. Since CCS is generating this .o file I assume it should be aware of it.

  • Hi :) 

    I just have checked the makefile generated from CCS:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    ################################################################################
    # Automatically-generated file. Do not edit!
    ################################################################################
    SHELL = cmd.exe
    CG_TOOL_ROOT := C:/ti/ccs1230/ccs/tools/compiler/ti-cgt-armllvm_2.1.3.LTS
    GEN_OPTS__FLAG :=
    GEN_CMDS__FLAG :=
    ORDERED_OBJS += \
    $(GEN_CMDS__FLAG) \
    "./syscfg/ti_dpl_config.o" \
    "./syscfg/ti_drivers_config.o" \
    "./syscfg/ti_drivers_open_close.o" \
    "./syscfg/ti_pinmux_config.o" \
    "./syscfg/ti_power_clock_config.o" \
    "./syscfg/ti_board_config.o" \
    "./syscfg/ti_board_open_close.o" \
    "./syscfg/ti_enet_config.o" \
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    thus, the ti_board_open_close.o should be linked to the project.

  • Hi Chris,

    Can you check your example.syscfg of the project in the CCS?
    I think the issue is that ENET(CPSW) hasn't been added to the project. You can compare the syscfg of the lwip tcp server example.

    Adding ENET(CPSW) and EEPROM from syscfg to your project should fix the issue.

    Let me know if you face any issues after that.

    Regards,
    Shaunak

  • Hi Shaunak,

    Thanks for the hint, I double checked, that the ENET CPSW is part of the configuration. I copied the whole file from the tcp server example.
    I am happy to share the whole sysconfig:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /**
    * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
    * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
    * @cliArgs --device "AM263x_beta" --package "ZCZ" --part "AM263x" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM263x@08.06.00"
    * @versions {"tool":"1.16.1+2960"}
    */
    /**
    * Import the modules used in this configuration.
    */
    const eeprom = scripting.addModule("/board/eeprom/eeprom", {}, false);
    const eeprom1 = eeprom.addInstance();
    const gpio = scripting.addModule("/drivers/gpio/gpio", {}, false);
    const gpio1 = gpio.addInstance();
    const gpio2 = gpio.addInstance();
    const i2c = scripting.addModule("/drivers/i2c/i2c", {}, false);
    const i2c1 = i2c.addInstance();
    const debug_log = scripting.addModule("/kernel/dpl/debug_log");
    const mpu_armv7 = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
    const mpu_armv71 = mpu_armv7.addInstance();
    const mpu_armv72 = mpu_armv7.addInstance();
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Also a look at the Debug/syscfg Folder shows that the ti_enet_open_close.o is getting compiled:

    any other suggestions?

    Thanks in advance, 

    Chris

  • Hi Chris, can you share your ti_enet_open_close.c file as well?

    Regards,
    Shaunak

  • yes, please find the ti_enet_open_close.c below. I also shared the whole CCS Project as a zip file.

    ti_enet_open_close.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    * Copyright (c) Texas Instruments Incorporated 2020
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the
    * distribution.
    *
    * Neither the name of Texas Instruments Incorporated nor the names of
    * its contributors may be used to endorse or promote products derived
    * from this software without specific prior written permission.
    *
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
    HDrive_R5.zip

    Thanks in advance!

    Chris

  • Hi Chris,

    Not able to import the project in CCS because of missing meta-data of the project.
    Can you export the project following these steps:

    1. Right click on the project in CCS project explorer window and select "export". You will get a pop-up window similar to 


    2. Select Archive file

    3. Make sure all the files are selected.

    You can follow these steps to export and share the project.

    Apart from that, just making sure, in your project properties (right click on project -> select properties), can you check if the Compiler and Linker settings do have correct paths to the libraries. Something similar to:

    Linker file search path: 

    Compiler Include options:

    Regards,
    Shaunak

  • Hi Shaunak,

    Please find the exported project attached.

    I have found an error :) I did not compiled the libraries in the "debug" profile. I use this command for it:
    gmake -s -f makefile.am263x libs CPLUSPLUS_BUILD=yes PROFILE=debug

    Now I am one step further but I am getting new error messages:

    Description Resource Path Location Type
    unresolved symbol CacheP_configForceWrThru(unsigned, first referenced in int) HDrive_R5 C/C++ Problem
    unresolved symbol CacheP_disableL1d(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<CacheP_armv7r.obj> HDrive_R5 C/C++ Problem
    unresolved symbol CacheP_disableL1p(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<CacheP_armv7r.obj> HDrive_R5 C/C++ Problem
    unresolved symbol CacheP_enableL1d(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<CacheP_armv7r.obj> HDrive_R5 C/C++ Problem
    unresolved symbol CacheP_enableL1p(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<CacheP_armv7r.obj> HDrive_R5 C/C++ Problem
    unresolved symbol CacheP_getCacheLevelInfo(unsigned, first referenced in int) HDrive_R5 C/C++ Problem
    unresolved symbol CacheP_invL1d(unsigned, first referenced in int, HDrive_R5 C/C++ Problem
    unresolved symbol CacheP_invL1p(unsigned, first referenced in int, HDrive_R5 C/C++ Problem
    unresolved symbol EnetApp_driverOpen(Enet_Type_e,, first referenced in unsigned HDrive_R5 C/C++ Problem
    unresolved symbol gCacheL1dCacheLineSize, first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<CacheP_armv7r_asm.obj> HDrive_R5 C/C++ Problem
    unresolved symbol gCacheL1pCacheLineSize, first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<CacheP_armv7r_asm.obj> HDrive_R5 C/C++ Problem
    unresolved symbol HwiP_data_abort_handler_c, first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<HwiP_armv7r_handlers_freertos_asm.obj> HDrive_R5 C/C++ Problem
    unresolved symbol HwiP_getCPSR(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<HwiP_armv7r_vim.obj> HDrive_R5 C/C++ Problem
    unresolved symbol MpuP_disableAsm(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<MpuP_armv7r.obj> HDrive_R5 C/C++ Problem
    unresolved symbol MpuP_disableBRAsm(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<MpuP_armv7r.obj> HDrive_R5 C/C++ Problem
    unresolved symbol MpuP_enableAsm(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<MpuP_armv7r.obj> HDrive_R5 C/C++ Problem
    unresolved symbol MpuP_enableBRAsm(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<MpuP_armv7r.obj> HDrive_R5 C/C++ Problem
    unresolved symbol MpuP_isEnableAsm(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<MpuP_armv7r.obj> HDrive_R5 C/C++ Problem
    unresolved symbol MpuP_setRegionAsm(unsigned, first referenced in int, HDrive_R5 C/C++ Problem
    unresolved symbol PmuP_clearOverflowStatus(unsigned, first referenced in int) HDrive_R5 C/C++ Problem
    unresolved symbol PmuP_disableCounters(unsigned, first referenced in int) HDrive_R5 C/C++ Problem
    unresolved symbol PmuP_enableCounters(unsigned, first referenced in int) HDrive_R5 C/C++ Problem
    unresolved symbol PmuP_setup(unsigned, first referenced in int) HDrive_R5 C/C++ Problem
    unresolved symbol vApplicationGetTimerTaskMemory, first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<timers.obj> HDrive_R5 C/C++ Problem
    unresolved symbol vPortRestoreTaskContext(), first referenced in C:/ti/mcu_plus_sdk_am263x_08_06_00_34/source/kernel/freertos/lib/freertos.am263x.r5f.ti-arm-clang.debug.lib<port.obj> HDrive_R5 C/C++ Problem

    Test_r5.zip

    Thanks in advance

    Chris

  • Hi Chris,

    Have you updated the linker settings (as well as the compiler settings), similar to the last 2 screenshots I had attached in my previous reply. 

    Seems like the linker is unable to find the functions and throwing Unresolved symbol error. Linker file search path and Compiler include options need to be added when including libraries in your project in CCS..

    Regards,
    Shaunak

  • Hi Shaunak,

    Thanks for the response. Yes, linker and compiler settings are similar. I also adjusted the sequence so it is exactly the same.

    In my last post I attached the whole CSS Project.

    Any other suggestions?

    Thanks,

    Chris

  • Hi Chris, 

    I'm still not able to import your project in my CCS (same meta-data issue), I will try to reproduce the issue again on my end and get back to you.

    Regards.

    Shaunak

  • Thanks for trying.

    To reproduce is very simple:

    1. Import "hello_world_cpp_am263x-lp_r5fss0-0_freertos_ti-arm-clang" example
    2. Add my Network.h class (only 1 file, see first post)
    3. on main.cpp add:
      1. #include "Network.h"
      2. and in the main:
        Network network;
        network.init();
    4. Adjust the linker settings

    Thanks in advance,

    Best Regards

    Chris

  • Hi Chris,

    I tried to reproduce; I was able to build the project successfully.

    Can you please check these 2 things on your end:

    1.Clean and rebuild the project

    2. Check if the $(MCU_PLUS_SDK) path is the same MCU_PLUS_SDK path where you build the libraries manually, as you stated above in one of the previous replies.

    Attaching my project for reference.

    1172.test.zip

    Regards,
    Shaunak

  • Hi Shaunak

    Thanks for testing. I still get the same error message also when trying to compile your project.
    Something seams to be wrong with the generation of the Libraries, here my console output:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    C:\ti\mcu_plus_sdk_am263x_08_06_00_34>gmake -s libs CPLUSPLUS_BUILD=yes PROFILE=release
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: eeprom/eeprom.c
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: eeprom/eeprom_cat24m.c
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: ethphy/ethphy.c
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: ethphy/ethphy_dp83869.c
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: ethphy/ethphy_dp83826e.c
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: flash/flash.c
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: flash/qspi/flash_nor_qspi.c
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: led/led.c
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: led/led_gpio.c
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: led/led_tpic2810.c
    Compiling: board.am263x.r5f.ti-arm-clang.release.lib: flash/sfdp/nor_spi_sfdp.c
    .
    Archiving: board.am263x.r5f.ti-arm-clang.release.lib to lib/board.am263x.r5f.ti-arm-clang.release.lib ...
    Archiving: board.am263x.r5f.ti-arm-clang.release.lib Done !!!
    .
    Compiling: drivers.am263x.r5f.ti-arm-clang.release.lib: adc/v1/adc.c
    Compiling: drivers.am263x.r5f.ti-arm-clang.release.lib: bootloader/bootloader.c
    Compiling: drivers.am263x.r5f.ti-arm-clang.release.lib: bootloader/bootloader_buf_io.c
    Compiling: drivers.am263x.r5f.ti-arm-clang.release.lib: bootloader/bootloader_can.c
    Compiling: drivers.am263x.r5f.ti-arm-clang.release.lib: bootloader/bootloader_flash.c
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    I also checked that $(MCU_PLUS_SDK) points to the same folder than I compiled the libraries. I only have the version c:\ti\mcu_plus_sdk_am263x_08_06_00_34 installed.

    I am running out of ideas Slight smile

  • I found another Issue which is related to the problem. I can not compile the whole am263x project when using gmake -s all PROFILE=debug CPLUSPLUS_BUILD=yes
    Only the libraries are building well (I thought this should be enough).
    Please find the console log below:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    C:\ti\mcu_plus_sdk_am263x_08_06_00_34>gmake -s all PROFILE=debug CPLUSPLUS_BUILD=yes
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: eeprom/eeprom.c
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: eeprom/eeprom_cat24m.c
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: ethphy/ethphy.c
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: ethphy/ethphy_dp83869.c
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: ethphy/ethphy_dp83826e.c
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: flash/flash.c
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: flash/qspi/flash_nor_qspi.c
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: led/led.c
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: led/led_gpio.c
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: led/led_tpic2810.c
    Compiling: board.am263x.r5f.ti-arm-clang.debug.lib: flash/sfdp/nor_spi_sfdp.c
    .
    Archiving: board.am263x.r5f.ti-arm-clang.debug.lib to lib/board.am263x.r5f.ti-arm-clang.debug.lib ...
    Archiving: board.am263x.r5f.ti-arm-clang.debug.lib Done !!!
    .
    Compiling: drivers.am263x.r5f.ti-arm-clang.debug.lib: adc/v1/adc.c
    Compiling: drivers.am263x.r5f.ti-arm-clang.debug.lib: bootloader/bootloader.c
    Compiling: drivers.am263x.r5f.ti-arm-clang.debug.lib: bootloader/bootloader_buf_io.c
    Compiling: drivers.am263x.r5f.ti-arm-clang.debug.lib: bootloader/bootloader_can.c
    Compiling: drivers.am263x.r5f.ti-arm-clang.debug.lib: bootloader/bootloader_flash.c
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    As seen in the Console log it also hfaces the same issue e.g. not finding the CacheP reference. Thus the issue has nothing todo with the CCS Project so far.

    Thanks for your help

    Chris

  • Hi Chris,

    I am able to reproduce the above as well, We have taken up the issue internally and are working on the fix

    Regards,
    Shaunak

  • Hi Chris,

    I have raised a bug for the team internally (jira.itg.ti.com/browse/MCUSDK-11152, for tracking purposes), the team is working towards root causing and fixing the same. I will keep you posted on the same.

    Regards,
    Shaunak

  • thanks a lot! I am looking forward for the solution Slight smile.

  • Hi Shaunak,

    The link: jira.itg.ti.com/browse/MCUSDK-11152 is not working, could you tell me about the state of the request?

    Thanks in advance Slight smile

    Chris

  • Hi Chris.

    The team is still working on a proper fix and rigorously testing it as well. The link is just for tracking purposes in the thread, It won't be accessible outside TI network.

    Once the fix is available, I'll keep you updated.

    Thanks and Best Regards,

    Shaunak