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.

TMS570LS3137: How to Erase Flash and write a bootloader for Tms570ls3137 in GHS

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

HI

    Iam currently writing a program of bootloader in GHS for TMS570ls3137,Iam trying to use the F021 API which has Library file (F021_API_CortexR4_BE.lib). The example bootloader which is written for code composer studio uses this Library(F021_API_CortexR4_BE.lib),This file has objects compiled using EABI (Embedded application binary interface) runtime support library.

Since Code composer studio uses rtsv7R4_T_be_v3D16_eabi.lib runtime support library ,The flash api does not produce any errors in code composer studio while execution and also during compilation.

The problem is that the Green Hills Compiler uses ABI(ARM application binary interface).So when i compile using the provided F021 flash  API .it shows an error of multiple definition and even if i solve this error .The GHS compiler does not take any objects from the F021 API(F021_API_CortexR4_BE.lib).

I found this by looking at the .map file and the GHS  compiler also gave a warning that this lib is not added during compilation.

is there any way to erase and write the flash other than using F021 API, Because Halcogen does not create any API for Flash (there is a link on Halcogen on Flash option which says to get the API  through download option ).This download also gives the same F021 API which is used in code composer studio.  

If any one know how to write bootloader in GHS please provide some help.

  • Hi,

    For erasing and programming the flash, the F021 flash APIs have to be used. 

    If no F021 flash API is called in your project, the F021 API library will not be included in the map file of your project.

  • Thank you Mr Wang,

    I have included a line in the code which calls the Api,The program below shows which does only one operation to erase Flash bank from  address 0x10000  and to a length of 0x07FF0,

    i have checked this code on CCS it works well it erases any data in the location address 0x10000  and to a length of 0x07FF0,

    And i also checked memory allocation where i can view the TEXT files of Flash APi on both RAM and ROM

    The below program works well in CCS and the compiler includes FLASH API  but in GHS the Flash API is neglected during compilation

    #include "sys_common.h"

    #include "bl_flash.h"


    #define FLASH_BANK_1 0


    #define FLASH_BANK_2 1

    int main(void)
    {

    Fapi_BlockErase((uint32_t)FLASH_BANK_1,(uint32_t)0x10000,(uint32_t)0x07FF0);

    while(1);

    //return 0;
    }

    Is there any possible way to add the API in Green Hills compiler(GHS),

    If nothing works out Iam planning on writing my own Api ,I hope it works

    if some one had the same issue and wrote a library please share the files

  •  There is no way to write our own Flash API 

    ive just found out trying.

    I beleive the only way to get the source files is only through TI