Changing the I2C bus the PMIC is connected to in STM32DDRFW-UTIL
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
