cancel
Showing results for 
Search instead for 
Did you mean: 

I2C5 in the CM4 context giving I2C_WaitOnTXISFlagUntilTimeout

PVaaz.1
Associate III

Hello

Attached is my i2c ioc file and I have connected an ADXL sensor to the stm32mp1 on its Arduino connector(I2C5). ( address: 3A, Chip id value : E5, Chip ID read register : 0x00)

I am trying to read this chip id but getting an error at the below line always

 if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, Tickstart) != HAL_OK)

Can you please tell me what's wrong in the code or ioc file?

attached is my main.c and ioc file as well.

Do I need any changes I the device tree file on the A7 side?

Thanks !,

P

2 REPLIES 2
Olivier GALLIEN
ST Employee

Hi @PVaaz.1​ ,

Sorry to come quite late in this thread.

Where did you stand today ?

Didn't dig into code yet but as a first comment i can answer yes to question "Do I need any changes I the device tree file on the A7 side?"

You have to care i2C5 ( and maybe other peripherals) properly assigned on M4 side.

Olivier

Olivier GALLIEN
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.

Hello @Community member​ ,

Thanks it got resolved,

CubeMX generates the I2C hal msp code with below I2C configuration by default :

PD1   ------> I2C5_SCL

  PZ1   ------> I2C5_SDA

but in actuality works with PA11, and PA12 respectively.

I forget to mention in am using only CM4 with engineering mode.

I think in production as well this holds true and I don't need to change in the device tree change settings in A7 side

Thanks !

Regards,

R