For example adding a platform.local.txt with:
tools.stm32CubeProg.upload.pattern="{path}/{cmd}" 1{upload.protocol} "{build.path}/{build.project_name}.bin" {upload.options}
will allow to erase all sectors before download.
Signed-off-by: Frederic.Pillon <frederic.pillon@st.com>