stm32duino / Arduino_Tools

Contains upload tools for STM32 based boards
Other
89 stars 64 forks source link

[STM32CubeProg.sh] mass erase bug #81

Closed olikraus closed 2 years ago

olikraus commented 2 years ago

Followup for https://github.com/stm32duino/Arduino_Core_STM32/issues/1637

Problem: Some devices (at least the STM32G031J6) require a full mass erase for proper uploads. However the mass erase is not executed due to a problem in STM32CubeProg.sh

Fix: The mass erase is already foreseen here: https://github.com/stm32duino/Arduino_Tools/blob/d0ccf253d7109a4f79e37114f70f8f604c1262d6/stm32CubeProg.sh#L141 However, the sh syntax is not correct. In order to apply "-e all" in case of an empty "ERASE" variable, the "-" sign must be used:

${STM32CP_CLI} -c port=${PORT} ${MODE} ${ERASE:-"-e all"} -q -d "${FILEPATH}" ${ADDRESS} "${OPTS}"

fpistm commented 2 years ago

Already answer in https://github.com/stm32duino/Arduino_Core_STM32/issues/1637

@olikraus please avoid to open several issues while we investigate the first one.