2017-07-15 02:06 AM
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 #i2c2017-07-15 03:19 AM
are you using a sixteen bit left aligned address like the command wants?
(uint16_t)(dev_i2c_addr<<1)
2017-07-15 04:44 AM
So the previous design was based on an 8 bit hw master i2c design...
2017-07-15 07:55 AM
,
,
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(),
}
2017-07-15 08:01 AM
what is an '8 bit hw master i2c design' ? could you add some details?