2025-02-28 9:14 AM
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 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?
2025-03-01 2:03 PM
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...