cancel
Showing results for 
Search instead for 
Did you mean: 

Mbed I2C Bus scanner code works but STM32 HAL code doesn't

mbyamukama
Associate II

Hello All.

I have an INA233 connected to my STM32F4-Nucleo (F410). Its address is 0x40. I can access the device very well using my Arduino. Using the Nucleo, the example here works straight out of the box. I have slightly modified this example to work for my Nucleo. The main file is attached. I have a successful compilation. But No device is found. Been at it for 5 hours and I would appreciate any help. What am I doing wrong?

4 REPLIES 4
S.Ma
Principal

statistically, the slave address value is 7 bit and functions either wants 7 or 8 bits... check this.

Say an EEPROM has 0x50 address or 0xA0 address?

The paper spec guy will choose 0x50

The HW guy who sees on the scope the bus every day will tell you 0xA0

mbyamukama
Associate II

I have tried this with both the left shift and without it.

S.Ma
Principal

Time to use oscilloscope to see if I2C lines are truly active.

mbyamukama
Associate II

So I can confirm that with MBED, the I2C lines are active. Master sends and slave responds very well. With the HAL Libraries, I don't get anything from the Master. This is really basic code and I have even used the template from STM32. It must be something small I am leaving out but I can't seem to find it.