Skip to main content
1 of 4
Majdgh
  • 43
  • 1
  • 6

HAL_I2C_Master_Transmit_DMA sends only one byte

i am having an issue using STM32G4 with I2C DMS and FreeRTOS. I have used the library https://github.com/firebull/STM32-LCD-HD44780-I2C for a long time with STM32F4 and free RTOS and it works perfectly. Now I wanted to use it with STM32G4 but the Problem is: 1- The SCL line stays low when calling HAL_I2C_Master_Transmit_DMA(lcdParams.hi2c, lcdParams.address, (uint8_t*)lcdCommandBuffer, 3) and it does send only the first byte instead of 3 2- The program stucks in : while (HAL_I2C_GetState(lcdParams.hi2c) != HAL_I2C_STATE_READY) { vTaskDelay(1); }

The hardware doesn’t have any problem because I can print text without DMA using blocking mode with another driver.

I have used USB Scope to inspect the problem and tried a lot of things like resetting I2C with I2C busy flag strange behaviour or reducing the speed but nothing worked.

I have used the same configurations that worked on STM32F4 with STM32G4 in CubeMX but HAL_I2C_Master_Transmit_DMA is not sending the other bytes and the bus is held

Can someone help me please? Thanks

Majdgh
  • 43
  • 1
  • 6