HAL_I2C_Master_Transmit works, HAL_I2C_Master_Transmit_IT does not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-28 4:15 PM - edited 2025-03-28 4:17 PM
I’m trying to replace a blocking call to HAL_I2C_Master_Transmit() with the interrupt version HAL_I2C_Master_Transmit_IT(). The blocking HAL_I2C_Master_Transmit() call works perfectly. The HAL_I2C_Master_Transmit_IT() call sends completely different data. Specifically:
My buffer contains: 00 00 00 00 00 00 00 BF 00 3F 00 00 00 00 00 00 00
When I call HAL_I2C_Master_Transmit(&hi2c4, I2C_ADDRESS, buffer, 17, 100), I see this:
When I call HAL_I2C_Master_Transmit_IT(&hi2c4, I2C_ADDRESS, buffer, 17), I see unrecognized data:
I’m using a STM32H755.
Solved! Go to Solution.
- Labels:
-
I2C
-
STM32H7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-28 4:47 PM
Probably the buffer you are sending is going out of scope before the transfer completes. Use a global variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-28 4:47 PM
Probably the buffer you are sending is going out of scope before the transfer completes. Use a global variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2025-03-28 7:30 PM
That was it! Thank you!!!
