stm32duino / Arduino_Tools

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

STM32CubeProg.sh(Erase memory when using DFU) #98

Closed narzul closed 3 months ago

narzul commented 4 months ago

Programming problems when using DFU.

Added

fpistm commented 3 months ago

Hi @narzul It seems more a workaround than a real solution. Erasing the whole flash each time will reduce life of the flash cycle. Which board you used?

narzul commented 3 months ago

Greetings @fpistm The board that I'm currently working on is the adafruit stm32f405. However this is a persistent problem for all stm32f4xx chips when programming using DFU. It is also a general problem for many other stm32 chips, when programming using DFU.

But if you think that this is something that should be addressed a different place, would you be able to point me in the right direction, so I can write a fix there.

fpistm commented 3 months ago

I have the Adafruit F405 and never had this issue same for other series. Which version of cubeprogrammer you used?

narzul commented 3 months ago

I'm running STM32CubeProgrammer v2.16.0

fpistm commented 3 months ago

Hi @narzul Since the script was reworked, see https://github.com/stm32duino/Arduino_Core_STM32/pull/2323 and #97 .

The simplest way is to use the boards.local.txt

# Add erase option to dfu upload method, --erase could also be used
GenF4.menu.upload_method.dfuMethod.upload.options=-v {upload.vid} -p {upload.pid} -e