cancel
Showing results for 
Search instead for 
Did you mean: 

HAL and I2c problem

askari.nima
Associate II
Posted on January 16, 2015 at 12:42

I connect mpu6050 to i2c3 and make a project with stm32cube and enable i2c3.

but cant detect sensor.

for(i=0 ; i<255 ; i++)

    {

        test = HAL_I2C_IsDeviceReady(&hi2c3,i,10,100);

        if(test == HAL_OK)

            break;

    }

return always HAL_BUSY 

my board is stm32f4discovery

#i-can''t-help-you-with-that
11 REPLIES 11
askari.nima
Associate II
Posted on January 16, 2015 at 16:56

please answer me

Posted on January 16, 2015 at 19:58

please answer me

Do you think you've provided enough circuit or software details for anyone to replicate your experiment?
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
askari.nima
Associate II
Posted on January 17, 2015 at 12:22

my answer is why when i want to read or write from i2c bus , all HAL_I2c_...  function return me HAL_BUSY.

I enable I2c 3 in stm32f4cube and make project in keil.

I connect SDA and SCL pin to MPU6050 sensor.

I test this hardware with another program an it work property.

My problem in HAL_DRIVER

askari.nima
Associate II
Posted on January 19, 2015 at 08:16

I'm waiting for your answer.

thanks

serkodog
Associate II
Posted on January 19, 2015 at 10:01

Hi! Try to add some delay between your cycles.

serkodog
Associate II
Posted on January 19, 2015 at 10:05

It is from function ''HAL_I2C_IsDeviceReady'' description:

This function is used with Memory devices.

askari.nima
Associate II
Posted on January 19, 2015 at 10:19

I try delay . but not work.

I see a simple code to use sensor with Hal memory write function.

This program must be check all i2c address on port and return if exist

askari.nima
Associate II
Posted on January 20, 2015 at 07:01

Please Help me Clive1.

askari.nima
Associate II
Posted on January 20, 2015 at 21:08