2025-07-21 2:24 AM - last edited on 2025-07-21 2:40 AM by Andrew Neil
Hello All, I am trying to do a loopback test between 2 i2c's on the same board, using bare metal coding and interrupts, and the clk is HSI, 16MHz. How the i2c i configured as slave is failing to acknowledge the address sent by master i2c.
Here is a zip file containing the project.
2025-07-21 2:28 AM
You already have a thread on this - marked as solved:
I2C Loopback Test using STM32F429ZI
2025-07-21 2:33 AM
That was using HAL(API), this is register level programming.
2025-07-21 2:39 AM - edited 2025-07-21 2:47 AM
So compare what happens in your bare-metal code with what happens in the (working) HAL code.
Step through both of them - see where they differ.
The chip neither knows nor cares what your code uses - it just needs to have the correct register setting, etc.
PS:
You seem to have switched both slave and master to bare-metal.
It would be more sensible to do just one at a time - otherwise you don't know whether the problem(s) are in the Master, or the Slave - or both!
@maya16 wrote:slave is failing to acknowledge the address sent by master i2c.
So is the master actually sending the correct address?
Or is the Slave not correctly recognising its address?
Or both?!