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.

How to relocate the F021 Flash API library

Other Parts Discussed in Thread: CONTROLSUITE

On the C28335, there was example code on relocating the 28335 Flash library to RAM, as follows:

   Flash28_API:
   {
        -lFlash28335_API_V210.lib(.econst)
        -lFlash28335_API_V210.lib(.text)
   }                  LOAD = BOOT_CODE,
                      RUN = RAML0,
                      LOAD_START(_Flash28_API_LoadStart),
                      LOAD_END(_Flash28_API_LoadEnd),
                      RUN_START(_Flash28_API_RunStart),
                      PAGE = 0

Now I need to do a similar task with the 28377D; I downloaded the latest F021 Flash API, and I have integrated it, but I need to relocate the Flash library either to a specific Flash segment or ideally to RAM. I have looked through all of the reference documents and source code, but I could not find a similar example on how to relocate this new library. There also do no appear to be any "LoadStart" references in the F021 header files to use.

Thanks,

Jim

  • Jim,

    Within controlSUITE, under device support for F2837xD, there is a flash programming example using the F021 Flash API that may be useful. 

    controlSUITE location: 

    ~\ti\controlSUITE\device_support\F2837xD\v120\F2837xD_examples_Dual\flash_programming

    Hope that helps!

    Best Regards,

    Chris

  • I reviewed the flash programming example, and it is not quite what I need. That example relocates all of that application to RAM. My bootloader application all resides in a single segment of flash, and I need that code to remain in flash, so I need to independently relocate ONLY the flash-api code (because I cannot reprogram other flash segments within the same bank).

    Maybe this question is more specific to how to use the linker command file. As I wrote above, the 28335 example relocates the flash-API as follows:

       Flash28_API:
       {
            -lFlash28335_API_V210.lib(.econst)
            -lFlash28335_API_V210.lib(.text)
       }                  LOAD = BOOT_CODE,
                          RUN = RAML0,
                          LOAD_START(_Flash28_API_LoadStart),
                          LOAD_END(_Flash28_API_LoadEnd),
                          RUN_START(_Flash28_API_RunStart),
                          PAGE = 0

    In those 28335 library headers, there are extern references to the Flash28_API_LoadStart, LoadEnd, etc, but those references don't exist in the F021 library headers. From the map file, it looks like the first function in memory is Fapi_getFsmStatus and the last function in memory is Fapi_GlobalInit. Using these function pointers, can I populate the _Flash28_API_LoadStart, _Flash28_API_LoadEnd, and _Flash28_API_RunStart to relocate only the Flash API library?

    Thanks,

    Jim

  • jimj2713 said:
    In those 28335 library headers, there are extern references to the Flash28_API_LoadStart, LoadEnd,

    Hi Jim,

    Yes these symbols are defined as external because they are defined by the linker itself as part of the link process.  They are not defined in the code. 

    Basically the following line says "hey linker, when you allocate this to memory, wherever it starts, I'd like to be able to refer to that as "_Flash28_API_LoadStart".  You could call it anything "_MyFlashStart" or "_AwesomeCodeStart"  :) you are defining the name in the linker file itself.  The extern definitions just keep the compiler from wondering where the heck it is:  "extern".

    jimj2713 said:
    LOAD_START(_Flash28_API_LoadStart),

    For more info check out section 8.5.10.7 Address and Dimension Operators of www.ti.com/lit/spru513

    Regards

    -Lori

  • Thank you Lori; that worked like a charm. I thought the documentation was saying those LOAD_START, LOAD_END labels were created by the asm .label statement.

    Jim