cancel
Showing results for 
Search instead for 
Did you mean: 

problem with dfuse

dsouzahansen
Associate II
Posted on August 12, 2011 at 10:20

Hi,

   I am currently developing a PC application for STM32 using Inemo board.The PC application will be able to upgrade the firmware of the STM32 using Dfu mode.

Iam using Visual studio Vb.net for the PC side application.

I have succedded in enemurating my device and getting a symbolic link to the device and Im able to read the DFU Functional descriptor.

However Iam unable to do upgrade because the variables used in VB are quite different somehow from the C++ ones.And since I cannot really have byte arrays in structure I have to create consequtive memory regions by placing many bytes one after each other

Has anyone linked the dlls using vb.net?

Iam facing problem with  ''STDFUPRT_CreateMappingFromDevice'' to this function I have passed a string of symbolic device link as the first parameter and for the second parameter Iam passing a reference to a structure which has 283 bytes.On return I get a no-error response but my structure values are all corrupted and doesnot indicate any useful information.The third parameter is simply a reference to a integer and its filled with a value one so i guess this is right

I have also tried filling name[] array with device symbolic link but it always returns corrupt values.

After calling the function the bytes of the mapping structure are affected as under

The first byte is A8

The first byte is 9a

The third byte is 92

Also in the manual ''UM0384 Dfuse application programming interface'' the MAPPING structure shows that pointer to structure has 18 bytes.Whereas MAPPING SECTOR has 19 bytes in total is this a typo?

2 REPLIES 2
Nickname12657_O
Associate III
Posted on August 14, 2011 at 01:51

Hi,

Here is an example in C++

PMAPPING  m_pMapping;

DWORD m_NbAlternates;

STDFUPRT_CreateMappingFromDevice((LPSTR)(LPCSTR)TmpDev[m_CurrentDevice], &m_pMapping, &m_NbAlternates)

where TmpDev is an array of symbolic links of enumerated DFU devices

after calling that function : m_pMapping and m_NbAlternates will be filled and initialized with values coming from the device.

PMAPPING is a pointer to the following structure :

typedef struct {

 BYTE   nAlternate;

 char   Name[MAX_PATH];

 DWORD   NbSectors;

 PMAPPINGSECTOR pSectors; 

} MAPPING, *PMAPPING;

with

typedef struct {

    DWORD  dwStartAddress;

 DWORD  dwAliasedAddress;

 DWORD  dwSectorIndex;

 DWORD  dwSectorSize;

 BYTE  bSectorType;

 BOOL  UseForOperation;

} MAPPINGSECTOR, *PMAPPINGSECTOR;

I'm not familiar with VB.net, I hope that you will able to find your problem with these data.

Cheers,

STOne-32.

Wood.Andy
Associate III

Did you ever get it to work as it looks like I will have to do a VB Net DFU.

Andy.