cancel
Showing results for 
Search instead for 
Did you mean: 

PMBUS problems

_apache_
Associate

Hi,

I have problem with LTC7106 and STM32G431CBT6.

LTC7106 use PMBUS. I never used SMBUS or PMBUS before.

I tried to use normal SMBUS implementation and:

  • I can find device (it find 0xC, 0x2A, 0x5A, 0x5B devices. First one is strange but maybe I don’t know something) - the device should have 0x2A address - so I assume that it work properly.
  • I can’t force it to send or receive any data from the device.

I tried to do everything as described in: SMBUS/SMBUS_TSENSOR/readme.txt in terms of configuration – but I have no idea what cause the problem.

So I have a question – does PMBUS device should be accessible via standard implementation od SMBUS in STM32? I mean should it read and write registers without any problems?

To solve the problem I tried to use X-CUBE-SMBUS – I tried to do everything like in: https://community.st.com/t5/stm32-mcus-products/this-is-an-issue-related-to-the-initialization-of-the-x-cube/m-p/751304 and in AN4502

But it hang in STACK_SMBUS_Init -> SMBUS_Enable_IRQ -> __HAL_SMBUS_ENABLE_IT(hsmbus, tmpisr);

Since there is almost nothing usable information in internet I have a second question. Do you know what can cause this problem?

1 REPLY 1
_apache_
Associate

so for further reference:

to make it work you need manually handle IRQ related with I2C

like 

HAL_NVIC_SetPriority(I2C1_EV_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(I2C1_EV_IRQn);
/* I2C1_ER_IRQn interrupt configuration */
HAL_NVIC_SetPriority(I2C1_ER_IRQn, 0, 0);

HAL_NVIC_EnableIRQ(I2C1_ER_IRQn);

the second - after each write or read command you need to wait:

while (HAL_SMBUS_GetState(&hsmbus1) != HAL_SMBUS_STATE_READY);

this wait is in example but I forgot it to put after read part...

And yes - PMBUS is readable via SMBUS without any X-CUBE-SMBUS addons...