2025-10-10 8:32 AM
Hi!
I try to read data from an I2C device using DMA. I use a STM32-F412ZG nucleo board.
First I try to write without DMA :
HAL_FMPI2C_Mem_Write(&hfmpi2c1, 0x52, 0x7fff, FMPI2C_MEMADD_SIZE_16BIT, tab, 1, 1000);
Then I want to read data using DMA with:
HAL_FMPI2C_Mem_Read_DMA(&hfmpi2c1, 0x52, 0x0, FMPI2C_MEMADD_SIZE_16BIT, tab, 1);
Here is what i get with the osciloscope:
The first part corresponds to the write and works correctly. The second part corresponds to the read function, but the address of the register should be a16 bit sequence, but i only get the first byte, then the I2C bus is stuck (sclk stays at 0V).
I tested the same thing using I2C instead of FMPI2C, and all works correcly.
Did I miss something in my code? the full project is attached.
Léonard G
Solved! Go to Solution.
2025-10-10 8:36 AM
Sorry, wrong forum, re-posted here
2025-10-10 8:36 AM
Sorry, wrong forum, re-posted here