Hi NXP experts:
I recently changed the MCU of my project from S32K118 to S32K312EVB-Q172(using SDK RTD 5.0.0 HF01). Both of them running on FIRC 48Mhz.
However, I stuck at setting I2C Master using Flexio module, target baudrate is 400 kHz.
But I found below issues...
1. The baudrate calculation formula is different from K1 series and K3 series.
In K3 series, the baudrate is calculated by two parameters(I2c timer compare value and I2c FlexIO Prescaler), while in K1 series SDK use baudrate to calculate the parameters.
I reference the SDK code that calculate baudrate using InputClock and Divider as parameters
In S32K3xx: baudRate = (inputClock + divider + 2U) / (2U * ((uint32_t)divider + 2U));

In S32K1xx: Baudrate is assigned by developer and use the baudrate to calculate the divider value and divider value.
tmpDiv = (((int32_t)inputClock + (int32_t)baudRate) / (2 * (int32_t)baudRate)) - 2;

So my question is, these formulas don't seem equal to each other, so how can I get the desired baudrate?
I've tried set cmpvalue to 58 and prescaler to FLEXIO_TMR_DECREMENT_ON_FLEXIO_CLK_DIV_1, which should generate 400 kHZ, but my LA measurement stucks at around 295 kHZ.

2. S32 Design Studio Peripherial GUI given inaccurate baudrate calculation.
I change the I2c timer compare value, but the auto-generated baudrate value don't change in GUI and Flexio_I2c_Ip_PBcfg.c


Thanks for the reply in advance!