cancel
Showing results for 
Search instead for 
Did you mean: 

Can I programme mpu 6050 with STM32L011F4 using cubex and keil?

Posted on March 12, 2018 at 19:15

I am unable to programme mpu 6050 using stm32l011f3. Can anyone help me?

I also tried programming with nucleoL011k4 board 

Using mbed cli,keil and mbed cloud. But it does not work.

I am guessing the memory is not enough.

4 REPLIES 4
Andrew Neil
Evangelist
Posted on March 12, 2018 at 19:23

You mean this:

https://www.invensense.com/products/motion-tracking/6-axis/mpu-6050/

https://www.invensense.com/wp-content/uploads/2014/12/mpu-6000-family-diagram.png

As that diagram shows, you just need an I2C or SPI connection.

I am guessing the memory is not enough.

What memory, and why do you think it's insufficient?

EDIT

Invensense support:

https://www.invensense.com/developers

Posted on March 12, 2018 at 19:54

I think that roughly translates to 'I took someone else's code, that I didn't write, and I don't understand, and I jammed it in some tools... and it didn't work'

My guess is that you have very little grasp of what you're doing, so helping you is going to be really difficult. Are there people around you to help you with this project?

Did the compiler/linker complain about a lack of memory?

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on March 12, 2018 at 23:46

I looked on mbed site, there they have a library for the device:

https://os.mbed.com/users/moklumbys/code/MPU6050/docs/9b414412b09e/classMPU6050.html

 

and on their forum is an application

https://os.mbed.com/forum/mbed/topic/4247/

 

Now, I don't know how much flash space that stm32 micro has... the code generated by mbed using Arduino libraries is huge.

Probably he can't switch the board and want a C variant of the code, something more compact that can fit...

John Craven
Senior
Posted on March 13, 2018 at 15:24

You should be able to use the 6050 with that processor.

I started with this 6050 library;

https://github.com/Harinadha/STM32_MPU6050lib

 

I made some minor changes to it.

Mainly i converted the i2c calls from SPL to HAL.

I also added some functions to allow DMA based reads on some calls that return the typical runtime of gyro/accel values.

Using this i made a very simple app, that reads a UART stream of servo positions and modifies those control values based on the 6050 and outputs stabilized PWM on a timer.

On a F303, and uses 11K of flash.

I did it with HAL which doesn't produce the smallest code.

You have 16k of flash. It can be done. It can be done smaller than i did it.