This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2650 SensorTag MPU9250 DMP eMPL 6.12

Other Parts Discussed in Thread: CC2650

Hi. I've adapted the eMPL library for the MPU9250 from invensense. To be used with the CC2650 in the sensor Tag.

The only thing the CC2650 does is process the MPU information, there's no BLE stack, nor other sensors. I mean, I've ported the eMPL lib from ARM4 to the ARM3 CC2650.

Everything compiles without error and loads the same way. It responds to MPU interrupts and uart rx to change the DMP modes.

I haven't removed the code defines for other sensors like the MPU9150 nor other uC like the MSP430.

At this moment the code requieres 110K of Flash = 84% and 12.7k of Sram = 62%.

I understand that invensense has created all functions that the user could need, we can remove all of those that we don't need. For example I'll work only with quaternions, so I can put aside the Tap orientation, pedometer...

Problems:
Until now I'm running the code with the dev-pack 1.2 CC-DEVPACK-DEBUG, it print's the code log's to the CCS console, for sure this is making my code seems slower. The uart is the one created by the dev-pack.

I haven't tested directly with the battery, the reason is that my batt ran out and also, I'll have to wire a usb port to serial to the CC2650 uart pins. I reduced the uart speed to 9600, another speed bricks the execution, maybe the pack only supports this baud rate.

Somer uart calls, make the code to throw exceptions, for example calling the auto test.

The pedometer lags when measuring the steps.

The code almost always ends with this output

FSR = 0x0001
HFSR = 0x40000000
DFSR = 0x00000001
MMAR = 0xe000ed34
BFAR = 0xe000ed38
AFSR = 0x00000000

Error thread

https://e2e.ti.com/support/embedded/tirtos/f/355/p/518943/1886064#1886064

In a moment I'll upload a video, to show the angle offset.

You can find my code here in github. I'll appreciate any contribution or fix that you can
write here or push to my repository.

https://github.com/EinSoldiatGott/eMPL-python-CC2650

If you test directly with the battery please let me know how it works.

Once I upload the video I'll start a new repository fork that only throws the quaternions.

Recomendations:
To be honest, until now I haven't liked the dmp performance, it took me a lot of work to have it working and it gets stuck, has drifting, angle offset...

Also I don't like the lack of information and support from invensense, they don't explain what and why are we writting to the registers, I wrote them here without answer. Here  and by email.

At this moment I don't know if the angle offset is coming from the DMP (where I cannot do anything) or if it's a overflow in the MPL lib calculations, or wrong calculated offset...

Videos

https://youtu.be/xbpfuHIj8J4

I hope you can find my lib useful and maybe bring some contribution.

My best regards

  • Hello,

    Thanks for sharing your project! May I suggest that you also post on a site, such as Hackster.io, for wider exposure?

    Best wishes
  • Exception termination fixed by adding the M3 library
    Stack overflow fixed by increasing stack size to 2k
    Added pintf %f to BIOS
    run_self_test always throws Gyro error, I've tried many orientations
  • Hi, How can I display the results (3 D view)? Could you please share the Python code?

    Thanks.

  • Hi,

         Thanks for sharing project. The project looks to be working fine.
    But when i run python code as mentioned , i get following error:

    ---------------------------------------------------------------------------------------------------------------------------

    C:\Users\admin>python.exe F:\Invsense\motion_driver_6.12\eMPL-pythonclient\eMPL-
    client.py 4
    File "F:\Invsense\motion_driver_6.12\eMPL-pythonclient\eMPL-client.py", line 5
    8
    print "no handler for pkt_code",pkt_code
    ^
    SyntaxError: Missing parentheses in call to 'print'

    C:\Users\admin>

    -------------------------------------------------------------------------------------------------------------------------------

    Can you please help me to correct this.

    Regards

    Vinay

  • I Realized that i am using python 3 and it does not support older ver2 hence changed print with brackets and also installed python serial and pygame packages. after that python errors looks to be solved. But after running get this following error :
    ------------------------------------------------------------------------------------------------------------------------
    F:\Invsense\motion_driver_6.12\eMPL-pythonclient>python.exe eMPL-client.py 4
    Traceback (most recent call last):
    File "eMPL-client.py", line 543, in <module>
    data_delegate = data)
    File "eMPL-client.py", line 23, in __init__
    self.s = serial.Serial(port,115200)
    File "C:\Users\admin\AppData\Local\Programs\Python\Python35-32\lib\site-packag
    es\pyserial-3.1.1-py3.5.egg\serial\serialwin32.py", line 31, in __init__
    File "C:\Users\admin\AppData\Local\Programs\Python\Python35-32\lib\site-packag
    es\pyserial-3.1.1-py3.5.egg\serial\serialutil.py", line 162, in __init__
    File "C:\Users\admin\AppData\Local\Programs\Python\Python35-32\lib\site-packag
    es\pyserial-3.1.1-py3.5.egg\serial\serialutil.py", line 206, in port
    ValueError: "port" must be None or a string, not <class 'int'>

    F:\Invsense\motion_driver_6.12\eMPL-pythonclient>
    ------------------------------------------------------------------------------------------------------------------------------

    Please help.

    Regards
    Vinay
  • I could able to correct this error also, by changing comport=sys.argv[1] and mentioning as COM4 port.
    But i am not getting any output from command window and also from pygame window. I can see that COM4 port is acquired by python program.
    Can you please help us with your code , so that we can see output as in video. I am using python 3.5.
  • I have the same error. I am using TI CCS v7.0 on Arch Linux and using TI 16.9.0 LTS to build it. I always keep getting accel and gyro failed no matter what orientation
  • No not yet.

    Invensense was kind enough to help, they said "We can't help you, it might be a platform issue"

    Which might be correct because the same code works wonderfully on my Xpresso 11U68 board with MPU9250.

  • I'm again with this project I'll update if I make it work