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.

Writing to external file

Other Parts Discussed in Thread: TMS320F2809, CCSTUDIO

I am trying to write the contents of an EEPROM to an external file on my computer via the UART.  I have followed the app note SPRA861 "RAMDISK: A sample user defined C i/o driver" but I keep getting linker "undefined symbol" errors.  What does this mean, thanks.  Also I am using fopen and fprintf in my code and I am running from flash and am using the TMS320F2809.

  • Jorge said:

    I am trying to write the contents of an EEPROM to an external file on my computer via the UART.  I have followed the app note SPRA861 "RAMDISK: A sample user defined C i/o driver" but I keep getting linker "undefined symbol" errors.  What does this mean, thanks.  Also I am using fopen and fprintf in my code and I am running from flash and am using the TMS320F2809.

    The "undefined symbol" error in the linker means that the compiler has found a definition for a symbol (such as a variable, function, etc) but the linker can not resolve it.  If the symbol is a function, there either needs to be an object file which contains the definition of this symbol included in the linker, or a library needs to be included.

    If you can post the actual error, this may help highlight where you should look.

  • Brandon,

    Here are the errors and a portion of the code I used, this is the only place I have used this peice of code.  Thanks for the help.

    [Linking...] "C:\CCStudio_v3.3\C2000\cgtools\bin\cl2000" -@"Debug.lkf"
    <Linking>

    undefined                        first referenced
     symbol                              in file
    ---------                        ----------------
    _RAM_rename                      C:\Work\Flash Version (Non-Bios Version)\Debug\Main.obj
    _RAM_write                       C:\Work\Flash Version (Non-Bios Version)\Debug\Main.obj
    _RAM_lseek                       C:\Work\Flash Version (Non-Bios Version)\Debug\Main.obj
    _RAM_read                        C:\Work\Flash Version (Non-Bios Version)\Debug\Main.obj
    _RAM_unlink                      C:\Work\Flash Version (Non-Bios Version)\Debug\Main.obj
    _RAM_open                        C:\Work\Flash Version (Non-Bios Version)\Debug\Main.obj
    _RAM_close                       C:\Work\Flash Version (Non-Bios Version)\Debug\Main.obj
    >>   error: symbol referencing errors - './Debug/Control.out' not built

    >> Compilation failure

    Build Complete,
      2 Errors, 0 Warnings, 0 Remarks.

    Portion of Main.C

    //Standard Defined includes
    #include <stdio.h>
    #include <file.h>

    //User Defined includes
    #include "Main.h"

    int    RAM_open(const char *path, unsigned flags, int llv_fd);
    int    RAM_close(int dev_fd);
    int    RAM_read(int dev_fd, char *buf, unsigned count);
    int    RAM_write(int dev_fd, const char *buf, unsigned count);
    fpos_t RAM_lseek(int dev_fd, fpos_t offset, int origin);
    int    RAM_unlink(const char *path);
    int    RAM_rename(const char *old_name, const char *new_name);


    //User Defined Code
     
    void main(void)
    {

        add_device("ramdisk", _MSA, RAM_open, RAM_close, RAM_read, RAM_write,
      RAM_lseek, RAM_unlink, RAM_rename);

     

     

     

  • Jorge,

    I downloaded the RAMDISK code and was able to compile/link it without an issue. I will send this to you through the support channel as we have been talking through there already.

    Regards,

    Tim Love