Skip to main content
PR.10
Associate III
May 6, 2025
Question

i2c normal mode - generated code contains LL_I2C_EnableFastModePlus

  • May 6, 2025
  • 2 replies
  • 607 views

Hi,

I have project in cube ide 1.18.1. with stm32h523.
The generated code void MX_I2C1_Init(void) has LL_I2C_EnableFastModePlus(I2C1); at the end despite the configuration is set to normal (not fast or fast+). This looks like generator bug because I don't see the same error in stm32g071 project.
I explicitly need the normal i2c mode setting for its sink current limit. Otherwise this bug may actually cause a chip damage due to over current.

Can anyone confirm if this is indeed a bug?

It is easy to reproduce. just create empty project with i2c and set the driver to LL. the 100kHz normal is the default.

I tested it with real cpu and even if I replace it with LL_I2C_DisableFastModePlus it still seems to sink >20mA so it does not behave as the datasheet suggests. I did not find specification for current in normal mode, but I would expect something above 4mA based in i2c protocol spec and safe margin below 25mA which is the damage limit according datasheet.

2 replies

Technical Moderator
May 7, 2025

Hello @PR.10 ,

 

First let me thank you for posting.

I am currently studying your request, and I will get back to you ASAP.

 

Thanks.

Mahmoud

 

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.
Technical Moderator
May 7, 2025

Hello @PR.10 ,

 

Let me thank you for bringing this issue to our attention.

An internal ticket is raised to the Development Team (Ticket Number: 209242).

 

Thanks.

Mahmoud

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.
PR.10
PR.10Author
Associate III
May 12, 2025

can I see the ticket or will you post the result here?

Technical Moderator
May 12, 2025

Hello @PR.10 ,

 

I will let you know as soon as the problem is solved.

 

Thanks.

Mahmoud

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.