Page 2 of 2

Re: STM32F4x1 BlackPill issue with I2C as slave

Posted: Wed Aug 25, 2021 2:32 pm
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;

Re: STM32F4x1 BlackPill issue with I2C as slave

Posted: Wed Aug 25, 2021 2:50 pm
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

Re: STM32F4x1 BlackPill issue with I2C as slave

Posted: Wed Aug 25, 2021 2:58 pm
by fpiSTM
Ah OK.
Anyway, you could try to disable the clock stretching to see what happen.
Is clock freq is 400k for both?

Re: STM32F4x1 BlackPill issue with I2C as slave

Posted: Wed Aug 25, 2021 2:59 pm
by camelator
And here is the signal, having Jetson Nano, servo controller but without the black pill board

https://ibb.co/2nTnXht

Image

Re: STM32F4x1 BlackPill issue with I2C as slave

Posted: Wed Aug 25, 2021 3:00 pm
by camelator
yes clocks are set to 400Khz on both sides

Re: STM32F4x1 BlackPill issue with I2C as slave

Posted: Wed Aug 25, 2021 3:17 pm
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

Re: STM32F4x1 BlackPill issue with I2C as slave

Posted: Thu Aug 26, 2021 8:46 am
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,...)