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.

TMS320F280039: how to get the FlashStateMachine.c source file

Part Number: TMS320F280039

Expert,

My customer report an issue when call Fapi_setActiveFlashBank()

So I want to find the FlashStateMachine.c source file to help them debug further to locate the root cause.

But I did not find it.

BR

Emma

  • Hello Emma,

    Unfortunately we do not publish the source code to the Flash API for customers. Please describe the issue so that we can try to help with the debug.

    Thanks,
    Ibukun

  • Hi Emma,

    What error did they get when Fapi_setActiveFlashBank() is called?

    Please provide more details.

    Thanks and regards,
    Vamsi

  • Vamsi,

    We meet exactly same issues as describe in this.

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/1171738/tms320f280049c-when-writing-the-program-i-ll-run-into-interruption-if-i-run-the-fapi_setactiveflashbank-algorithm/4463072?tisearch=e2e-sitesearch&keymatch=Fapi_setActiveFlashBank#4463072

    the code ran the “Fapi_setActiveFlashBank” algorithm, and then would enter the “ILLEGAL_ISR”. after they add some application code.

    And Fapi_setActiveFlashBank is run in Flash compared with our example code running in RAM.

    Customer already run out of the RAM, after put the whole Flash_api lib in Ram by add this code, they can not build the code.

    GROUP
       {
           .TI.ramfunc
           { -l FAPI_F28003x_EABI_v1.58.01.lib}
    
       }  LOAD = FLASH_BANK0_SEC1,
          RUN = RAMLS03,
          LOAD_START(RamfuncsLoadStart),
          LOAD_SIZE(RamfuncsLoadSize),
          LOAD_END(RamfuncsLoadEnd),
          RUN_START(RamfuncsRunStart),
          RUN_SIZE(RamfuncsRunSize),
          RUN_END(RamfuncsRunEnd),
          ALIGN(8)
    

    So my question is, does this function Fapi_setActiveFlashBank have to run in RAM? since they can run good before adding codes in app.

    If yes,

    is there any method to put less flash api function in RAM. We tried code_section but failed.

  • Hi Emma,

    Can you post this on external forums?  Not sure why this has to be on internal forum.

    As you know from your rotation days in our team, Flash API should not be executed from the same flash bank on which the flash operations are targeted.  Either it has to be executed from the RAM Or from a different flash bank.   

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Thanks for your reply. 

    Flash API should not be executed from the same flash bank on which the flash operations are targeted.  Either it has to be executed from the RAM Or from a different flash bank.   

    It seems Fapi_setActiveFlashBank must run in RAM since it activates all flash banks. This is also the reason I want to get the source code.

    the difficulty is I did not know the method how to assign an separate address for some flash API functions in the .lib.(normal code_section will fail) If we have this kind of method, could you kindly tell me?

    since the whole flash API needs about 5K RAM. it is too large. even in F280049, some of my customer will use ROM based FLASH api to save RAM.

    But there is not this option in F280039.

    Besides, customer is curious about the function content, how about if we give the Fapi_FlashBank1 as the function input parameters.

    And they also want us to explain why they can run all the required Flash API function in flash normally before.

    BR

    Emma

  • Emma,

    As discussed in the meeting, I assigned this post to our compiler team.  Please discuss with them.

    Thanks and regards,
    Vamsi

  • Hi Emma,

    I'm not sure I follow the above discussion with respect to RAMFUNC usage. 

    For reference, the C28x compiler manual sub-chapter titled "Function Attributes" describes the "ramfunc" function attribute that can be used to tag functions to run in RAM.  This pairs with the "Placing Functions in RAM" section of the C28x assembly tools manual which explains how placement of the ".TI.ramfunc" section works.  This functionality will ensure that only functions marked as "ramfunc" are placed with section ".TI.ramfunc", which the user must then place place appropriately using a linker command file. For flash based devices, you must also indicate the "table(BINIT)", which will ensure that a boot-time copy table is created to ensure that the function is copied to RAM on boot prior to its being run.

    I don't see a copy table in the linker command file you posted above.

    Can you verify that you are following the steps outlined?  If so, what exactly is not functioning as you expect?

    Thanks

  • Alan,

    I can put the functions in RAM if I have enough RAM. 

    The question is lack of RAM, and I want to know how to map a specific function of a given library to RAM while the other functions of the library are mapped to the flash.  

    BR

    Emma

  • Alan,

    My question is can I put different obj in flash API to different memory? it seems I can do it from this link. but I don't know how?

    https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html

    BR

    Emma

  • I want to know how to map a specific function of a given library to RAM

    Please read the first part of the article Linker Command File Primer.  Focus on understanding the terms input section and output section.  This post discusses how to allocate a specific input section from one object file in a library.  It is often the case that this input section contains one function.  But that is not always the case.

    From that same article, search for the part titled Allocate an Input Section from a Library to Different Load and Run Addresses.  This example is close to your situation, but not an exact match.  You want to use the .text section from a particular file, instead of .const.

    while the other functions of the library are mapped to the flash

    Make sure the special allocation into RAM appears before the general allocation of the library to flash.

    Thanks and regards,

    -George