cancel
Showing results for 
Search instead for 
Did you mean: 

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?

IJose.1
Associate II

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.

3 REPLIES 3
IJose.1
Associate II

Here i am also attaching the main function and a test case sample for reference.

I2C_mem_read_IT

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..