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.

TMS320F28388D: How to use F2838x_C28x_FlashAPI.lib

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Hello

I would like to use the library "F2838x_C28x_FlashAPI.lib" from C2000Ware_3_04_00_00_Software\libraries\flash_api\f2838x\c28x\lib

in my project.

To do this, the library and the associated header files were copied into the project.

In the Build Settings under include Options the path to the header file was specified and under File Search Path the path to the library was specified.

In the .cmd file, the file F2838x_C28x_FlashAPI.lib was specified as follows:

 

   Flash28_API:

   {

     /*this was running in another project -l F021_API_F2837xD_FPU32.lib*/

     -l F2838x_C28x_FlashAPI.lib

   }            LOAD = BLBODY, PAGE = 0

                RUN = RAML_SCODE, PAGE = 0        /* load into DCSM secured RAM */

                LOAD_START(_flashapi_loadstart),

                RUN_START(_flashapi_runstart),

                SIZE(_flashapi_size)

 

The linker returns the following error message:

undefined                          first referenced           

  symbol                                in file                

 ---------                          ----------------           

 _Fapi_checkFsmForReady             ./APP/usr/src/bootloader.obj

 _Fapi_getLibraryInfo               ./APP/usr/src/bootloader.obj

 _Fapi_initializeAPI                ./TGT/usr/src/tgt2838x.obj 

 _Fapi_issueAsyncCommandWithAddress ./APP/usr/src/bootloader.obj

 _Fapi_issueProgrammingCommand      ./APP/usr/src/bootloader.obj

 _Fapi_setActiveFlashBank           ./TGT/usr/src/tgt2838x.obj 

