2020-11-09 10:06 PM
I have coded a program for I2C for my STM32F407 DISC-1 board.
In which STM32 acts as master and sends data to a Arduino UNO whenever user button on STM board is pressed
code works fine , i am getting proper output which is expected but when I run code as a whole .
but when i was doing step wise debugging, their is some strange behavior
after sending the address the ADDR bit is set (signifying the address matches the slave)
then when i go to the function to check ADDR bit to proceed further the ADDR bit resets
why is this happing i have only switch to a different function to check the bit , i haven't even read the register or do masking to get the bit value .
and as per reference manual ADDR bit resets when we read SR1 followed by reading SR2
but if run the code without stepwise debugging it runs fine , so code is fine
then why this is happing in stepwise debugging , is this because of some ST-Link debugger , or anything else ?
I am using STM32F407 DISC-1 , on board debugger.