STM32F4x1 BlackPill issue with I2C as slave

User avatar
fpiSTM
Posts: 1745
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32F4x1 BlackPill issue with I2C as slave

Post by fpiSTM »

Could you try to change this line:

https://github.com/stm32duino/Arduino_C ... twi.c#L718

Code: Select all

-        handle->Init.NoStretchMode   = I2C_NOSTRETCH_DISABLE;
+        handle->Init.NoStretchMode   = I2C_NOSTRETCH_ENABLE;
camelator
Posts: 12
Joined: Fri Aug 20, 2021 10:27 am

Re: STM32F4x1 BlackPill issue with I2C as slave

Post by camelator »

Forgot what I said...
SCL pin was not LOW
I forgot to reset the board after the blocking issue and the signal remained LOW.
What we can say is after resetting the board:
the signal is effectively HIGH
but as the Jetson Nano is checking the Blackpill the SCL signal becomes LOW and stay LOW.


Attached is a picture of the signal

https://ibb.co/5xn54VP
Image
User avatar
fpiSTM
Posts: 1745
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32F4x1 BlackPill issue with I2C as slave

Post by fpiSTM »

Ah OK.
Anyway, you could try to disable the clock stretching to see what happen.
Is clock freq is 400k for both?
camelator
Posts: 12
Joined: Fri Aug 20, 2021 10:27 am

Re: STM32F4x1 BlackPill issue with I2C as slave

Post by camelator »

And here is the signal, having Jetson Nano, servo controller but without the black pill board

https://ibb.co/2nTnXht

Image
camelator
Posts: 12
Joined: Fri Aug 20, 2021 10:27 am

Re: STM32F4x1 BlackPill issue with I2C as slave

Post by camelator »

yes clocks are set to 400Khz on both sides
camelator
Posts: 12
Joined: Fri Aug 20, 2021 10:27 am

Re: STM32F4x1 BlackPill issue with I2C as slave

Post by camelator »

Could you try to change this line:

https://github.com/stm32duino/Arduino_C ... twi.c#L718

Code: Select all

- handle->Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
+ handle->Init.NoStretchMode = I2C_NOSTRETCH_ENABLE;

It works!!!!!

This is the issue
now, blackpill is detected by the jetson nano
User avatar
fpiSTM
Posts: 1745
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: STM32F4x1 BlackPill issue with I2C as slave

Post by fpiSTM »

Fine.
Anyway it should works with stretching enable.

How do you proceed to test?
Starting Jetson nano then the blackpill and finally launchs I2C tests?
One current issue is having some glitches on the line then I2C is not in the correct state.
It should be fine also to check STM32 I2C states (error registers,...)
Post Reply

Return to “STM32F4 based boards”