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.

Q about TMS570LC4357 flash programing with UART

Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN

HI,

I am trying to download program though uart port  on tms570lc4357, but i can not get any example or user guide. could any one tell me how to do.

however, the resource spna193.zip is for other series chip. Can i learn from that.

Thanks.

  • Hi Jinus,
    We don't have an UART bootloader example for LC4357. Yes, you can use the example from app note www.ti.com/.../spna193.pdf as a reference. This example was created for the LS31x device but you can port it to LC4357.
  • Thanks Charles.
    Sorry for my late reply.

    This example was created for the LS31x device but you can port it to LC4357.
    Can you give some advices about how to port it to LC4357?

    Thanks!
  • Hi Janus,
    The difference between the LS31x and LC4357 will be mainly on the system setup such as PLL setting, pinmux, cache setupm flash setup and etc. The peripherals are the same between the two devices. So the drivers for the peripherals will be common. Do you have experience with HalCoGen yet? What I will suggest is to use the HalCoGen to generate a simple startup file for both the devices and you can examine the subtle differences between the two devices. For example, the LS31s will have a system.c and sys_startup.c while the LC43x will have the HL_system.c and HL_sys_startup.c. I think most of the files generated by HalCoGen will be the same between both the devices. Note that for each xxx.c file generated for LS31x there is an equivalent HL_xxx.c file for LC43x. Once you find the differences between the two you can modify the UART bootloader accordingly.
  • Hi Charles

    Thanks a lot. According to what you said and the spna193.pdf , i am trying to port the project to LC4357 which is used for  LS31x device. 

    I got some problems. Here attachment is my project in ccsv6.2.

    1. in flash_definitons.h file, how to define flash sectors? The  flash memery in lc4357 is larger than lsxx.

    2. define SYS_CLK_FREQ as 300 is right?

    3. which F021 api lib is for lc4357?F021_API_CortextR4_BE or F021_API_CortexR4_L2FMC_V3D16.

    4. here is my cmd file.  Is that right?


    MEMORY
    {

    VECTORS (X) : origin=0x00000000 length=0x00000020
    FLASH_API (RX) : origin=0x00000020 length=0x000014E0
    FLASH0 (RX) : origin=0x00001500 length=0x001FEB00 
    FLASH1 (RX) : origin=0x00200000 length=0x00200000
    STACKS (RW) : origin=0x08000000 length=0x00001500
    RAM (RW) : origin=0x08001500 length=0x0007EB00

    /* USER CODE END */
    }

    /* USER CODE BEGIN (4) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Section Configuration */

    SECTIONS
    {
    .intvecs : {} > VECTORS
    flashAPI :
    {
    ..\Debug\bl_src\Fapi_UserDefinedFunctions.obj (.text)
    ..\Debug\bl_src\bl_flash.obj (.text)
    --library= F021_API_CortexR4_BE.lib < FlashStateMachine.IssueFsmCommand.obj
    FlashStateMachine.SetActiveBank.obj
    FlashStateMachine.InitializeFlashBanks.obj
    FlashStateMachine.EnableMainSectors.obj
    FlashStateMachine.IssueFsmCommand.obj
    FlashStateMachine.ScaleFclk.obj
    Init.obj
    Utilities.CalculateEcc.obj
    Utilities.WaitDelay.obj
    Utilities.CalculateFletcher.obj
    Read.MarginByByte.obj
    Read.Common.obj
    Read.FlushPipeline.obj
    Read.WdService.obj
    Async.WithAddress.obj
    Program.obj > (.text)
    } load = FLASH_API, run = RAM, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)
    .text align(32) : {} > FLASH0 | FLASH1
    .const align(32) : {} > FLASH0 | FLASH1
    .cinit align(32) : {} > FLASH0 | FLASH1
    .pinit align(32) : {} > FLASH0 | FLASH1
    .bss : {} > RAM
    .data : {} > RAM
    .sysmem : {} > RAM

    }

    5. I got bad function location which are in bl_flash.c. like this :

    I will very appreciate for your help.

    Best Regards!

    Jinus

    7563.lc4357_uart_bl.zip

  • Hi Jinus,

     1. You can find the sector information in the datasheet. Below is a snippet.

      

      2. I think you need to use 150MHz instead. The 300MHz is for the CPU (GCLK) clock. However, the flash controller operates at half the frequency HCLK).

      3. You should use F021_API_CortexR4_L2FMC_V3D16.lib or F021_API_CortexR4_L2FMC.lib

      4. You need to replace with the correct library in your command file as indicated in 3) above. 

      5. 

  • Hi Charles,

    Thanks for your help, I have successful run uart bootloader and send bin file to lc4357. But, I've had some other problems.

    1. Very time start user app form bootloader should goes to _c_int00(In user app, created by HalCogen 4.05). It seems that some configrations stop reinit cpu that will cause cpu Abort. If directly goes to main without doing cpu initialization in _c_int00, the app runs good without any problems.How to solve it?

    2. How to create bin file that can download to interalflash directlly via uart port? I now using the tool hex470.exe. The hex file created by ccsv6 (Settings shows blow) is right?

    Thanks!

    Jinus.

  • Hi Jinus,

      Please use the attached example. In the project property go to Steps under Build. See below screenshot. This is how I convert into a bin file. 

    7288.example_rtiBlinky_for_uart_bootloader.zip

    Can you find out the cause of the abort by looking the DFSR (default fault status register) and DFAR (data fault address register) in the CPU?

  • Hi Charles,

    Thanks very much. The bootloader for lc4357 runs well after using the bin file created by ccsv6.  

    Thanks again for your support.

    Regards.

    Jinus