What else is needed to make this work?

  • Hi Simon,

    Please import below C2000Ware project in to your CCS and take a look at how the API headers and library are included in to the project:

         C2000Ware_3_04_00_00\driverlib\f2838x\examples\c28x\flash\flashapi_ex1_programming.c

    If it does not help, send me a snapshot of your project structure in CCS to see where the library and headers are placed - they should be placed at the locations as you specify in your build settings.  You might have already checked, but just in case.  

    Thanks and regards,

    Vamsi

  • Hi Vamsi

    sorry for the confusing messages. Here the message with all print screen:

    I have already looked at the flashapi_ex1_programming project.

    Project flashapi_ex1_programming:

     

    Our project is CECC0AAnnna and has the following structure:

    The folder include and lib are a copy of C:\ti\C2000Ware_3_04_00_00_Software\libraries\flash_api\f2838x\c28x

     I also tried Include Option and File Search Path directly to the library (C:\ti\C2000Ware_3_04_00_00_Software\libraries\flash_api\f2838x\c28x ) like in the flashapi_ex1_programming project. The linker result was the same undefined symbols.

    BThanks and best regards

    SSimon

  • Simon,

    Thank you for cleaning up all those messages.  I will review and get back to you in a day.

    Thanks and regards,
    Vamsi

  • Simon,

    Where is your bootloader.c file located in this structure?

    Also, did you include below in your code as shown in examples at C2000Ware_3_04_00_00\driverlib\f2838x\examples\c28x\flash ?

    //
    // Include Flash API include file
    //
    #include "F021_F2838x_C28x.h"

    Thanks and regards,
    Vamsi

  • Hello Vamsi

    The bootloader.c is in this structure. APP is on the same level like TGT.

    In bootloader.h and in tgt2838x.c the following line includes the header file:

    #include "F021_F2838x_C28x.h"

    For a test this line was deleted in bootloader.h and inserted in bootloader.c. The result was the same.

    I think the lib is maybe not correct included. When I exclude the F2838x_C28x_FlashAPI.lib the error message is the same.

    BR Simon

  • Simon,

    Thank you for the update. I think the path to lib should be mentioned in linker to make sure in this case.

    I will get back to you tomorrow on this.

    Thanks and regards,

    Vamsi

  • Our compiler expert may reply as well but I saw this one and thought I would try out the referenced example.

    The flashapi_ex1_programming example in C2000Ware is a bit odd in that the Library is added to the project but the search path actually points to where the library is located in C2000Ware.  Thus the physical library that gets linked is the one in C2000Ware and not the one in the project folder.  That makes understanding how the library is getting pulled in confusing.

    I would recommend adding the library this way

    1) Specify the library name (just the name) F2838x_C28x_FlashAPI.lib

    The same can be done by putting a -l option in the linker command file like in the initail post but I would recommend doing it in the project options so that you can see all the libraries being included.  It also makes it easier to control the linker order later if you need to do so.

    2) add the path where the library is located to the linker search path

    I used the ${FlashAPI_LIB_ROOT} variable.  Alternatively you could use ${C2000WARE_ROOT}/libraries/flash_api/f2838x/c28x/lib

    Generally recommended to use a variable so that you don't have any absolute paths stored in the project.  CCS will replace with the variables at build time.  You can put your mouse over the little [...] to see what the path is with the variables populated.

    I verified both of those options with the example project.

    If the path is wrong then there would be a linker error like this:

    error #10008-D: cannot find file "F2838x_C28x_FlashAPI.lib"

    Regards,

    John

  • For the project that sees the linker error messages when it is built, please rebuild the entire project.  Right click on the name of the project, then select Rebuild Project.  Save the build log to a text file.  In the Console (not Problems) view, use the icon named Copy Build Log.  Be sure to use the file extension .txt.  Attach the build log to your next post.

    Thanks and regards,

    -George

  • Thank you for your answers. Because Simon is out of office some days I will continue this thread.

     

    We found out that it has something to do with the library format. Until today we used "legacy COFF" in our project settings. But this new version of the Flash library is built in "eabi". I guess this is causing the linker errors.

    Is the flash library also available in "COFF" format?

  • Vamsi can you comment on if a COFF version of F2838x_C28x_FlashAPI.lib is available?

    John

  • Benjamin,

    All of the SW supported in the C2000Ware (e.g. EtherCAT libraries, Ethernet libraries, driverlib, IQMath etc.) for F28388D will be in EABI format.  

    Also the compiler does not support the newer features like FPU64 and fast integer division in COFF.  These are supported only in EABI.

    Hence, we would suggest to consider moving to EABI if possible.  This helps you to get all the support and updates in a timely manner.

    If this is not possible, let us know and we can discuss.

    If you need any help in moving your application from COFF to EABI, please refer to:  software-dl.ti.com/.../C2000_c28x_migration_from_coff_to_eabi.html

    Thanks and regards,
    Vamsi

  • Thanks Vamsi!

    We used the Flash API for the F2837xx until now (the new one was not available at project start) and that worked well so far. But now we are facing a new effect while flashing and we were wondering if this could be caused by the "old" Flash API.

    At the actual project situation it is a to big effort for us to change from COFF to EABI. Could you please provide us the library in COFF format just for the test if this really solves our flash problem? If yes, we will change our project to EABI as soon as possible.

    Many thanks, Benjamin

  • Benjamin,

    What is the issue that you are facing?  And what is the new and old flash API?  Please mention the library paths and names.

    For F2838x, you should only use the F2838x flash API and not the F2837x flash API.

    Regarding the F2838x COFF flash API: Glad you will eventually move to EABI soon.  For COFF, please contact me via E2E firendship.  

    Thanks and regards,
    Vamsi

  • Vamsi,

     

    The issue is that the function Fapi_issueProgrammingCommand() gives back the unknown value "7" when it reaches Flash sector H (0xA0000) on DSP CPU1. With our actual understanding this issue only occurs if the OTP of the CM is programmed.

    With "old" flash API I mean the
    TMS320F2837xD Flash API (Version 1.54).
     
    Sorry, how can I contact you via E2E friendship?

    Thank you! Benjamin

  • Benjamin,

    Thank you for the details.

    There is no relation between CM OTP and C28x flash programming.

    Please use F2838x flash API on F2838x and not F2837x flash API.  

    I received your friendship request - I will reply to you in a day.

    Thanks and regards,
    Vamsi

  • Benjamin,

    Since we are discussing this offline, I am closing this post for now.  

    If you have further questions, you can reopen this or post a new one.

    Thanks and regards,

    Vamsi

  • Update: Customer confirmed offine that the issue is closed once they used the correct flash API.