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.

RTOS/TM4C1294NCPDT: How do you LINK to the NDK?

Part Number: TM4C1294NCPDT

Tool/software: TI-RTOS

Hello.

I am trying to build a simple, entry level, program using the NDK on the TM4C1294XL Launchpad.    CCS 6.2, NDK 2 25 1 11

I'm NOT using XGCONF because 1) I've tried it out on the NDK,  2) It doesn't have the the server I want built in 3) I need to learn to use the NDK without it because: 4) when I use an example, it works, when I try to modify it, I still get the same linker problems I am describing below.

I have spent 5 days trying to solve this.  I have read through the NdkApiUserGuide (spru523j) from end to end.

So far, I am just trying to call the initial function "NC_SystemOpen", and it has been a nightmare.

Given this simple call inside one simple SYS/BIOS task:

Void taskFxn(UArg a0, UArg a1) {
    System_printf("enter taskFxn()\n");

    int result;
    HANDLE hCfg;
    result = NC_SystemOpen(NC_PRIORITY_LOW, NC_OPMODE_INTERRUPT);
NC_SystemClose(); System_printf("exit taskFxn()\n");
}

Naturally I get an undefined symbol. (What others call an unresolved external), which I would expect if I don't link to the lib. The NDK reference document DOES NOT tell me what lib to link to.  But the User guide does give some hints.

I added "netctrl.aem4" to the linker, and went to 61 undefined symbols. ( NIMUInit, _llSerialInit , httpOpen, etc...)  I start digging, and adding more libs to try to handle these.  Adding os and os_sem drops it to 49 undefined symbols.  I add nettool, and it goes up to 51.  I add stk6 and I'm down to 11 undefined symbols.  In the end, it just seems like you have to "dog pile" every lib in the linker to get it to resolve.

What's left are "low-level serial" functions, and "low level timer" functions, listed below. Where are they?  What libs do I link to for them?  "Timer" support is already added via XGCONF, so these function have to come from somewhere else.  And I also have no idea where the low-level serial stuff will come from.

Also, there is an undefined "NIMUDeviceTable" which is not defined anywhere in the NDK API ref guide or the User Guide. It appears to have something to do with the NSP, which half the NDK doc tells you must be installed, and half the forums tell you are not needed.

 undefined             first referenced                                                           
  symbol                   in file                                                                
 ---------             ----------------                                                           
 NIMUDeviceTable       C:/ti/ndk_2_25_01_11/packages/ti/ndk/stack/lib/stk6.aem4<nimu.oem4>        
 _llSerialInit         C:/ti/ndk_2_25_01_11/packages/ti/ndk/netctrl/lib/netctrl.aem4<netctrl.oem4>
 _llSerialServiceCheck C:/ti/ndk_2_25_01_11/packages/ti/ndk/netctrl/lib/netctrl.aem4<netctrl.oem4>
 _llSerialShutdown     C:/ti/ndk_2_25_01_11/packages/ti/ndk/netctrl/lib/netctrl.aem4<netctrl.oem4>
 _llTimerInit          C:/ti/ndk_2_25_01_11/packages/ti/ndk/netctrl/lib/netctrl.aem4<netctrl.oem4>
 _llTimerShutdown      C:/ti/ndk_2_25_01_11/packages/ti/ndk/netctrl/lib/netctrl.aem4<netctrl.oem4>
 _llUserLedInit        C:/ti/ndk_2_25_01_11/packages/ti/ndk/netctrl/lib/netctrl.aem4<netctrl.oem4>
 _llUserLedShutdown    C:/ti/ndk_2_25_01_11/packages/ti/ndk/netctrl/lib/netctrl.aem4<netctrl.oem4>
 llSerialService       C:/ti/ndk_2_25_01_11/packages/ti/ndk/netctrl/lib/netctrl.aem4<netctrl.oem4>
 llTimerGetStartTime   C:/ti/ndk_2_25_01_11/packages/ti/ndk/os/lib/os.aem4<ossys.oem4>            
 llTimerGetTime        C:/ti/ndk_2_25_01_11/packages/ti/ndk/os/lib/os.aem4<ossys.oem4>  

P.S.  I also tried to rebuild the NDK based on the Wiki.  However it failed, so I am using the original libs as they were compiled in the package.

I can post the entire project if someone would like to review it.  However, this is such an entry level basic question, someone with some experience should be able to tell me what libs to link to.

