cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F405 corrupt i2c transactions

tobias
Associate II
Posted on August 17, 2016 at 14:06

Hi!

I have been writing my own I2C driver to play well with the RTOS and I have been using a I2C analyser to help me out. After a lot of frustration I have gotten most of it working but what I have discovered is that I sometimes get corrupt transactions. This happens randomly bug generally not more often then once every thousand transactions. As my frustration grew I decided to test the CubeMX HAL I2C driver on my board just verify that it is my code that is doing something strange. However I found out the the HAL I2C driver generates even more corrupt transactions.

The hardware is a custom board with STM32F405 using I2C3 to talk to a MPU9250 sensor with 4.7k pullups at 400kHz I2C clock. Signals looks good on scope so no electrical problem.

0690X00000603BHQAY.jpg

Any suggestions?
2 REPLIES 2
tobias
Associate II
Posted on August 18, 2016 at 08:49

As the image didn't turn out so well I'm adding two new images so it is easier to see what is going on. The test I'm running is just reading 2 bytes from address 0x69 over and over again using the polling function HAL_I2C_Master_Receive (V1.5.1). For this test using CubeMX driver this is the only thing the MCU does. I have verified the same problem on two different boards and next thing would be to test it on a discovery F4 board.

0690X00000605RLQAY.png

And this is how it looks like when a random transaction error error occures:

0690X00000605FwQAI.png

tobias
Associate II
Posted on August 18, 2016 at 16:16

After further investigations it looks like it is the analyzer that is the problem. I'm running data center software from totalphase with a beagle I2C analyser in virtualbox and win7 because it doesn't run on Ubuntu. I have now tested running it on a MAC and I don't get these corrupt transactions. Problem solved.