2025-07-24 1:22 AM - edited 2025-07-31 12:17 AM
Hi,
I am using the STM32CubeProgrammer API (v2.20.0) on Windows 11 using the Visual Studio UART example as a base. Everything works fine, however this issue is slowing down the programming workflow.
After programming the MCU option bytes to RDP1 (or Closed state on some newer devices), there is a long delay (20 to 30 seconds) during the attempts to reconnect to the device. I already expect that the reconnection attempt will fail, so is there a way to reduce the time or number of reconnection attempts? Or a way to cancel the current operation? The time taken for failed reconnection attempts is 2x longer than the actual programming of the MCU.
I noticed that there is a getCancelPointer() function in the API, but I have found no documentation or examples on how to use it. Is it possible to use this or is there some other way?
Edit: Added info - using UART to program the device
/**
* \brief This routine allows to drop the current read/write operation.
* \return 0 if there is no call for stop operation, otherwise 1.
*/
volatile int* getCancelPointer();
2025-07-25 7:41 AM
To add more information, this will be used in a production environment with 3000 to 5000 MCUs programmed every month. That's why the 30 second delay matters.
2025-08-26 6:17 AM
Hello @fma,
You can use the new no reconnect option available in CubeProgrammer v2.20. Example:
sendOptionBytesCmd((char*)"-ob RDP=0xBB noreconnect");
Hope this helps,
Aziz
2025-08-28 2:26 AM
I have tried this on my STM32H5 and there is no error, but it still attempts to reconnect
2026-02-25 2:22 AM
2026-02-25 3:01 AM
I have confirmed that it is fixed when programming STM32WBA
However the issue is still present with STM32H5
2026-04-23 9:18 AM
Just to reconfirm, issue is still NOT fixed for STM32H5.
Hope it will be fixed in the next update, as the delay when programming for me is 2x longer than the actual programming.