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.

TMS570LC4357: How to implement Erase/write the whole flash banks(0&1)

Part Number: TMS570LC4357
Other Parts Discussed in Thread: TMS570LS1114

Hello ti,

I took the reference from TMS570LS1114 and it is having only one Flash bank(i.e., Flash bank0).

But currently i'm working in TMS570LS4357 and it is having 2 Flash Banks(i.e., Flash bank 0&1).

I configured only one bank and Its working fine with previous code written for TMS570LS1114. But now my requirement is, I need to Erase/Write on both the flash bank(0&1).

I read the library manual. And I found that, I need to set the active flash bank whenever I perform the switch. So, How it can be implemented?

Could you help me in this?

Thanks!!

BR

Vigneshwar

  • Hello Vigneshwar,

    1. You need to set the active bank: 0 or 1
    Fapi_setActiveFlashBank(0); for bank 0
    or Fapi_setActiveFlashBank(1); for bank 1
    2. enable the bank sector:
    for example, Fapi_enableMainBankSectors(0xFFFF);
    3. Then erase the sector in bank 0 or bank 1 using the address of the sector:
    Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector, sector_address);

    Or erase the whole bank using:
    Fapi_issueAsyncCommandWithAddress(Fapi_EraseBank, bank_address);

    4. The program the code to bank0 or bank 1 using address:
    Fapi_issueProgrammingCommand((uint32_t *)dst, (uint8_t *)src, (uint32_t) bytes, ...);
  • Hello QJ Wang,

    Thanks for your response!!

    Yes. I have implemented the same!!

    From my understanding, after I read the library reference manual,
    "So. . .for example, if I'm performing flash operation in bank0 and if need to perform flash operation in bank1, Then first I need to set the active bank as 1 , Second I need to enable the bank sector, And Finally I need to Erase/Write.

    So If I need to switch from one bank to another bank, I need to follow the sequence repeatedly."

    For this I need to check the address each time on which bank it falls and should make the decision. So I was asking for this implementation. And to verify my perspective of understanding.

    Now its clear!!

    Thanks!!


    Best Regards,
    Vigneshwar.