Skip to main content
MSSloan1962
Associate III
September 30, 2025
Solved

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

  • September 30, 2025
  • 5 replies
  • 398 views

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

 

Best answer by Pavel A.

Check enum cubeProgrammerError in CubeProgrammer_API.h.

CUBEPROGRAMMER_ERROR_RDP_ENABLED = -16

5 replies

Amel NASRI
Technical Moderator
September 30, 2025

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 Accept as Solution on the reply which solved your issue or answered your question.
MSSloan1962
Associate III
September 30, 2025

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
Technical Moderator
September 30, 2025

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 Accept as Solution on the reply which solved your issue or answered your question.
Pavel A.
Pavel A.Best answer
Super User
October 1, 2025

Check enum cubeProgrammerError in CubeProgrammer_API.h.

CUBEPROGRAMMER_ERROR_RDP_ENABLED = -16

MSSloan1962
Associate III
December 2, 2025

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
December 2, 2025

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
Technical Moderator
December 3, 2025

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
December 2, 2025

I've now found that RDP stands for Readout Protection