Skip to main content
MSSloan1962
Associate III
Sep 30, 2025 8:52 AM UTC
Solved

Getting -16 when trying to connect to a Boot Loader device

Where can I find the meaning of the returns from connectDfuBootloader? I'm getting -16 back and would like to know what it means.

 

Pavel A.
Pavel A.Best answer
Oct 1, 2025 3:21 AM UTC

Check enum cubeProgrammerError in CubeProgrammer_API.h.

CUBEPROGRAMMER_ERROR_RDP_ENABLED = -16

8 replies

Amel NASRI
ST Technical Moderator
Sep 30, 2025 11:46 AM UTC

Hi,

Where exactly can you find the mentioned command or function? It is likely not an ST-delivered tool or firmware.

Generally, to understand how the DFU bootloader works, refer to the application note AN3156 USB DFU protocol used in the STM32 bootloader.

-Amel

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
MSSloan1962
Associate III
Sep 30, 2025 11:54 AM UTC

We're using the connectDfuBootloader entry point into CubeProgrammer_API.dll. A successful connection returns 0. What possible errors are returned and what do they mean? I've seen -5 and -16 so far

Amel NASRI
ST Technical Moderator
Sep 30, 2025 4:45 PM UTC

I move your question to STM32CubeProgrammer dedicated forum and I let our expert @Aziz BRIGUI review your request there.

To give better visibility on the answered topics, please click on "Best Answer" on the reply which solved your issue or answered your question.
Pavel A.
Pavel A.Best answer
Oct 1, 2025 3:21 AM UTC

Check enum cubeProgrammerError in CubeProgrammer_API.h.

CUBEPROGRAMMER_ERROR_RDP_ENABLED = -16

MSSloan1962
Associate III
Dec 2, 2025 10:10 AM UTC

I assume RDP means Remote Desktop Protocol. Is there any means for disabling it programmatically with C#? How would it get enabled? I'm pretty sure I'm not enabling it with my program

MSSloan1962
Associate III
Dec 2, 2025 10:58 AM UTC

I tried "–ob rdp=0x0" but got a -1 result, meaning Not Connected. So I'm in a situation where I can't connect because I'm getting -16 (RDP enabled) and I can't disable RDP because I'm not connected

Aziz BRIGUI
ST Technical Moderator
Dec 3, 2025 3:58 PM UTC

Hello @MSSloan1962,

You can disable RDP 1 by a debug connection (ST-Link or JLink) or by the read unprotect command via bootloader interfaces :

AzizBRIGUI_0-1764777434794.png

Could you detail the case where RDP was set to 1 ? Can you reproduce it with your API project, if yes please share your code and detailed steps to reproduce.

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.
MSSloan1962
Associate III
Dec 2, 2025 11:31 AM UTC

I've now found that RDP stands for Readout Protection