Windows 10 Visual Studio SDK problem
I am trying to make headway with the SDK samples.
The precompiled sample works just fine and does what I would expect it to do.
However, when trying to run the app through debug i get a PInvokeStackImbalance.
The error occurs on all commands that require information to be passed to or from the IO Pins.
has anyone come across this issue before?
To go into a little more detail.
AAEON Framework Driver V 18.104.22.168
Hi-Safe is installed Version 2.2018.01.11
Under Vb.net have tried
Declare Function EApiPwmSetValue Lib "aaeonEAPI.dll" (byval device as uint32, byval baseUnitInt as UInt32, byval baseUnitFrac as UInt32, ByVal BaseDutyCycle as UInt32) as Integer
Declare Function EApiPwmSetValue Lib "aaeonEAPI.dll" (byval device as uint32, byval baseUnitInt as UInt32, byval baseUnitFrac as UInt32, ByVal BaseDutyCycle as UInt32) as Uint32
Declare Function EApiPwmSetValue Lib "aaeonEAPI.dll" (<In, MarshalAs(UnmanagedType.U4)> byval device as uint32,
<Out, MarshalAs(UnmanagedType.U4)> byval baseUnitInt as UInt32,
<Out, MarshalAs(UnmanagedType.U4)> byval baseUnitFrac as UInt32,
<Out, MarshalAs(UnmanagedType.U4)> ByVal BaseDutyCycle as UInt32) as Integer
The error is the same on each variant, with the the PInvoke function unbalancing the stack, stating that the the PInvoke signature does not match the the unmanaged target signature. But in the Header file it states:
__IN EApiId_t Id, /* PWM Id /
__IN uint32_t PWMBaseUnitInt, / PWM Base Unit Integer /
__IN uint32_t PWMBaseUnitFrac, / PWM Base Unit Integer /
__IN uint32_t PWMDutyCycle / PWM Base Unit Integer */
So the command is expecting UInt32 on each of the four variables, so this should in theory work.
Any clues or suggestions would be great.
I'm starting to wonder if any technical support exists..............
OK I have an answer to the solution:
<DllImport("aaeonEAPI.dll", EntryPoint:="EApiPwmSetValue", CallingConvention:=CallingConvention.Cdecl)> Public Shared Function EApiPwmSetValue(ByVal device As UInt32, baseint As UInt32, basefrac As UInt32, duty As UInt32) As UInt32 End Function
This method of calling the DLL works and the IO functions.
However, with the Digital I/O it takes 159ms to set a pin high or low, which seems excessive.
- 303 All Categories
- 104 Announcements & News
- 52 Product News - New Product/Product Change Notice/ End-of-life
- 184 Welcome Developers!
- 53 Unboxing & Project Sharing
- 24 Tech Updates
- 590 UP Products
- 6 UP Xtreme i12
- 1 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 13 UP Squared V2
- 41 UP 4000
- 24 UP Xtreme i11
- 34 UP Squared 6000
- 48 UP Squared Pro
- 140 UP Xtreme
- 826 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 221 UP Core
- 3 UP Xtreme Lite
- 44 UP AI Edge
- 215 Starter Kits & Peripheral