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.

httpServer file storage/read from SD Card in Tiva C MCU

MCU: TM4C1294NCPDT

TI-RTOS: v2.01.00.03

NDK: v2.23.01.01

CCS: v6.0.1.0040

Hello,

    I am working on implementation of Embedded Web Server on Tiva C MCU following the guidelines provided in the ppt presentation in the link http://processors.wiki.ti.com/index.php/TI-RTOS_HTTP_Example . On page 44 of the ppt file, its mentioned that we need to add efs_stdio.c (supplied in the zip file) to the main C file in order to make the html file be read & directed from the SD card. But since the functions like efs_createfile, efs_destroyfile have already been defined in the file efs.c in the OS folder of the NDK package, the compiler is giving an error "#10056 symbol "efs_createfile" redefined: first defined in "./DL_main.obj"; redefined in "./myfiles/2642.efs_stdio.obj" DL_Tiva_20141105".

    Please help on how I can resolve the issue. I have gone through the posts "http://e2e.ti.com/support/embedded/tirtos/f/355/t/292751.aspx?pi199400=1" & "http://e2e.ti.com/support/embedded/tirtos/f/355/p/295118/1030893.aspx#1030893", but it seems not to help in resolving the issue.

    Screenshot of the error in CCS compiler have been attached with this post in a zip file.

 

Thanks

Regards

Soumyajit

error.zip
  • Soumyajit,

    Sorry for the delay.  

    I tried to recreate the issue you report, following the exact instructions in the powerpoint, using the same MCU as you, and all the same software components you list.   I don’t get any error when I build as described on page 44.   There was only one issue along the way, with there being two different SDSPI identifiers for this MCU, and I had to pick one.

    When you were going thru the build steps did you follow them exactly as described in the powerpoint?

    In the error message you posted the paths for the conflicting objects look odd.  What is “/myfiles/2642.efs_stdio.obj”? 

    I wonder if you’ve changed file locations or project properties, or added some additional files to your project?

    To debug this further I think I will need for you to zip up and post your project so I can have a look.  Can you do that?  

    Thanks,
    Scott

  • Hi Scott,

        Thanks for looking into the matter. I have zipped the entire folder (project) & attached with this post for your verification. Earlier when things didn't work, I continued with my project deleting all the attempts I made to make SD card access work. To simulate the same error, I have made the changes this time also so as to bring the same kind of error again. Hence, the project I zipped in contain errors. I just did the following:

    1.    Copied file efs_stdio.c from the httpServer project folder (that I downloaded from wiki) to a folder in my project named "include" (earlier this folder name was "myfiles").

    2.    Commented a few lines in the function "AddWebFiles" & "RemoveWebFiles" which are related to html files to be accessed from the SD card this time

    3.    I have kept the file inclusions of "index.h" (which was generated from "index.html") & "setTime.h" in the project as they are not going to harm the project

        Even from a fundamental knowledge on file inclusion in C compilers, I would like to comment that when one has a set of functions running in a project environment, & a new file is included in the same project containing the same function name set (but the functions may be written differently), then the compiler will most obviously give errors that functions redefined in included file (the file one have included later). Am I wrong in this context?

    Regards

    Soumyajit

    ========================================================================

    CCS ERROR LOG:

    error #10056: symbol "efs_getfilesize" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_filesend" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_destroyfile" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_fseek" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_fopen" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_fread" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_createfilecb" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_loadfunction" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_filecheck" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_createfile" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_rewind" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_fclose" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_fwrite" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_feof" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10056: symbol "efs_ftell" redefined: first defined in "./include/Ethernet.obj"; redefined in "./include/efs_stdio.obj"
    error #10010: errors encountered during linking; "DL_Tiva_20141105.out" not built

    DL_Tiva_20141105(for Scott Gary).zip
  • Hi Soumyajit,

    Thanks for sending the project.

    In the include/Ethernet.c file there is a #include of efs_stdio.c:

    /*
     * Ethernet.c
     *
     *  Created on: Nov 14, 2014
     *      Author: soumyajit
     */

    #include <stdio.h>

    #include "Ethernet.h"
    #include "Rtc.h"
    #include "html/index.h"
    #include "html/setTime.h"
    #include <driverlib/hibernate.h>
    #include <time.h>

    #include <ti/ndk/inc/tools/cgiparse.h>
    #include <ti/ndk/inc/tools/cgiparsem.h>

    #include "efs_stdio.c"

    ...


    This is causing the code in that file to be built into the Ethernet.obj object, when it is already in the efs_stdio.obj object - causing the linker to generate those errors.  By commenting out this #include, the project builds without errors.

    Regards,
    Scott

  • Thanks Scott,

        It worked, but when I am trying to download a file from the drive (a thumb drive because I am using a USB thumb drive instead of an SD card), the file download is starting smoothly but after downloading a portion of the file (sometimes after 200Kb of download, sometimes after 900Kb of download), the NDK hangs & I have to reset the board (MCU reset).

        What might be going wrong?

        I need this thing to get working because my drive will be containing javascript files, jquery files and other jpg files too which the html page will request for download on the client (the PC). First, I tried with a 40 MB file, it downloaded upto 900Kb, then I tried with a 300 Kb file, it downloaded upto 273Kb. Then I tried with a 89 Kb file, it downloaded successfully.

    Thanks

    Regards

    Soumyajit

  • Soumyajit,

    Ok, glad that the problem was resolved.

    For your next question about the file transfer: I don’t know what might be going on.  Did you try with an SD card to rule out any issue related to using a thumb drive instead?

    For this new problem, I think it would be best for you to post a new forum thread with a new topic.

    Regards,
    Scott