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.

CCS: About Question : Using F021 Flash API - Flash write

Other Parts Discussed in Thread: TMS570LC4357

Tool/software: Code Composer Studio

I use TMS570LC4357 chip with development kit.

I want to make boot-loader. So I do some test by using the Source code which download in this link()

In this code, I test write some code in Flash. I can write the bank 1 area (address 0x00200000 ~ 0x00400000) but I cannot write in bank 0 area (address 0x00000000 ~ 0x00200000)

so, I try to change the code in "flash_defines.h". But i cannot write in address(0x00000000 ~ 0x00200000).

How can I write in address(0x00000000 ~ 0x00200000).? (In detail, I want to flash write test except boot-loader area.)

Regards,

Minwoo

  • Hello Minwoo,

    All of the Flash APIs that program, erase, blank check or margin verify must be called from a bank other than the one in which code is being executed. If programming or erasing bank 0 of the device which has only one flash bank, these routines must be executed in RAM.

  • Hello QJ Wang,

    The bank is fixed as chip (by hardware dependance). Then, I cannot change the "flash_defines.h"  in source code (bank area)?

    If I want to read/write all flash area in TMS570LC4357, The bootloarder code is executed in RAM?

    Regards,

    Minwoo

  • Hello Minwoo,

    If you program the application code to the sectors in bank 0 ( same bank of bootloader), you have to copy the flash API related code in bootloader to SRAM to execute from SRAM.

    If you program the application code to bank 1, you don't need to copy the code to SRAM.

  • Hi QJ Wang,

    Thanks for your answer. But I have a problem to act "flash API" as copy from flash to Ram.

    I want to act "flash API" copy from Rom to Ram - I want to write Flash both bank 0 and bank 1. (Using Chip : TMS570LC4357)

    I do as followes, but Prefetch abort is occurred.

    1. I copy flash APi in flash to Ram by refer to this link :

    2. I check the flash API code is exist in RAM area (by .map file)

    3. When the function is called, Prefetch abort is occurred.

    I wonder there are any addtional settings to copy flash to ram

    Regards,

    Minwoo

  • Hello Minwoo,

    Please use this link to download the CAN bootloader for TMS570LC43x. The linker cmd file is located in device folder, and main.c is located in ./source folder.