Initialization of sensor fusion sometimes hangs in MPL3115_Init ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Initialization of sensor fusion sometimes hangs in MPL3115_Init ?

Jump to solution
1,426 Views
remibeges
NXP Employee
NXP Employee

I have noticed from time to time my application hangs on startup using the sensor fusion. I first suspected my code but then I noticed something.

After several seconds of execution, pausing the execution with the debugger reveals that the program is looping forever in MPL3115_Init, waiting for I2C callback to send the 'sent' flag

 

67480_67480.pngUntitled.png

 

Debugger shows that MPL3115_I2C_Error is 0

 

I am using KL46Z

My code is not interacting with any of the sensors or I2C so far.

Any idea of what is going on ?

Labels (1)
0 Kudos
Reply
1 Solution
1,049 Views
michaelestanley
NXP Employee
NXP Employee

J7 on the shield is the jumper I was referring to.  It's right next to the Bluetooth module.

And yes, bad solder joints can also have the symptoms you describe.  And I guarantee the software will hang if you remove the shield.

View solution in original post

0 Kudos
Reply
8 Replies
1,049 Views
michaelestanley
NXP Employee
NXP Employee

Which sensor board are you using?  The 9-axis board does not include an MPL3115A2.  If you have a 9-axis board, or don't need the MPL3115A2 for your app, comment out the line that says "#define USE_MPL3115A2" in build.h.

0 Kudos
Reply
1,049 Views
remibeges
NXP Employee
NXP Employee

Hi Michael, I am using this board, it does include the MPL_3115A2 :

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-FXS-MULT2-B

So far my application exchanges data with the computer through bluetooth serial port, and weirdly, the issue seems to happen more often when I leave the bluetooth serial port connected (led stays blue) and restart the debugging. I am not sure it is entirely related though, I need to make some more testing.

Is it even possible leaving serial port open on bluetooth might freeze the KL46Z I2C bus ? I find it unlikely

Is the MPL3115 the first sensor initialized or the first using I2C ?

I will try to find a consistent way to reproduce the issue

0 Kudos
Reply
1,049 Views
michaelestanley
NXP Employee
NXP Employee

Remi,

It probably has nothing to do with the MPL3115A2.  On the KL46Z, the same UART is routed to the Bluetooth module and used for serial communications over the OpenSDA.  If both try to use it, you will have conflicts.  Try removing the power jumper on the Bluetooth module when you are debugging and see if that resolves your problem.

Mike

0 Kudos
Reply
1,049 Views
remibeges
NXP Employee
NXP Employee

I tried removing the power jumper but then I don't receive anything at all on the usb serial port. I checked the port carefully, I am well connected to hard-wire serial.

Looking at the schematics of the shield, I believe I need instead to rotate the square jumper on UART_TX/RX in the bluetooth interface. Is that correct, can you confirm it Michael ? Haven't had the chance to test it yet

Also, I noticed an easy way to reproduce the I2C error is to remove the shield. So I suppose if a solder is bad on the KL46Z pin headers then result might be the same. I identified one potentially bad solder on the board header pins, I'll try to fix it and let you know the result

Thank you for your support

0 Kudos
Reply
1,050 Views
michaelestanley
NXP Employee
NXP Employee

J7 on the shield is the jumper I was referring to.  It's right next to the Bluetooth module.

And yes, bad solder joints can also have the symptoms you describe.  And I guarantee the software will hang if you remove the shield.

0 Kudos
Reply
1,048 Views
remibeges
NXP Employee
NXP Employee

I re-done a couple of solders, the problem seems gone now. Good news :smileyhappy:

0 Kudos
Reply
1,048 Views
michaelestanley
NXP Employee
NXP Employee

Excellent!

0 Kudos
Reply
1,048 Views
remibeges
NXP Employee
NXP Employee

I also forgot to precise that leaving the bluetooth serial port connected (and thus the bluetooth module as well) between two code runs definitely messes with the startup of the freedom board, you were absolutely right.

Basically the board never runs tasks in user_tasks.c if bluetooth is connected during flashing. However, during execution, I saw no issues using both KDS debugger with bluetooth serial port connected. I can debug my code just fine, and receive data just fine.

Just thought of sharing that feedback, might be useful to some other

0 Kudos
Reply