cancel
Showing results for 
Search instead for 
Did you mean: 

STEVAL_MKI062V2 Matlab Wrapper

kevin_hopkins
Associate II
Posted on February 18, 2011 at 00:06

I purchased a MKI062V2 demo board and I am having trouble with the AN3138 Matlab Wrapper provided from st.com. The wrapper is for the V1 but I cannot find one for V2.

The code compiles but only streams zeros. My i32 value at the INEMO_SDK_GetSample command is 4 which means the stack of data is empty.

I have started trying to adjust the iNEMO_SDK.dll to the iNEMO2_SDK.dll but the functions are different. Does anyone know how to communicate with the V2 using the Matlab Wrapper?

#stevalmki062v2 #steval-mki062v2
5 REPLIES 5
comoms
Associate II
Posted on February 19, 2011 at 11:37

Hi Kevin,

i've attached two matlab functions providing connection and disconnection to the device. I'm not sure that that you are looking for these kind of solutions, however i use these functions to run my Matlab algorithm and comunicate with iNemo, maybe they could be useful for you too...

Pay attention to insert in Matlab path the required libraries, specified in the files.

Bye

________________

Attachments :

INEMO_Connection.m : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzXp&d=%2Fa%2F0X0000000bNQ%2FmO6i1tY_ggpIczivoqbzGszP_2uZEqawAKb_H0T.N0o&asPdf=false

INEMO_Disconnection.m : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HzVf&d=%2Fa%2F0X0000000bNL%2FTpZvEv3KYseQPo6NCTHZ1JXHuBpo.FoPGtSCBGM_8pI&asPdf=false
kevin_hopkins
Associate II
Posted on February 20, 2011 at 01:01

Thank you for the example code. Just to test if I could connect, I ran the following

[handle_dev pFD] = INEMO_Connection()

[error5] = calllib('iNEMO2_SDK', 'INEMO2_IsConnect',handle_dev)

I get a return of error5 = 0 so I am still not connecting. The handle_dev value is the same whether the IMU is plugged in or not.

I get a warning: the data type used by structure FrameData_s does not exist. The structure may not be usable. Any pointers?

comoms
Associate II
Posted on February 20, 2011 at 13:50

The warning you get is due to the usage of the latest version of the library, since the functions i have written are tested with an older one. However i tried them with the latest version and, although the warning, they works the same.

Have you set the correct port number in the INEMO_Connection function as specified in the related code?

kevin_hopkins
Associate II
Posted on February 21, 2011 at 00:17

It works! I spent all day fiddling with things so I am not sure what exactly the problem was but it has to do with one of the following:

- The iNEMO application suite and iNEMO SDK have different versions of iNEMO2_SDK.h. I am using the SDK redestrib files.

- My matlab code and the dll and .h file are all in the same folder in :C\

- The iNEMO is plugged in

Anyway, thank you very much for the help, I am excited to start playing with it.

kevin_hopkins
Associate II
Posted on February 21, 2011 at 00:20

And for anyone who has similar problems to mine, I should note that I upgraded the firmware to version 2.0.0.