hello,
i tested with S32K144EVB board with i2c interface, and find i2c sck signal is so week
and also the i send 3 data, but seems only two data sent, and the data is not correct
i use the demo code, do some modify it, could you help to check it and attached is the source code.


/* Definition of the data transfer size */
#define TRANSFER_SIZE (3u)
/*!
\brief The main function for the project.
\details The startup initialization sequence is the following:
* - __start (startup asm routine)
* - __init_hardware()
* - main()
* - PE_low_level_init()
* - Common_Init()
* - Peripherals_Init()
*/
void i2c_test()
{
int count = 0;
int i;
uint8_t buffer[TRANSFER_SIZE];
while(1)
{
if(count > 1000)
{
count = 0;
}
if(count == 0)
{
/* Initialize the data buffer */
for (i = 0u; i < TRANSFER_SIZE; i++)
{
buffer[i] = 0x55;
}
/* Send a packet of data to the bus slave */
LPI2C_DRV_MasterSendDataBlocking(INST_LPI2C1, buffer, TRANSFER_SIZE, true, OSIF_WAIT_FOREVER);
/* Clear the buffer to prepare it for the next operation */
for (i = 0u; i < TRANSFER_SIZE; i++)
{
buffer[i] = 0u;
}
/* Request data from the bus slave */
LPI2C_DRV_MasterReceiveDataBlocking(INST_LPI2C1, buffer, TRANSFER_SIZE, true, OSIF_WAIT_FOREVER);
}
count++;
}
}
int main(void)
{
/* Allocate memory for the LPI2C driver state structure */
lpi2c_master_state_t lpi2c1MasterState;
/* Declaration of the LPI2C transfer buffer */
uint8_t buffer[TRANSFER_SIZE];
/* Variable used for the loop that initializes the data buffer */
uint16_t i;
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
#ifdef PEX_RTOS_INIT
PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of Processor Expert internal initialization. ***/
/* Initialize and configure clocks
* - Configure system clocks and dividers
* - Configure LPI2C clock gating
* - see clock manager component for details
*/
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);
/* Initialize pins
* - Configure LPI2C pins
* - See PinSettings component for more info
*/
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
/* Initialize LPI2C Master configuration
* - Slave address 0x01
* - Fast operating mode, 400 KHz SCL frequency
* - See LPI2C components for configuration details
*/
LPI2C_DRV_MasterInit(INST_LPI2C1, &lpi2c1_MasterConfig0, &lpi2c1MasterState);
i2c_test();
while(1)
{
/* Initialize the data buffer */
for (i = 0u; i < TRANSFER_SIZE; i++)
{
buffer[i] = 0x55;
}
/* Send a packet of data to the bus slave */
LPI2C_DRV_MasterSendDataBlocking(INST_LPI2C1, buffer, TRANSFER_SIZE, true, OSIF_WAIT_FOREVER);
/* Clear the buffer to prepare it for the next operation */
for (i = 0u; i < TRANSFER_SIZE; i++)
{
buffer[i] = 0u;
}
/* Request data from the bus slave */
LPI2C_DRV_MasterReceiveDataBlocking(INST_LPI2C1, buffer, TRANSFER_SIZE, true, OSIF_WAIT_FOREVER);
}
/* End of the driver example */
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/
#ifdef PEX_RTOS_START
PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of RTOS startup code. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;) {
if(exit_code != 0) {
break;
}
}
return exit_code;
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/