Hi,
for STM32MP family, we did not talk about 'chip' erase (as for MCUs with embedded Flash) but 'Flash' erase (Flash is external to the chip).
It is usually not needed using the provided Flashlayout.
Anyway, if you really want to erase the memory before flashing, one way to acheive this is to replace the 'P' options in the existing flashlayout by 'PD'.
e.g. for EV1 board, Trusted Starter Package on SD-Card:
#Opt Id Name Type IP Offset Binary
- 0x01 fsbl1-boot Binary none 0x0 arm-trusted-firmware/tf-a-stm32mp157f-ev1-usb.stm32
- 0x03 fip-boot Binary none 0x0 fip/fip-stm32mp157f-ev1-trusted.bin
PD 0x04 fsbl1 Binary mmc0 0x00004400 arm-trusted-firmware/tf-a-stm32mp157f-ev1-sdcard.stm32
PD 0x05 fsbl2 Binary mmc0 0x00044400 arm-trusted-firmware/tf-a-stm32mp157f-ev1-sdcard.stm32
PD 0x06 fip Binary mmc0 0x00084400 fip/fip-stm32mp157f-ev1-trusted.bin
PD 0x10 boot System mmc0 0x00484400 st-image-bootfs-openstlinux-weston-stm32mp1.ext4
PD 0x11 vendorfs FileSystem mmc0 0x04484400 st-image-vendorfs-openstlinux-weston-stm32mp1.ext4
PD 0x12 rootfs FileSystem mmc0 0x05484400 st-image-weston-openstlinux-weston-stm32mp1.ext4
PD 0x13 userfs FileSystem mmc0 0x33E84400 st-image-userfs-openstlinux-weston-stm32mp1.ext4
But as Flash erasing take long time (especially the big userfs partition), in order to avoid timeout with CubeProgrammer GUI (fixed timeout), you should use STM32_Programmer_CLI (same functionality but on command line) and add '-tm 120000' to increase the timeout to allow the erase sequence to complete (here 120 seconds is enough for a 16GB SD-Card).
e.g. on Windows 10, for EV1 board, Trusted Starter Package on SD-Card:
STM32_Programmer_CLI.exe -c port=usb1 -w flashlayout_st-image-weston\trusted\FlashLayout_sdcard_stm32mp157f-ev1-trusted.tsv -tm 120000
Regards.