Other Parts Discussed in Thread: UNIFLASH
Tool/software:
Hello,
If I need to erase the OSPI flash on the TMDS64EVM board, what python command should I use ?
Thanks,
Huynh
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.
Hi,
Just to confirm if you want to erase the flash contents via the python command where we pass a configuration file .cfg and transfer via uart uniflash or via application level?
Regards,
Vaibhav
Both is better. If not then the prior method (python) is OK.
Doing it from application is pretty straight forward, where you call the top level function: Flash_erase. To look at a sample implementation please checkout the example by reading through the following links:
Now coming to erasing via python command, the way to go about doing it would be writing few parameters in the .cfg file which is present under C:\ti\mcu_plus_sdk_am64x_11_00_00_15\tools\boot\sbl_prebuilt\am64x-evm
Assuming you were using the .cfg file named as: default_sbl_ospi.cfg
You would need to write the following line:
1. "where you call the top level function: Flash_erase". Only
Hi,
1. "where you call the top level function: Flash_erase". Only
int32_t Flash_eraseBlk(Flash_Handle handle, uint32_t blockNum);and/orint32_t Flash_eraseSector(Flash_Handle handle, uint32_t sectorNum);to be found in flash.h
The function call which you want to use depends on the mode your Flash is configured in.
Currently in the MCU PLUS SKD drivers, by default it is configured to work for Uniform mode and not Hybrid mode.
To understand more about these modes that is Uniform vs Hybrid Mode, please refer the following FAQ: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1492859/faq-am62x-am62px-am62d-q1-am64x-am243x-4kb-sector-erase-fails?tisearch=e2e-sitesearch&keymatch=faq%3Atrue
So, if the flash is operating in Uniform mode, then the answer would be to use erase block API else for Hybrid mode, erase sector can be performed for few addresses of the flash and erase block can be performed for the remaining addresses of the flash.
Hope this helps answer your doubt.
2. Is it correct 3 commands in default_sbl_ospi.cfg for python command of flash erase ?--flash-writer=sbl_prebuilt/am64x-evm/sbl_uart_uniflash.release.hs_fs.tiimage# Program the OSPI PHY tuning attack vector--operation=flash-phy-tuning-data# Flash erase--operation=erase --erase-size=0x4000000 --flash-offset=0x0
I am assuming you want to do full flash erase, like the size provided is 64 MB.
Well this would mean, that the line just above that would lead to firstly writing the phy tuning data and then erasing the entire flash, hence no use of the above line as of now.
Also erasing at the 0x0 offset is okay.
To understand about what the flash phy tuning data line does, please refer the following FAQ: e2e.ti.com/.../faq-sk-am64b-what-is-the-purpose-of---operation-flash-phy-tuning-data
Regards,
Vaibhav