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: LFU with Single Bank MCU

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE


Hi all,

I try to achieve LFU with TMS320F28388D.

There is not LFU example for TMS320F28388D.

So, I try to understand LFU example for TMS320F28002x.  Which is located "C:\xxxx\xxxx\C2000Ware_4_03_00_00\driverlib\f28002x\examples\flash\flash_kernel_ex3_sci_flash_kernel"

I have questions about LFU.

But first I need the corresponding app example - LED blinky (which is compatible with flash kernel). Please could you share with me?

(I saw thread about this issue. The corresponding App example (LED blinky) is not released in C2000Ware)

Thanks,
Best regards.
Mehmet.

  • Mehmet,

    The example you are referring to will be released in the next C2000Ware release (planned for Nov 17).

    If you would like the example earlier than that, please send me a e2e friend request, so I can message you the link to request it.

    Thanks,

    Sira

  • Thanks, Sira.

    As I said before, I have questions about LFU.
    These questions related "flash_kernel_ex3_sci_flash_kernel" project which is located in "C:\xxxx\xxxx\C2000Ware_4_03_00_00\driverlib\f28002x\examples\flash\" 

    1- Is "flash_kernel_ex3_sci_flash_kernel" project's executable code load to flash but run from RAM ?

    When I examined linker command file, I understood that "flash_kernel" project resides "FLASH_BANK0_SEC0" but copied "RAMLS4567".

    This is achieved by Device_init() function's memcpy command. 

    Please correct me if I'm wrong.

    2- (Although there is not application example but I think that) Will the application loaded into Flash, but run from RAM? 

    If Both "flash_kernel_ex3_sci_flash_kerneland application resides Flash but runs from RAM, does this situation cause a problem for RAM capacity?

    3- When main() function is called? 

    There is "bankSelect()" function at "codestart" section.

    "bankSelect()" branches "most recent programmed bank" or "sciGetFunction()"  

    I did not find that who calls main() function. 

    4- Why LiveDFU() function have separate code section ?

    I think, application code branchs to the LiveDFU() when software update is required. 

    Please correct me if I'm wrong.

    5- Why "ldfuLoad()" and "ldfuCopyData()" functions have separate "#pragma CODE_SECTION(...,".TI.ramfunc") qualifier ?

    Whole "flash_kernel"  project's executable code has already loaded to flash but ran from RAM.

    These functions are already included in the "flash_kernel_ex3_sci_flash_kernel" project's executable code. 

    Why these functions also stated with "#pragma CODE_SECTION(...,".TI.ramfunc") qualifier ?

    Don't they already work from RAM?

     

    Thanks for your interest.

    Best regards.
    Mehmet.

  • 1. Correct, this is because F28002x has a single Flash bank, where both the Flash kernel and the Application reside. When the Flash kernel erases/programs the Application, it should be resident in RAM because simultaneous Reads from/Writes to Flash are not possible. Not all of the flash kernel runs from RAM, only a portion of it. Refer to the .TI.ramfunc section

    2. Application will be programmed to Flash

    3. bankSelect() in the Flash kernel passes control to the c_int00 (in codestartbranch.asm) which calls main() of the Application.

    4. Correct, Application needs to know a fixed address to branch to on receiving a Firmware update command.

    5. Explained in (1) above. These are the specific functions that need to run from RAM, not the entire Flash kernel.

    Thanks,

    Sira

  • Hi Sira, 
    Thanks for your response.

    for Question 2. 
    Yes I understood that program will be programmed to Flash. But runs from where ?
    If Application runs from flash, how can flash kernel program/erase Flash ? (code execution and flash programming cannot occur in the same bank.)
    For provide "live" update , application and flash kernel must run simultaneously.

    for Question 3.
    As I understand it, bankSelect() functions have two option.
    1- Branch to sciGetFunction(). And wait for LIVE_DFU_CPU1 command.
    2- Branch to 0x8EFF0 where is application located. 

    When bankSelect() functions passes control to the c_int00 ?

    for Question 5.
    Please see my linker command file below. Doesn't it mean entire Flash Kernel run from RAM?


    According to this thread, this linker command file is enough to copy whole part of application code to RAM from Flash. 

     

    Best regards.

    Mehmet.

  • Correct, during the live update the application also needs to run from RAM since you will be erasing/programming Flash. This is true if you have a single Flash bank and the Application size is large enough that you can only fit in one version of the Application in Flash. But again, only relevant portions of the Flash kernel need to run from RAM (as I described in my previous post), likewise only relevant portions of the Application need to run from RAM (e.g. any ISRs that are periodically called and might be called during the live update).

    2. The call to 0x8eff0 is how it goes to c_int00

    No, this is mentioning the Flash API library will run from RAM. Remember that the user still needs to have the corresponding memcpy of the associated linker symbols in their code in order to copy from Flash to RAM.

    Summary -> you need a portion of the Flash kernel, a portion of the Application, and the entire Flash API library (contained within the Flash kernel) to run from RAM. This is true for a single Flash bank LFU use-case.

    Thanks,

    Sira