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.

Uart Boot Loader with TMS570LS0432

Other Parts Discussed in Thread: TMS570LS0432, TMS570LS3137

Hi all,

I'm using the Hercules TMS570LS0432 evaluation board and I'm trying to implement the uart boot loader,

taken from an example project inside the Ti site.

The boot loader seems work fine but I've a problem to launch my application code downloaded. After the download I verified

that the flash image starting at address 0x20000 corresponds to the content of the file downloaded.  

 The file is a .out without symbols, stripped using  the TI utility armstrip.exe  . If I load and execute this file using CCS studio (my version is : 5.3.0.00083) 

all works fine. In my investigation I've noted that at the flash starting address the uart_boot loader puts exactly the first byte of the .out file, instead the CCS

discards the first 88 bytes (in my application) , that probably are relevant to the file checksum and IVT initialization, and puts the 89th as first.

Probably this is the reason because when I launch my application code , it doesn't  start due to the bad instruction as entry point, but at this point my questions are:

1) I'm operating in a right way or I'm missing something?

2) Is correct my .out file with the symbols stripping performed?

3) There is another way to generate a file without the first bytes so to have a flash image as after the load via CCS?        

 

As further information, in attach you can find a file containing an extract of my application.out file with the first bytes and also my sys_link.cmd file.

I hope I was clear enough in my explanation and I thanks in advance for your time and support you will grant me.

Best regards

Claudio  

6242.Application_out.docx

 

  • Hi Claudio,

    1. Your application should be set to the address defined at your APP_ADDRESS (the default is 0x20000)

          VECTORS    (X)   : origin=0x00020000 length=0x00000200

    2. You need to convert your application out file to raw binary file. My bootloader doesn't read elf file format. 

        in your project property, under CCS Build->Steps->Post-build steps->Commands, type:

    "${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "$hTMS570LS04Blinky.bin" "${CG_TOOL_ROOT}/bin/ofd470" "${CG_TOOL_ROOT}/bin/hex470" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"

        Compiling the project will create the raw binary file for you. The file name is TMS570LS04Blinky.bin (please use your own name).

    Regards,

    QJ

  • Hi QJ,

    thanks a lot, now with your suggestions, I resolved my issue and my application after the download starts and works fine.

    Just a little consideration about your post, also for your information.

    I've  inserted the post build steps below because I'm using CCS with a version > 5  (5.3).

    "${CCE_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin" "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin" "${CG_TOOL_ROOT}/bin/armofd" "${CG_TOOL_ROOT}/bin/armhex" "${CCE_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin"

     

    Thank you very much again.

    Regards

    Claudio

     

     

  • Hi Claudio,

    May you please share your bootloader project with the F021 API included? 

    Thank you,

    Regards.

    rha

  • Hi Hakan,

    sorry for delay in my answer but I was a bit busy at work. I also had the same problem on BlockErase and I have

    modified a  procedure to obtain a successful result from oReturnCheck = Fapi_BlockErase( ucBank,

    FlashDestination, size)  called in bl_ymodem.c file.

    The problem was in uint32_t Flash_Erase_Check(uint32_t Start_Address, uint32_t Bytes)  procedure called by

    Fapi_BlockErase . I did the check NOT as unit32 data size,   but byte per byte. Below you can find my software

    patch.

    Sorry but I can't share the entire project due to the policy of my company. Please try my suggestion and let me know

    if it works.

     

    Software Patch:

    Note: The lines with // were the originals.

     

    uint32_t Flash_Erase_Check(uint32_t Start_Address, uint32_t Bytes)

     {

       uint32_t error=0;

       //register uint32_t *dst1 = (uint32_t *) Start_Address;

      register uint8_t *dst1 = (uint8_t *) Start_Address;  

      register uint32_t bytes = Bytes;

      while(bytes > 0)

       {

         //  if(*dst1++ != 0xFFFFFFFF)

         //    {

         //   error = 2; 

         //  }

         //  bytes -= 0x4;

         if(*dst1++ != 0xFF)

          {

             error = 2;

          }

        bytes--;

      }

     #ifdef DEBUG_MSG_L2       

      UART_putString(UART, "\r Erase Flash Errors:   ");

      UART_send32BitData(sciREG1, error);   

       UART_putString(UART, "\r ");

     #endif  return(error);

     }

     

    Best regards

    Claudio

  • Hello Claudio;

    First, thank you very much. You are far more responsive then TI support.

    I tried your patch but it did not work for me. I belive my issue is related to the new F021 API(v2.0) . I am using CCS 5.5 so it might even be a configuration issue.  

    I am trying to find and give a try to old F021 API (v1.5) but I could not find it in any TI resources(web/support cds). I believe there is something big about it, it is blowing flashes or something, otherwise why to they have to removed it totally?

    My code always loop   while(FAPI_GET_FSM_STATUS!= Fapi_Status_Success); no matter it is a erase or programming command and at those time FMdlStat register is 0x11.

    Best regards.

  • Hi Hakan,

     

    I'm afraid of your bad result after my suggestion. By the way , another TI member some months ago, sent me a request about the uart boot loader on Hercules and he use  the F021 Flash API v 2.00.01. Here below I've reported part of his note , maybe this could help you.

     Just for note, at the moment I hadn't unexpected  behaviors on F021 API v 1.51.0  library, maybe depends from my system configuration (Flash access , protection and so on ...).

    ............ Note from TI Member .................

    I am using Uart Boot Loader with F021 Flash API v2.00.01(were you using this version?) from the TI site, with TMS570LS3137. I have only been able to successfully use FAPI commands after I manually loaded FAPI libraries into RAM while in main(). I am wondering, did you have to make any similar changes to get your program running? 

    ..........................................................................

    I hadn't this problem because It is done automatically in my startup code (_copyAPI2RAM_();).

    I hope this could help you.

    Regards

    Claudio

     

     

     

  • Hi Claudio,

    I am out-of-office right now, but I will try that as soon as I get back to the office.

    I know your company policy but may it be possible for you to share just the F021 API v1.51.0 ? 

    Thank you for your support.

    Best regards

    rha