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.

TI Fee Driver API TI_Fee_EraseImmediateBlock on TMS570LS1227

Other Parts Discussed in Thread: HALCOGEN, TMS570LS1227

I am using the TMS570LS1227 flash bank 7 as data strorage,thus I connfig the fee by HALCoGen,as I have more then 16 data to storage ,I rewrite ti_fee_cfg.c and fee_cfg.h file .

During the test I can read,write the block and erase all the block with TI_Fee_Format(0xA5A5A5A5U),when I only want  to erase some  blocks ,I use  TI_Fee_EraseImmediateBlock(),but it seemed it do not work.

I upload the code and the Memory View picture as below.

Only the first time I call the api it return E_OK,the other time it return E_NOT_OK,and the the block data is keep still ,do not erased from the flash.

Hope you guys can help me,thank you!

  • Are all the blocks that you are invalidating already valid? (EraseImmediateBlock marks the block as invalid.) What is returned if you do a call to TI_FeeErrorCode() after getting an error on the TI_Fee_EraseImmediateBlock call?
  • Hi,

    If you want to use EraseImmediateBlock to invalidate a block , you will have to set "Enable Block(1) Immediate" option in FEE Bloack Configuration tab in HALCogen.

    Alternately, you could use TI_Fee_InvalidateBlock to Invalidate a block.
  • I'm so sorry for this late

    I printf the error code ,all error code is 6,which means block invalid

  • I'm so sorry for this late,Thanks for you help!

    I set all the "Block Immediate data used" as TRUE in the ti_fee_cfg,and afte that  EraseImmediateBlock did work.

    Now I can use EraseImmediateBlock  to invalidate any block ,at first I thought EraseImmediateBlock  will ERASE the flash data,but truth is it only invalidate a block.

    So if I want to ERASE the data on the Flash,I have to use TI_Fee_Format(),is it right?

  • Calling TI_Fee_Format will erase all of the virtual sectors, but any information stored in the blocks will be lost. It is not necessary to explicitly erase the flash data stored in the FEE. As you update data in a block, the old data is marked as invalid and the new data is written to a previously blank portion of the sector. When one virtual sector is full, the data is copied to another virtual sector and the first virtual sector is marked for erase. The erase is taken care of by the TI_FeeInternal_FeeManager() function in the background when no other FEE operation is pending.