cancel
Showing results for 
Search instead for 
Did you mean: 

MKI062V1 FW version & BufferUsage function

harinath
Associate III
Posted on May 18, 2011 at 07:48

I'm trying to acces the FW Version & BufferUsage information of iNEMO .

Please have a look at attached .cpp file (works for streaming data from iNEMO) .

The BufferUsage function is very important for me since, I'm going to use iNEMO in Visual studio VC+ MFC environment. 

( It would have been good if DLL generates a message & gives a single frame of data to application )

I also would like to know, when program running if I Reset ( SW1) the iNEMO, I can see no data coming. How to know that the device has been Reset ?

Thanks

#inemo #visual-studio #inemo-sdk-visual-studio #sdk
3 REPLIES 3
Fabio
Associate II
Posted on May 23, 2011 at 11:32

Hi Hanirath,

The SDK has been conceived to work with the board only from software side, without interacting with the hardware.

This means that the SDK is not able to detect a HW Reset on the board, and if occurs after you need  to disconnect and reconnect the board via software.

(Only V2 allow

SW reset functionality with command:  INEMO2_CMD_RESET_BOARD)

Here below, some suggestions for .ccp file:

Regarding the Get version it is better something like:

                char sVersion[256];

                int iSize = 256;

                memset(sVersion, 0, 256);

                INEMO_SDK_GetVersion = (DLLPROC_GFWV)GetProcAddress(hinstDLL,'' INEMO_SDK_GetVersion'');

                if (INEMO_SDK_GetVersion != NULL)

                                iNEMO_Return = INEMO_SDK_GetVersion(sVersion,    &iSize);

               

                if(iNEMO_Return==0)

                                printf(''\n  iNEMO Firmware: %s '',sVersion);

Regarding the get Sample function, please check the return value of INEMO_SDK_GetSampleFunction before use the values in the frame structure:

                                iNEMO_Return = INEMO_SDK_GetSampleFunction(&frame);

                                if (iNEMO_Return == INEMO_ERROR_NONE)

                                {

                                                printf(''\n  T:%5d'',frame.TimeStamp);

                                                printf(''  Ac:%5d %5d %5d  '',frame.Accelometer.X,frame.Accelometer.Y,frame.Accelometer.Z);

                                                printf(''  Gy:%5d %5d %5d '',frame.Gyroscope.X,frame.Gyroscope.Y1,frame.Gyroscope.Y2,frame.Gyroscope.Z);

                                                printf(''  Mg:%5d %5d %5d'',frame.Magnetic.X,frame.Magnetic.Y,frame.Magnetic.Z);

                               

}

Best Regards

iNEMOâ„¢ Team

harinath
Associate III
Posted on May 24, 2011 at 04:22

Hi Fabio,

Regarding the get FW version info , I tried what you said ,though it is not  very important for me, but it returns iNEMO_Return :1

I would like to know one thing regarding get sample function.

when it succeeds (iNEMO_Return =0) , do we have complete frame data ? or incomplete(partially complete) frame ?

Because the INEMO_SDK_GetBufferUsage function gives only percentage of filled FIFO, we cannot depend on this to check if there is enough data(one complete frame) to read the FIFO buffer.

Thanks

Harinath

Fabio
Associate II
Posted on May 26, 2011 at 10:15

Hi Harinath,

Below some suggestions:

1)

      

Check the .h for error code meaning.

2)

      

Yes, only when the function return INEMO_ERROR_NONE the data is valid (else skip it)

3)

      

The GetBufferUsage function is only a test function. If the value grows it means that your application is not enough fast to read all data from the device.

Bye

iNEMOâ„¢  Team