cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the I2C bus the PMIC is connected to in STM32DDRFW-UTIL

JSchn.5
Associate III

We quite recently learnt of the move from U-Boot SPL to STM32DDRFW-UTIL and that the MX too would not longer work with the former. That wasted a decent amount of time.

The problem is although the code for STM32DDRFW-UTIL is available our PMIC is on I2C6 and the code for the DK2 board doesn't abstract the connection of its PMIC to I2C4 cleanly.

For example there's a function called BSP_I2C4_WriteReg that calls I2C4_WriteReg. Elsewhere it says

#define DISCO_I2C4_CLK_DISABLE() __HAL_RCC_I2C4_CLK_DISABLE()

and there are a load more defines that DISCO_I2C4 is I2C4_something. I feel a lot more of this could have been done making better use of pre-processing to reduce the repetition of things of the form

#define <w>_I2C<n>_<x> <y>_I2C<n>_<z> .

It should be that the disco's STPMU1_Register_Write calls I2C4_WriteReg and that's the board abstraction.

Is there a guide to the simplest way to change the I2C port the PMIC is connected to in STM32DDRFW-UTIL ?

Thanks,

Jon

3 REPLIES 3
Kevin HUBER
ST Employee

Hello @JSchn.5​ ,

Sorry for the delay,

To customize the STM32DDRFW-UTIL, there is an explanation here: https://github.com/STMicroelectronics/STM32DDRFW-UTIL#1333-customization

But if we look at your case, the tool is not customizable enough or something is missing in the documentation.

This tool has been made to work with the official boards from ST, but when you are working with a custom board, you are right it seems pretty hard to adapt.

We have escalated the problem internally and the ticket number related to it is : 137449

I will keep you informed of further progress on the subject.

Best Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
JSchn.5
Associate III

Literally yesterday my colleague got the tool working on our board. I'm back to TF-A and U-Boot working out where I was before getting distracted with U-Boot SPL earlier in the summer. (Yes there was some holiday and working elsewhere in the intervening too.)

We have a ticket in with ST and/or Avnet. Please make sure no more duplication of work takes place for any of us.

Hello @JSchn.5​ ,

Good news that it works.

I asked the European FAE and unfortunately we do not have a ticket in progress with you or on this topic. It is surely only handled by your distributor without ST in the loop.

I will write in this community post when some progress are made to make easier to adapt the STM32DDRFW_UTIL.

Best Regards,

Kevin

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.