2022-03-29 07: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.
2022-03-29 07:51 AM
2022-03-29 07:52 AM
2022-03-29 08: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.