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.

TMS320F28379D: TMS320F28379D Flash API reference implementation, not able to properly include Flash initialization functions into my code

Part Number: TMS320F28379D


Hi folks,

I am learning to use the Flash API on F28379d Launchpad. Refering to  https://www.ti.com/lit/ug/spnu629a/spnu629a.pdf?ts=1712174648571 , following the implemetation examples, my plan is to add the flash operations into my application code. 

In the implementation examples the guide provided, before the flash API functions gets called, it has several function calls which seems to do initialization:

Sample Implementation
#include “F021_F2837xD_C28x.h”
#define CPUCLK_FREQUENCY 200 /* 200 MHz System frequency */
int main(void)
{
// Initialize System Control:
InitSysCtrl();
// Call Flash Initialization to setup flash waitstates
// This function must reside in RAM
InitFlash();
// Gain pump semaphore
// This function is available in the F2837xD device_support folder in the C2000Ware
SeizeFlashPump();
//Jump to RAM and call the Flash API functions
Example_CallFlashAPI();
}

I tried to put the function calls into my main() function too, before the flashAPI function used. However, I could not find in the guide doc, that where these init functions:

InitSysCtrl(),

InitFlash(),

SeizeFlashPump()

come from. I tried to include several possibly related header files, but doesn't work: (also ensured the include path have device_support/2837xD/common/include and /header/include) 

After that, but checking example flash_programming_dcsm_cpu1 that TI provided, it seems functions InitSysCtrl(), InitFlash() come from F2837xD.SysCtrl.c:

However, I didn't find proper way to include correct header to use that. I tried to add this .c file to my project, but generates lot not-defined errors during build I guess I still missed something. 

Could you share some information of proper way to use these functions, so that I can follow the flashAPI reference in my code?

Regards,

Wei

  • Hi Wei,

    Did you check the build settings of the flash API usage project and include all the required paths/headers/libs?

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    I doubled checked the include paths, please see the figure below for the include paths of (1) my 79d_boot project (2) the official example "flash_programming_dcsm_cpu01" project, for comparison.

    I think the include paths of my own project covers all the ones appeared in the flash example project. 

    And in the figure above, I commented out the 3 linitialization functions,

    InitSysCtrl(),

    InitFlash(),

    SeizeFlashPump()

    the programe at least compiled with no issue. 

    While when the 3 function calls not comment-out, the build error emerges like shown below:

  • Hi Wei,

    Thank you for the update.  I will review and get back to you early next week.

    Regards,

    Vamsi

  • Hi Wei,

    It seems from your screenshot that you have not added "F2837xD_SysCtrl.c" in your project.

    Definition of InitSysCtrl(), InitFlash() and other related function are present in that file.

    Thanks & Regards,

    Rajeshwary

  • Hi Rajeshwary,

    Thanks for your reply. Sorry I hadn't  replied this until just now revisit it.

    As you said, I have added the  F2837xD_SysCtrl.c file to the project. But when building the project I got some "unresolved symbol" errors as you can see in the figure below. 

    It seems missing the defnitions/declarations that exists in rest F2837xD_xxx files. So, taking the official flash_programming_dcsm_cpu1 example as reference, (because in my project I am mainly doing flash programming), I copied all F2837xD_xxx files the example project has, to my project. However, still got building errors.

    After mangling with include/exclude some files, and adapting the cmd file, down the road I can build this project, but I don't think it will work. (check below that it says the InitFlash(), initSysCtrl() function are implicitly declared, even though I can track it to the F2837xD_SysCtrl.c by clicking "Open Declaration".

      

    I hope to be more helpful on figuring this out and don't want just throw lot error message screenshots here.

    Some context I can provide is, this project is originally adapted from a drivelib CAN bus example "can_ex5_simple_receive.c", based on it,  I tried to add the FlashAPI related include/source files to it -- I want to use both modules i.e. CANbus with Driverlib, and FlashAPI (seems based on bitfield API). I feel all the issues come from trying mixing the two (I mean driverlib API and bitfield API), that's my 2 cents. I hope this can be an angle for looking into this issue. 

    Regards,

    Wei 

  • Hi Wei,

    As you may know, the Flash API library itself is a compiled library and hence it does not matter whether it is bitfield based or driverlib based.  You can embed flash API library in any type of project.  What function in flash API caused an issue?  Please provide specific details.

    Thanks and regards,

    Vamsi

  • Hi Wei,

    Since I did not hear back from you in the last 4 weeks, I am closing this post.

    If you have further questions, please open a new thread as needed.

    Thanks and regards,
    Vamsi