AnsweredAssumed Answered

Accessing ST Dfuse DLL with C#

Question asked by mueller.jonas on Apr 12, 2012
Latest reply on Jan 18, 2013 by mclean.mark
To integrate firmware update functionality into a custom c# application I start to use ST Dfuse dll from c#. I managed to enumerate and identify the device (UM0392 - 3.1 and 3.2) but now get stucked  while trying to erase the device. Out of the manual:

DWORD OperationCode;
PDWORD pNbAlternates;
PMAPPING pMapping;
PHANDLE pHandle;
// Programming the operation contex
lstrcpy(Context.szDevLink, DFUName);
Context.bDontSendFFTransfersForUpgrade= TRUE;
STDFUPRT_CreateMappingFromDevice((LPSTR)(LPCSTR)DFUName,&pMapping, &NbAlternates);
STDFUFILES_CreateImageFromMapping(pHandle, pMapping);
STDFUFILES_FilterImageForOperation(hImage, m_pMapping+TargetSel,
if( STDFUPRT_LaunchOperation(&Context, &OperationCode) != STDFUPRT_NOERROR)
Printf(‘Erase error’);

The call of STDFUPRT_LaunchOperation() does always return a STDFUPRT_BADPARAMETER error.

Is there a way to get some more information about this error? Which parameter is bad?

The first parameter in LaunchOperation() is a pointer to the struct DFUThreadContext. I rebuilt this struct in c# using the information given in UM0384.pdf chapter 4.3.4. My UM0384 is revision 1 - June 2007 - wonder if that user manual is still up-to-date?!?
I did not find UM0384 on the webpage (my copy is out of the package Does anyone have a newer one?

Thanks in advance for any help