cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411x I2C addressing: 0x78

Luca R
Associate II
Posted on July 15, 2017 at 11:06

I am using the STM32F411 as an I2C master to control a DC_DC converter with PMBus support.

This device is within a local system, and it allows all 128 addresses to be assigned with seven user-assignable address pins. Since there will be no interactions with other conventional I2C busses, it has been assigned the address 0x78 to that device, regardless of the warning on reserved addresses (0x78 is reserved for 10bit addressing).

After trying to write to that device (with HAL_I2C_Master_Transmit() function), both the SCL and SDA lines are kept low and the I2C gets stuck (BUSY) for good.

The Write operation ends with HAL_TIMEOUT error and, by that time on, the I2C bus is detected as busy.

I fixed this issue just changing the slave address to 0x77, and now it works.

Still I don't understand what is blocking the bus.

I don't think that it is the DC_DC converter: it has been used by my company in the past, in other products, with 0x78 address.

I wonder if the STM32-I2C library doesn't allow to use reserved addresses, but in this case I expected the transaction to be refused, and not to block permanently the I2C bus.

Can anyone help me understanding exactly what went wrong?

Thanks and regards,

Luca

#i2c-reserved-address #i2c-addressing #0x78 #i2c-7bit-address #i2c
4 REPLIES 4
john doe
Lead
Posted on July 15, 2017 at 12:19

are you using a sixteen bit left aligned address like the command wants?

(uint16_t)(dev_i2c_addr<<1)

S.Ma
Principal
Posted on July 15, 2017 at 13:44

So the previous design was based on an 8 bit hw master i2c design...

Posted on July 15, 2017 at 14:55

 ,

 ,

Of course I am:

♯ define

I2C2_ADDRESS_DC2 0xF0

/* Real 7 bits slave address value in

Datasheet

is: b1111000 means in uint8_t equivalent at 0x78 */

.

uint16_t

DevAddress = I2C2_ADDRESS_DC2,

uint8_t

pData[] = {0x21, 0x52, 0x10},

Size = 3,

Timeout = 1000,

if

(HAL_I2C_Master_Transmit(&,hi2c1, DevAddress, pData, Size, Timeout) !=

HAL_OK

)

{

 , , , ,

Error_Handler(),

}

Posted on July 15, 2017 at 15:01

what is an '8 bit hw master i2c design' ? could you add some details?