Why does the I2C_CheckEvent function hang when debugging?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-02-01 12:54 AM - edited 2024-02-01 3:17 PM
I am testing the initialization module.
The issue is that while debugging, when I set a break point in the if statement or use the printf statement above the while in the sample below, it hangs.
It seems to be an event related issue, is there any way to handle this?
In particular, if I use a lot of printf statements, I get hung.
device : STM32F103xE
debugger(driver) : j-link
IICcnt = 0;
while(!I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_BYTE_RECEIVED))
{
if( IICcnt > IICMAXDELAY ) // breakpoint to here.
{
/* Send STOP condition */
I2C_GenerateSTOP(I2C1, ENABLE);
/* Clear EV6 by setting again the PE bit */
I2C_Cmd(I2C1, DISABLE);
ret = ERROR_I2C_READDATA_RDDATA;
}
}
Labels:
- Labels:
-
I2C
-
STM32F1 Series
-
USB
0 REPLIES 0
