Hi team,
HAL_I2C_Mem_Read/Write_IT is not responding when calling it as function into a main file from another file. How can i get an output after read/write in the below detailed case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-29 7:48 AM
I am using STM32F411VE for testing I2C driver, in which i have defined 9 test cases using HAL_Mem_read, HAL_Mem_write, HAL_Master_transmit and HAL_Master_Receive(inblocking and non blcking mode(IT, DMA)). I have defined each test cases as a function inside a single project and call it to main function. The blocking mode mem_read/write and master_transmit/receive is working properly. But for IT and DMA its not returning any value after calling the function. I have given HAL_I2C_MemRxCpltCallback/HAL_I2C_MemTxCpltCallback inthe main function. Can anybody please guide me how to reolve the issue.
- Labels:
-
I2C
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-29 7:51 AM
Here i am also attaching the main function and a test case sample for reference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-29 7:52 AM
I2C_mem_read_IT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-29 8:26 AM
Don't such IT / DMA functions return immediately?
Variables/pointers get filled in the background, and signalled via call-backs, you can't just keep executing, and hope to pick up the values later.
Also you can't use local/auto variables for IT / DMA, they don't retain scope, and variables updated this way also need to be volatile.
Up vote any posts that you find helpful, it shows what's working..
