Skip to main content
SDall
Associate III
Sep 5, 2019 12:40 PM UTC
Solved

I2c receive with dma

hi I looked for a tutorial on dma receive i2c but I didn't find it, I

tried with dma receive uart and it works perfectly:

int main(void)

{

HAL_Init();

 MX_GPIO_Init();

 MX_DMA_Init();

 MX_USART2_UART_Init();

 MX_USART6_UART_Init();

 /* USER CODE BEGIN 2 */

 HAL_UART_Receive_DMA(&huart6, (uint8_t *)rxBuf, 25);

 while (1)

 {

 }

}

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)

{

HAL_UART_Receive_DMA(&huart6, (uint8_t *)rxBuf, 25);

     }

could I have an example like this with dma i2c with the callbak function?

TANKS

This topic has been closed for replies.
After Forever
After ForeverBest answer
Senior III
Sep 16, 2019 11:15 AM UTC

You didn't even mention your microcontroller model/series so it's not possible to pinpoint the exact location of example projects (anyway, is it really that hard to find in 11 days?).

Open your Cube repository directory (Help->Update Settings->Browse in CubeMX) and find the example projects in STM32Cube_FW_***_V***/Projects/***/Examples/I2C

Substitude ***-s with correct values.

3 replies

SDall
SDallAuthor
Associate III
Sep 16, 2019 10:41 AM UTC

please someone answer me!!!!!

After Forever
After ForeverBest answer
Senior III
Sep 16, 2019 11:15 AM UTC

You didn't even mention your microcontroller model/series so it's not possible to pinpoint the exact location of example projects (anyway, is it really that hard to find in 11 days?).

Open your Cube repository directory (Help->Update Settings->Browse in CubeMX) and find the example projects in STM32Cube_FW_***_V***/Projects/***/Examples/I2C

Substitude ***-s with correct values.

SDall
SDallAuthor
Associate III
Sep 17, 2019 3:23 PM UTC

I'm sorry I have a f401re and I'm trying to read a data stream from an mpu in i2c, if it were possible to have an example with the callbak function?