platform-ststm32
platform-ststm32 copied to clipboard
Implement `upload_resetmethod` option for stlink upload
The ST-Link upload fails with some clones of the ST-Link device, because they do not support the reset pin properly. This results in the error Error: timed out while waiting for target halted during upload. See e.g. #168.
The issue can be solved by changing OpenOCD's reset_config option. People in various threads do this by modifying the board configuration files on their system, which is obviously not a portable solution.
This commit allows to specify an upload_resetmethod option in platformio.ini, which is forwarded as the reset_config option to OpenOCD. The option with the same name already exists for the Espressif 8266 platform and does something similar there. It is documented here.
@ivankravets @valeros Sorry to ping you, but there has been no feedback on this (as well as other pull requests in this repository) for a long time.
Is this change considered for getting merged? Is there anything I should change in order to get it merged?
I would also apprecitate this being merged as it is required to upload with the clone ST-Link devices.
Using @saierd PR branch worked for me:
[env:distance_v1]
platform = https://github.com/saierd/platform-ststm32.git#upload_resetmethod
debug_tool = stlink
upload_protocol = stlink
upload_resetmethod = none separate
As it only adds support for an option I would not expect any regresion for anyone else.
@saierd - could you please update you branch with the latest commits - it is behind the upstream so it is missing some updates. Thanks!
@angelnu I have rebased my branch.
I would also still like to get this merged. Unfortunately I never got any feedback on it. It seems like most of the PRs in this repository are not looked at.
Thanks @saierd . You might want to, if not done already, try posting in the platformio forum. The PRs usually tet discussed there.