Thanks.

-CSW



    NC_SystemClose();    System_printf("exit taskFxn()\n");

  • Which version of TI-RTOS are you using? If you are using 2.16.xx, you need to supply the NIMUDeviceTable variable. We have it in the EK_TM4C129EXL.c file in our networking examples.

    Regarding the other functions, when you use XGConf, the necessary libraries are automatically picked up. You can build one of the canned examples (e.g. TCP Echo or TCP Echo ipv6) and look in the generated linker.cmd file in debug/configPkg. You can see the NDK libraries that you'll need to add. Note: there might be more than you need, but it does not hurt to have them.

    Todd
  • Todd,

    Thanks for the reply.

    I guess TI-RTOS isn't SYS/BIOS?   Everyday I get more confused....

    I am using bios_6_46_02_47, and it creates tasks.  I started with a raw "Task" demo, and gutted it to add the NDK code (inside the task).

    It has nothing selected under RTSC for TI-RTOS.  

    I selected 2.16.1.14  (my only choice), and added it to my little demo

    Adding that TI-RTOS to the build made no difference.

    I pulled in a simple networking program.  It uses BOTH SYS/BIOS and TI-RTOS.

    I found the linker.cmd buried way under the debug folder.  It is using all packages from

    C:\ti\tirtos_tivac_2_16_01_14\products\ndk_2_25_00_09\packages\ti\ndk.  

    NOT the NDK package at the root level of C:\ti\ndk...  Odd...?

    I migrated anything that was in a folder "ndk", both libs and paths, over to my small demo. There were 12 of them.  That reduced it to the NIMUDevice Table.  I did a search and found 128 different files that are EK_TM4C129EXL.c.  Each with the same date/time and same rough size.  I found one of the files that was in a NDK sample.  

    I copied over the table, then discovered the need to add two new headers.

    Then it gives me a "Hwi_Handle" is undefined.  I would expect it to be in "hwi.h" in an "m4" directory.  But apparently, you don't use one for "m4" devices, you use the same "m3" folder of the header file.

    Now, it can't find "EMACSnow_NIMUInit" when it links.  The "EMACSnow.h" just says: "This function is needed in the NIMUDeviceTable."

    The problem is that the UI XGCONF is adding "some" libs, which I don't know what they are.  The demo project that works has something like 22.  My sample I am trying to link has 6.

    I am trying to sort out which are tossed in by the config script, which are ones I will have to add.

    I have now totally confused myself and I can't figure out how to link this stuff:  
    My imported networking project uses BOTH SYS/BIOS and TI-RTOS for TIVA-C.  BUT!  There is yet another SYS/BIOS inside the TIVA-C folder.  And the linker.cmd lists *all* libraries as coming from "C:\ti\tirtos_tivac_2_16_01_14\products\bios_6_45_02_31\packages\ti"
    My simple DEMO project uses SYS/BIOS, and I added the TI_RTOS. but that does nothing.  And it gets *ALL* it's SYS/BIOS packages from C:\ti\bios_6_46_02_47\packages   I can't just randomly mix them.  So now some are configuration script based, some are not, coming from all different locations.

    This system has succeeded in making a 30+ year developer feel like an idiot...

    -CSW

  • I systematically and meticulously made the 24 libs in the functional Ethernet example match the libs in my small demo. All by using the linker cmd file, and adjusting paths.

    I also copied over the EK_TM4C1294VL file because it had a bunch more functions that were mushrooming up as unresolved in my project.

    The result is now I have 21 more unresolved. Every one of them begins with "EMAC..." And every one of them comes from EMACSnow.oem4f. I would assume they are related to the NSP, based on what I read. But there are postings which say you don't use the NSP anymore.

    Somehow, the example Ethernet demo resolves these functions. But there is nothing to clue me in on how to get my demo to do that, since I am trying to accomplish it without the XGCONF tool.

    As I said, I've been through the user guide end to end, and it makes sense. You just can't link to it.
  • Todd,
    I see (from several years ago, on a now closed thread) you have also solved these problems for ARM Cortex A8. I've got worse problems than what I've written here trying to do the BBB. (Add the NDK, get 225 undefined symbols in the linker)

    Can you point me to anyone? I've got authorization to contract someone to train. But I can't even get a name.
    MindShare is scheduled to come in, but by their own admission, they are not up on the NDK.
    -CSW
  • Hi Christopher,

    SYS/BIOS is a stand-alone product, but really is just a kernel. Several years ago, we started offering the TI-RTOS product. It bundled several different products together. TI-RTOS for TivaC includes: SYS/BIOS kernel, NDK, UIA and RTOS-aware drivers (e.g. UART, SPI, etc). These drivers are built on top of the low level TivaWare driverlib. We have TI-RTOS products for other MCU devices also (MSP430, MSP432, CC13xx, etc.). Going forward, the TI-RTOS product for several of these MCU devices is being replaced by SimpleLink SDK. For example SimpleLink CC32xx SDK, SimpleLink MSP432 SDK, etc. These SimpleLink SDKs also have support for FreeRTOS and no-RTOS. Hopefully that clears up the products.

    For you, I highly recommend you us TI-RTOS for TivaC instead of grabbing SYS/BIOS and NDK. With TI-RTOS, we deliver the EMAC driver along with examples for networking.

    Can you confirm you can build (and run) the TCP Echo (IPv4 or IPv6.) example in TI-RTOS? In the meantime, I'll get the steps together to show how to convert this example to not use the .cfg to configure the networking parts.

    Todd
  • Hi Todd,

    Yes, I can run the TCP Echo fine.  It DHCP'd and I could ping it with my PC.  I can also run HttpGet, and just about any other example without any problem.  It's building my own that is difficult.  (Also, simply taking an existing, working, example then "Add the HTTP service module" generates 6 unresolved linker errors...  so modifying an existing example doesn't solve my issues either)

    I am comparing two example projects that work:  HttpGet and tcpEcho to my test program that doesn't link.  (They use GCC, my test project uses TI... I am also trying to make a test project with the GCC compiler... a different kind of problem there)

    I notice that, using XGCONF, neither the HTTPGet nor the EchoTCP have the "DHCP Client" selected in the UI for the CFG file.  But both samples manage to get IP addresses from my DHCP service.  How is that happening?

    I also notice the linker.cmd file for the HttpGet project is adding "ns_1_11_00_10\packages\ti\net\lib\network_ndk.am4fg" and "ns_1_11_00_10/packages\ti\net\http\lib\http_ndk.am4fg"  

    How did it decide to add those?    I can see on the right side (Outline) that "Http" is listed for the HttpGet, however I can find no way to add it to the other project.  In other words, the sample just "contains" it, but the CCS doesn't give you anyway to add it to a project.  Also, I thought the NSP was not needed anymore?  I see Wiki statements claiming that.  However there is an NSP package inside my TIRTOS-TIVAC, as well as one at the root of C:\TI.  They are nowhere near the same.

    Returning to the original topic:
    After adding the NIMUDeviceTable to my "main.c" it generated more linker errors.  Missing EMACAddrSet, EMACConfigGet,.. SysCtlPeripheralEnable, etc...  21 of them to be exact. So I decided to just copy an entire "EK_TM4C1294XL.c" file into my project, since that is where it's from.  No change.  I also added the "network_ndk" library to the build.  No change.  (Again, network_ndk is present in the HttpGet example, but not in the TcpEcho example ...?)

    To summarize.  I attempted to match the libs used in EchoTcp and HttpGet linker script to my project.  But my projects still has missing symbols at the linker stage:

    Here are the libs which are in the linker script, generated by the CFG for my project:

    -l"C:\Source\Embeded\TI\NetworkSamples\Debug\configPkg\package\cfg\app_pem4f.oem4f"
    -l"C:\Source\Embeded\TI\NetworkSamples\src\sysbios\sysbios.aem4f"
    -l"C:\ti\tirtos_tivac_2_16_01_14\products\bios_6_45_02_31\packages\ti\catalog\arm\cortexm4\tiva\ce\lib\Boot.aem4f"
    -l"C:\ti\tirtos_tivac_2_16_01_14\products\bios_6_45_02_31\packages\ti\targets\arm\rtsarm\lib\ti.targets.arm.rtsarm.aem4f"
    -l"C:\ti\tirtos_tivac_2_16_01_14\products\bios_6_45_02_31\packages\ti\targets\arm\rtsarm\lib\boot.aem4f"
    -l"C:\ti\tirtos_tivac_2_16_01_14\products\bios_6_45_02_31\packages\ti\targets\arm\rtsarm\lib\auto_init.aem4f"

    Here are the libs I am manually adding to the project configuration  (With correct paths such as "${COM_TI_RTSC_TIRTOSTIVAC__NDK}/packages..." and "${COM_TI_RTSC_TIRTOSTIVAC__TIDRIVERS_TIVAC}/packages... ")   :

    "libc.a"
    "hal_timer_bios.aem4f"
    "os.aem4f"
    "hal_userled_stub.aem4f"
    "hal_eth_stub.aem4f"
    "cgi.aem4f"
    "hdlc.aem4f"
    "console_min_ipv4.aem4f"
    "netctrl_min_ipv4.aem4f"
    "nettool_ipv4.aem4f"
    "hal_ser_stub.aem4f"
    "servers_min_ipv4.aem4f"
    "stk.aem4f"
    "drivers_tivaware.aem4f"
    "drivers_wifi_tivaware.aem4f"
    "ti.mw.fatfs.aem4f"
    "tirtosport.aem4f"
    "network_ndk.aem4f"

    This list of missing symbols is:

    undefined                  first referenced                                                                                                                
      symbol                        in file                                                                                                                     
     ---------                  ----------------                                                                                                                
     EMACAddrSet                C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACConfigGet              C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACConfigSet              C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACFrameFilterSet         C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACInit                   C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACIntClear               C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACIntDisable             C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACIntEnable              C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACIntStatus              C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACPHYConfigSet           C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACPHYRead                C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACPHYWrite               C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACRxDMADescriptorListSet C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACRxEnable               C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACTxDMADescriptorListSet C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACTxDMAPollDemand        C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMACTxEnable               C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     EMAC_config                C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     SysCtlPeripheralEnable     C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     SysCtlPeripheralReady      C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
     SysCtlPeripheralReset      C:/ti/tirtos_tivac_2_16_01_14/products/tidrivers_tivac_2_16_01_13/packages/ti/drivers/lib/drivers_tivaware.aem4f<EMACSnow.oem4f>
    

    I am also getting an error:  

     program will not fit into available memory.  run placement with alignment fails for section ".bss"

    But that is something I will worry about AFTER I get these linker problems understood.

    As you should be able to surmise, I'm digging hard into this.  But not making progress.  Any assistance is appreciated, and any referral for real training would be nice too.

    -CSW

  • Hi Christopher,

    Can we take a step back?

    Christopher Weber said:
    I'm NOT using XGCONF because 1) I've tried it out on the NDK,  2) It doesn't have the the server I want built in 3) I need to learn to use the NDK without it because: 4) when I use an example, it works, when I try to modify it, I still get the same linker problems I am describing below.

    Can you provide some more detail on this? What new functionality exactly are you trying to add (but can't).

    Christopher Weber said:

    So far, I am just trying to call the initial function "NC_SystemOpen", and it has been a nightmare.

    As you've discovered, this can be trickier than expected. I can help you with defining your own version of the NDK stack thread, but first I'd like to understand more on the above.

    Steve

  • Christopher Weber said:
    I am comparing two example projects that work:  HttpGet and tcpEcho to my test program that doesn't link.  (They use GCC, my test project uses TI... I am also trying to make a test project with the GCC compiler... a different kind of problem there)

    There should also be versions of these examples that build using the TI tools. Were you not able to find them?

    I'd recommend importing those ones, since your project is using TI tools. Having GCC vs TI tools is just another variation that will add to the confusion at this point.

    Steve

  • Hi Steve.

    My primary goal is to be able to build projects and link without relying on the XGCONF tool because 75% of the time, it doesn't work. It gives me an error.

    Sorry, I'm having problems creating this editor. An unexpected exception was thrown.
    org.eclipse.rtsc.xdctools.INVALID_CODEGEN_LOCATION: Invalid codegen location 

    Answers like "known issue" and "upgrade to such and such" isn't a good solution, when the longer term goal is to get up to speed on an existing project.

    That aside, I can't successfully modify an example, without resulting in compiler or linker errors.  As an example:

    Import the TM4C1294XL example HttpGet.  Build it, load it, debug it.  See that it connects to "www.example.com"  No problem, except I don't want a client. I want a server.  If the stars are in alignment, and I have a good tail wind, I can get the XGCONF GUI up, so I "Add the "HTTP server module to my configuration".  Add an instance "http0". Then try to build.

    In function `httpClientProcess':
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpclie.c:331: undefined reference to `efs_filecheck'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpclie.c:352: undefined reference to `efs_loadfunction'
    C:\ti\tirtos_tivac_2_16_01_14\products\ndk_2_25_00_09\packages\ti\ndk\nettools\lib\nettool_ipv4.am4fg(httpsend.om4fg): In function `httpSendFullResponse':
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:268: undefined reference to `efs_fopen'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:282: undefined reference to `efs_getfilesize'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:287: undefined reference to `efs_filesend'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:291: undefined reference to `efs_fclose'

    Well, first of all "httpClientProcess" and "httpSendFullResponse" isn't one of my modules, it appears to belong to nettool_ipv4.am4fg.  So the lib is looking for something that should be provided.

    These efs_xxxx functions I know nothing about. And the NDK User Guide doesn't give any information about them.  But the NDK Ref Guide does say: 

    2.6:   The next section of this document discusses the support for stream IO that is built into the stack library.
    The support documented in that section is intended to augment the basic functions provided by the native
    operating system (in the case where the stack is ported to a new environment).

    Which seems to indicate that these functions are "built into the stack library".  Or at lease "basic functions provided by the native OS".  Well, if they are, I can't find the library to resolve them.

    I can see value in having (or overriding) file system based functions, however I don't need that here.  My initial "teach myself" is to port my existing Windows/Linux HTTP server over and have it react to REST and state machine conditions that my system uses now.  (My existing software which uses Windows and Linux, and we would like to migrate it to an embedded environment, plus I am tapped to be a person to support an existing project).

    So, in summary,  I can't successfully enhance an existing example, nor can I link the NDK into a project "made from scratch".

    And being  "old school" I'd rather be managing my projects with make files or IDE project files, rather than using GUI to activate predefined packages that I don't have control over.

    I hope this understand more of 1) what I am trying to accomplish and 2) the difficulties I am encountering

    -CSW

  • Steve,
    Also, the NDK Ref Guide (SPRU524) says:
    This API is unrelated to the stream API provided for Sockets. If the services that need this
    API are not required, then this module can be discarded from the OS abstraction. Currently,
    only the HTTP Server service uses this API.

    Well, I don't need it. But it doesn't say *how* to discard it.
    Nor does it clue me in to which of the 2540 header files has the required definition of EFS_FILE *

    Any idea which header file, to save me hours of searching each one?

    -CSW

  • OK, it seems that the issues you're seeing are due to some problems with the XGCONF tool.  This tool is optional - it's just a means to modify your configuration graphically.  You don't need to use the XGCONF tool, you can just modify your *.cfg configuration file directly, it's written using JavaScript.

    Given the problems you're encountering, I would recommend that you try this approach because the underlying tools will link in the NDK libraries you need for you.

    Now, before we go further, I want to inform you that the NDK only has support for HTTP 1.0.  Just want to make sure this isn't an issue for you.

    Christopher Weber said:
    Import the TM4C1294XL example HttpGet.  Build it, load it, debug it.  See that it connects to "www.example.com"  No problem, except I don't want a client. I want a server.  If the stars are in alignment, and I have a good tail wind, I can get the XGCONF GUI up, so I "Add the "HTTP server module to my configuration".  Add an instance "http0". Then try to build.

    I think you should avoid the HttpGet example. As you discovered, this is just for an HTTP Client. This example won't help you.

    Better to stick with the tcpEcho example and go from there.

    Christopher Weber said:
    So, in summary,  I can't successfully enhance an existing example, nor can I link the NDK into a project "made from scratch"

    OK, I think we can try something basic to get past this.  Please make sure that you have closed the XGCONF tool entirely (it has several windows that it opens up in CCS).  Also, please be sure that you're only opening your *.cfg file in your favorite text editor.

    Adding an HTTP server to an NDK app is pretty straight forward in the code of the *.cfg file.  It will take a little more work to get a web page up but I can point you to an example of that in a minute.

    As a basic first step, can you try adding an HTTP server to the (working) tcpEcho example you have?

    This can be done by editing the tcpEcho.cfg file and adding the following code.  You can just drag/drop the tcpEcho.cfg file from the CCS project view and into your favorite editor.

    Once you have that open, just add the following.  You can add it to the end of the file:

    var Http = xdc.useModule('ti.ndk.config.Http');
    var http0Params = new Http.Params();
    var http0 = Http.create(http0Params);

    Can you try that and then build the tcpEcho app to make sure it still builds?

    Steve

  • Here's a link to an example of how to build an HTTP server into a TIRTOS application.

    If you were able to add the HTTP configuration code and rebuild the tcpEcho app, as described in my previous post, then I think you should be able to go this route.

    Note that these steps have a zip file that contains the "end solution" project that will be useful for you.  The most useful part is that it has the *.cfg file that will tell you the configuration code needed for the HTTP server and related settings. (Since the instructions in the instruction slides are all XGCONF based, you'll want to ignore those steps and just refer to the code of the *.cfg file).

    There is also documentation on the NDK configuration settings (i.e. the JavaScript configuration code for the NDK that you can set in the *.cfg file) and so I wanted to point you to that.

    It's in the NDK under the docs folder, for example it's here on my machine:

    C:\ti\tirtos_tivac_2_16_01_14\products\ndk_2_25_00_09\docs\cdoc\index.html

    This file will give you info on each of the modules that you can configure for the NDK.

    For example, you can see info on configuring the HTTP server:

    Steve

  • Steve,

    Version 1 isn't a problem for me at this point. Ideally, I want to port my own HTTP server into the MCU, because it doesn't some custom things in it's states and REST architecture.  But I'm trying to just crawl at this point, before I even try walking.

    Now, in response the first reply, I opened the TcpEcho project, closed all others, opened the cfg file as text, ran to the bottom, and added those three lines.

    The results are the same as when I tried to use the GUI to add the HTTP server to the HttpGet project. Linker is missing functions.

    makefile:150: recipe for target 'tcpEcho_EK_TM4C1294XL_GNU_TivaTM4C1294NCPDT.out' failed
    C:\ti\tirtos_tivac_2_16_01_14\products\ndk_2_25_00_09\packages\ti\ndk\nettools\lib\nettool_ipv4.am4fg(httpclie.om4fg): In function `httpClientProcess':
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpclie.c:331: undefined reference to `efs_filecheck'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpclie.c:352: undefined reference to `efs_loadfunction'
    C:\ti\tirtos_tivac_2_16_01_14\products\ndk_2_25_00_09\packages\ti\ndk\nettools\lib\nettool_ipv4.am4fg(httpsend.om4fg): In function `httpSendFullResponse':
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:268: undefined reference to `efs_fopen'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:282: undefined reference to `efs_getfilesize'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:287: undefined reference to `efs_filesend'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:291: undefined reference to `efs_fclose'

    These appear to be functions that the NDK doc says is already present, but they are not working.

    A couple things concern me about manually editing the config file:

    1. How does anyone know what those are?  I'm guessing there are hundreds of packages like ti.ndk.config.Http, and they all have various settings I can see in the cfg file associated with each package  (System.abortFxn for "System"  Semaphore.supportsEvents for "Semaphores", BIOS.runtimeCreatesEnabled or BIOS.libType... ).  Where, if anyplace, are these defined so someone knows what all the possible instance variables are. Is the GUI the only thing that knows?
    2. And what prevents the config file from being over written if the GUI is opened and saved?  If I have a setting  (System.WhateverValue = 12 ) and the GUI doesn't know what it is  (because it's possible that the GUI version can be not as up to date as the packages...?) How do I know whatever I put in the CFG file manually will survive?

    However, not withstanding these concerns, I'll grab the example you pointed me to, and see if I can make it work.

    -CSW

  • Steve,

    In reply to the sample project, httpServer.zip, I followed the steps in the PPT, didn't even use the zip of the project.  It worked fine.  And are the same steps I've been performing on the other project.  Which has me even more confused.

    WHY??

    ... Can I follow the example using an empty project, and do all the steps up to page 21 and it builds fine.

    BUT

    ... When I create the TcpEcho, and follow the exact same steps to add the HTTP server, I gets these on the linker:

    C:\ti\tirtos_tivac_2_16_01_14\products\ndk_2_25_00_09\packages\ti\ndk\nettools\lib\nettool_ipv4.am4fg(httpclie.om4fg): In function `httpClientProcess':
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpclie.c:331: undefined reference to `efs_filecheck'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpclie.c:352: undefined reference to `efs_loadfunction'
    C:\ti\tirtos_tivac_2_16_01_14\products\ndk_2_25_00_09\packages\ti\ndk\nettools\lib\nettool_ipv4.am4fg(httpsend.om4fg): In function `httpSendFullResponse':
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:268: undefined reference to `efs_fopen'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:282: undefined reference to `efs_getfilesize'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:287: undefined reference to `efs_filesend'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:291: undefined reference to `efs_fclose'

    This is where I'm having the train wreck.  Two projects as bare shells, should be identical when I use XGCONF to add packages, but one doesn't link.

    Any idea?

    (I see you answered my other question about the doc for the JS packages - Thanks)

    -CSW

  • Can you please create a zip file for each of these projects (separate zips for each, please) and attach?  Please make sure that they are built (or partially built in the case of the updated tcpEcho).

    I'd like to compare some settings as well as generated files from the build to see if anything stands out.

    Steve

  • Christopher Weber said:
    And what prevents the config file from being over written if the GUI is opened and saved?  ... How do I know whatever I put in the CFG file manually will survive?

    Nothing prevents this.  However, if you've saved all changes made in the text editor, and then open the config in the GUI, then all of those changes would be present in the GUI view.

    I'd only expect you to run into issues if you're trying to edit in both the GUI and the text editor simultaneously.

    Christopher Weber said:
    If I have a setting  (System.WhateverValue = 12 ) and the GUI doesn't know what it is  (because it's possible that the GUI version can be not as up to date as the packages...?)

    If you had the setting System.WhateverValue = 12, and the 'System' module did not have a field "WhateverValue" then you would get an error when building your project when you open the XGCONF view (the GUI performs a validation of your *.cfg file when opening).

    That validation that's run is the same thing as when your app is built. It will use your project settings to find the same "System" module as when you build the app.  The GUI won't find a different "System" module than what your project is set to use.

    Now, if you knew that the System module was going to have a new element named "WhateverValue", and updated your script to set it to 12, then you would need to update your app's dependency (XDC tools in this case) to the newer version that has "WhateverValue" and then rebuild.

    Steve

  • Steve,

    "HttpServer" is built from the example that you pointed me to on the WIKI.. I didn't even use the resource explorer to import anything. I just created a new empty project with "Project | New" on the menu.  They were pretty much the same thing anyway.

    "tcpEcho_EK_TM4C1294XL_GNU_TivaTM4C1294NCPDT" is the resource explorer example project, which I then added the HTTP Server using the GUI.  And does not link.

    Let me know what you find, including if I screwed up a step somewhere.

    (On a third project, [well really a 7th project], I supplied my own efs_... file functions, and got past the linker...  but why??  As for these two, why are they resolved on one project, but not the other?)

    Thanks.

    -CSW

    HttpServer.zip

    tcpEcho_EK_TM4C1294XL_GNU_TivaTM4C1294NCPDT.zip

  • Steven Connell said:

    I'd only expect you to run into issues if you're trying to edit in both the GUI and the text editor simultaneously.

    Yes, I already surmised someone would have to be rather foolish to manipulate those files simultaneously.  Not gonna try that.

    Steven Connell said:

    If you had the setting System.WhateverValue = 12, and the 'System' module did not have a field "WhateverValue" then you would get an error when building your project when you open the XGCONF view (the GUI performs a validation of your *.cfg file when opening).

    That validation that's run is the same thing as when your app is built. It will use your project settings to find the same "System" module as when you build the app.  The GUI won't find a different "System" module than what your project is set to use.

    Now, if you knew that the System module was going to have a new element named "WhateverValue", and updated your script to set it to 12, then you would need to update your app's dependency (XDC tools in this case) to the newer version that has "WhateverValue" and then rebuild.

    Okay, that starts to clear things up.  It forces the GUI tools to be in line with the JS engine that generates the C code...  There is clearly a massive eco-system in play there which I am only barely beginning to understand.  

    I know the JS engine grinds up the config file and churns out C code, or maybe just linker commands, to add in and resolve all that is needed based on the packages you choose.  How it's doing that is still a mystery to me (where the original C code comes from, or what libs knows about).  And not vital to getting my newbie questions answered at this stage.

    Just to verify, this is that XDC package in my C:\TI folder, correct?  Because XDC isn't a package that goes into the project, like BIOS, NDK, TviaWare...  It stands outside and creates the compiled project  (Like Mickey Mouse with his wand in Sorcerers Apprentice  LOL ! ) 

    Thanks.

    -CSW

  • A couple of things stand out.

    Most notably, the working project is using the TI compiler.  The non-working is using the GNU compiler:

    You might try importing the tcpEcho example for the TI tool chain and retrying this experiment:

    Next, you should remove the following line from your configuration. This is bringing in the HTTP Client, which you don't need:

    var ti_net_http_Http = xdc.useModule('ti.net.http.Http'); // line 37 tcpEcho.cfg

    Steve

  • Steve,
    I started with a work space that was uncontaminated.
    When I import the tcpEcho project from the GCC compiler, build it, add the HTTP server, and rebuild it I get the missing functions.
    When I import the tcpEcho project from the TI compiler, build it, add the HTTP server, and rebuild it it builds without any missing functions.

    Same problem:

    C:\ti\tirtos_tivac_2_16_01_14\products\ndk_2_25_00_09\packages\ti\ndk\nettools\lib\nettool_ipv4.am4fg(httpclie.om4fg): In function `httpClientProcess':
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpclie.c:331: undefined reference to `efs_filecheck'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpclie.c:352: undefined reference to `efs_loadfunction'
    C:\ti\tirtos_tivac_2_16_01_14\products\ndk_2_25_00_09\packages\ti\ndk\nettools\lib\nettool_ipv4.am4fg(httpsend.om4fg): In function `httpSendFullResponse':
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:268: undefined reference to `efs_fopen'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:282: undefined reference to `efs_getfilesize'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:287: undefined reference to `efs_filesend'
    /db/vtree/library/trees/zumaprod/zumaprod-j14/exports/tirtos_tivac_2_16_01_14/products/ndk_2_25_00_09/packages/ti/ndk/nettools/http/httpsend.c:291: undefined reference to `efs_fclose'

    So, that means these "efs_..." functions are present in the TI build, but not in the GCC build.


    (In both cases, since it was a fresh, unmolested example, there was no HTTP client to remove)

    So, now we know the GNU builds are defective.

    Case closed  :-)  Except for the libs requiring to be rebuild to fix this.

    Thanks


    -CSW

  • Steve,

    Is there something of the same quality as the TI_RTOS document for Sitara?

    No matter what I do, I cannot get a simple NDK based program to even compile.  And I'm not getting answers anywhere else.  You made the mistake of helping me, so I'm coming back to ask for more  :-)

    -CSW

  • Steve,

    Allow me to clarify...  From the document by Todd on how to add the HTTP server, (which was great)  it doesn't seem to apply to Sitara.  The first step in the document is to highlight "TI-RTOS", but it's not present...  I've installed everything, plus the kitchen sink.  So I don't know what I'm missing.

    Two images, next to each other...  The TM4C1294 device  ------   compared to Sitara.

       .......................     

    Thanks for anything at all - Please.

    -CSW

  • Christopher Weber said:

    So, that means these "efs_..." functions are present in the TI build, but not in the GCC build.

    [...]


    So, now we know the GNU builds are defective.

    I filed the following to track this:

    NDK-150 - Incorrect link order of NDK libraries causes undefined symbols for GCC

    Steve

  • Christopher,

    In the future, please open a new thread for a new issue. Since this thread is marked answered, your last could be missed entirely since it wouldn't come up in our to do list of "unanswered questions."  It also makes it easier for others to search for/find.

    Unfortunately, Todd's document is specifically tailored to the TI-RTOS product, which is an SDK meant for MCU platforms.

    The Sitara team ships their own SDK and I believe uses a different means of configuration for the NDK.


    I was about to say "check out the NDK example shipped in the Sitara SDK."  But, in the version I have installed (somewhat older), I don't see any.

    So, I'm going to recommend that you submit a new post after all. You should ask where you can find an NDK example in the SDK.  You can also reference this forum thread which says they were going to do this in 2015.

    Steve

  • Steve,
    Thanks for the reply. I will open a new thread on that forum. But I can't now because CCS 7.1 doesn't even work (at least for me). See this:
    e2e.ti.com/.../2241977

    I figured the Sitara team did things their own way. I was just hoping you may know quickly. Because searching just turns up more dead ends and old material than useful stuff.
    -CSW