cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeProgrammer API - Canceling current operation or disable reconnection attempt

fma
Associate II

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();

fma_1-1753345297625.png

 

 

3 REPLIES 3
fma
Associate II

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.

Aziz BRIGUI
ST Employee

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


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

I have tried this on my STM32H5 and there is no error, but it still attempts to reconnect

fma_0-1756373108664.png