cancel
Showing results for 
Search instead for 
Did you mean: 

CubeProgrammer_API connectDfuBootloader CUBEPROGRAMMER_ERROR_NOT_SUPPORTED

C-Coder
Associate III

I'm trying to test writing my own DFU client and I have the simplest of code to start with, see below:

 

#include <CubeProgrammer_API.h>

int main()
{
	dfuDeviceInfo* dfuList = nullptr;

	// Enumerate the available DFU devices
	int iCount = ::getDfuDeviceList(&dfuList, 0xDF11, 0x0483);
	if (iCount != 1)
	{
		return 0xFFFFFFFF;
	}

	int iResult;
//#define TRY_VERSION_2
#if defined(TRY_VERSION_2)
	dfuConnectParameters params;
	params.usb_index = dfuList[0].usbIndex;
	params.rdu = 0;
	params.tzenreg = 0;
	if ((iResult = ::connectDfuBootloader2(/*m_pDFUDeviceUSBIndex*/params)) != 0)
#else
	if ((iResult = connectDfuBootloader(dfuList[0].usbIndex)) != 0)
#endif /* TRY_VERSION_2 */
	{
		::deleteInterfaceList();
		return 0xFFFFFFFF;
	}

	::disconnect();
	::deleteInterfaceList();

    return 0;
}

 

connectDfuBootloader and connectDfuBootloader2 always return:

 

    /** Operation not supported or unimplemented on this interface */
    CUBEPROGRAMMER_ERROR_NOT_SUPPORTED = -5,

 

I'm building in VS2022, x64 on Win11. The getDfuDeviceList call succeeds. When using CubeProgrammer itself, I can connect to the device as well as download an ELF file (see this thread here - https://community.st.com/t5/stm32cubeprogrammer-mcus/stm32h7-jump-to-bootloader-not-working/td-p/799726)

 

Why would the API be failing?

 

Thanks,

 

C-Coder

1 REPLY 1
C-Coder
Associate III

Additional note: I have tried v2.18 and v2.19. Only x64 as no x86 libs/dlls are being installed.

 

C-Coder