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.

boot loader flash

Other Parts Discussed in Thread: TMS570LS3137

We are developing boot loader for TMS570LS3137 under IAR enviroment.

Question 1: TMS570LS3137 has two flash bank. If my application is on one flash bank, can I write the other flash bank?  Or I need to move my application in RAM before I can perfrom the read/write access of the flash?

 

Question2: For the F021 functions, do they have any directive already to make sure they run the RAM or the user needs to configure in their development to m ake it run in the RAM? If the user needs, in IAR, does

the directive initialize by copy { readonly, readwrite } works for the library as well?

  • Hello Huichin Xing,

    My first suggestion for the best example of how to do a boot loader on this device would be to look at our example boot loader.  In this case, a block is transferred over the supported peripheral (UART, SPI or CAN) into on-chip RAM.  Once the appropriate amount of code is ready for flashing, the F021 Flash API then programs the flash from the contents of the RAM buffers.  This example code should work with any IDE but was developed on TI's CCS.

    Let me know if this helps, Brian

  • Brian,

     

    I did look through the TI sample.

     

    I see the bootloader copies to RAM to run, but is it required or just a implemnettaion method.  TMS570LS3137 has two flash bank. can we execute in one flash bank, and read/write the other. For example If the bootloader is on one flash bank, can I write application code to the other flash bank?  Or bootloader needs to run at RAM to get flash read/write access. (refer spns162b.pdf section 4.10.2 page 75 line 2 from top : Simultaneous read access on a bank while performing program or erase operation on any other bank)

     

    The example uses the packet size 1k for block erase or program. Is it a requirement? what is minimum/max block size for erase and program.

    Fapi_BlockErase( ucBank, FlashDestination, size);

    Fapi_BlockProgram( ucBank, FlashDestination, (unsigned long)buf, packet_length)

    Thanks,

  • The '3137 does have 2 separate banks of flash.  The 'LS31x and 'LS21x  So, it is possible to execute from one bank while programming/erasing the other.  This seems like it could be very cumbersome if you have a need to program/erase either bank as you would need to keep the Flash API stored in both banks and be sure to include the Flash API in any new images that are programmed.  Also, in the '3137 the banks are each 1.5MB as I'm sure you are aware.

    The example uses 1KB because that ended up being the most efficient size when considering both the transfer time by the peripheral and the time needed to subsequently program.  So, no, 1KB is not a minimum requirement.  

    The min size for erase is one sector.  Sector sizes may vary depending upon which part you are using.  Please consult the datasheet for size and mapping.  The max erase size is, of course, one bank.

    For programming, please follow the size allowances supported by the Flash API.  

  • Brian,

    Thanks,

    uint32_t Fapi_BlockProgram( uint32_t Bank, uint32_t Flash_Start_Address, uint32_t Data_Start_Address, uint32_t Size_In_Bytes)

     

    it shows if Size_In_Bytes> 16, the program is based on 16 bytes untill it gets to total Size_In_Bytes .

    it shows if Size_In_Bytes< 16, the program is just for Size_In_Bytes. Can it be 1, 2, 3, 4? The reason I am asking is the data width of flash is 64 bits, so is there s requirement of alighnmnet of 64 bits(8 bytes)?