Hi,
I am currently trying to write a flash programmer uisng the SiUtil.dll file from Silicon Labs.
I am having problems when trying to read the scratchpad memory.
C++ Prototype: extern "C" __declspec(dllimport) int__stdcall GetScratchPadMemory(
BYTE * ptrMem, DWORD wStartAddress, unsigned int nLength);
C#
[DllImport(@"C:\temp\SiUtil.dll")]
public static extern int GetScratchPadMemory(ref byte Data, uint AddressToRead, uint Lenght);
I am sure there is some problems with how I declare this, but I do not know how to fix it.
I hope someone can guide me towards the correct way to do this.
Regards
John-Ove
Loading

Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Aug 29, 2011, 5:02 AM EDT
Are you sure that there is a method GetScratchPadMemory with same signature what you have specified here?
VulpesRank #55 · 29.2K reputationPosted Aug 29, 2011, 5:52 AM EDT
John Larsen18 reputationPosted Aug 29, 2011, 10:05 AM EDT
Are you sure that there is a method GetScratchPadMemory with same signature what you have specified here?
Hi,
Well, I am not 100% sure because the datasheet does not talk about this function BUT in the source code they have supplied the function is there with the same signature. And I do not get an error when building the solution.
If the function had not been there I guess I would get an error message saying that this function has not been found in given DLL file?
Regards
John-Ove
John Larsen18 reputationPosted Aug 29, 2011, 10:06 AM EDT