I'm trying to use the SSD1306 (oled screen) with the STM32F091RC and I2C interface, I managed to integrate the library U8G2 (Home · olikraus/u8g2 Wiki · GitHub ) in Eclipse with GNU MCU Eclipse and the setup provided by CubeMX for I2C. With the 'normal' transmission routines HAL_I2C_Master_Transmit() it works normal, I can draw things there.
But when I try to replace it by HAL_I2C_Master_Transmit_DMA(), seems to be some looses between the DMA and the I2C.
If I run this with the debugging interface, put a breakpoint in the HAL_I2C_Master_Transmit_DMA() instruction, and look with the scope, I get what is supposed to be each time (because there is a time in between each iteration while I hit the button again), but if I let him run free while I record with the scope again, the received chain is not the same, many packages are lost. I'm testing this with the initializing chain and only in the 'command' section of the transmission, to have it a bit more under control.
Seems to me like the DMA is not waiting for the transaction to finish on the I2C, instead he sends the next value to the interface while he is not ready, it's this possible? any other ideas?
attached are main.c,
and the file from u8g2 where the communications occurs :
the init chain is:
when I use HAL_I2C_Master_Transmit(), I can see it all in the scope, if I use HAL_I2C_Master_Transmit_DMA() instead, I will only see:
but this also depends on what is happening on main, with a more complicated setup (the rest of the peripherals I want to use for the application, the data is different.