2024-10-27 11:36 AM
Hi, I'm giving the example of the two stm32 boards at this link
I made and copied the connection and the code then I checked several times, everything matches, the problem is that when I execute the hall master i2c trasmitt function, it gives me an error, the master does not connect with the slave:
while(HAL_I2C_Master_Transmit(&I2cHandle, (uint16_t)I2C_ADDRESS, (uint8_t*)aTxBuffer, TXBUFFERSIZE, 10000)!= HAL_OK)
{
/* Error_Handler() function is called when Timeout error occurs.
When Acknowledge failure occurs (Slave don't acknowledge it's address)
Master restarts communication */
if (HAL_I2C_GetError(&I2cHandle) != HAL_I2C_ERROR_AF)
{
Error_Handler();
}
}
The code stop in function Error_Handler()
Tanks
2024-10-30 03:13 PM
It doesn't mean your code is equivalent. You could have missed something from that tutorial. So post your code that you are working with. Attach your IOC file too.
2024-11-04 03:55 AM
I m Sorry but i m using two f 401 re ,connection Is ok, ,firmawer Is last ,but the slave don t receive,don t aknoweledge tò master.....
2024-11-04 04:02 AM
So, again, have you used an oscilloscope to see what's actually happening on the wires?
Have you separately debugged your master code, and your slave code?
2024-11-06 04:54 AM
please check your code for i2c initialization. what is the i2c address? and how about the IO configuration? (make sure to configure the pin as the AF open Drain mode)
2024-11-06 05:04 AM - edited 2024-11-06 05:05 AM
Hi,
The example given on github doesn't include pullups. If it has been copied verbatim, that'll be the problem...
I hope this helps.
Kind regards
Pedro