cancel
Showing results for 
Search instead for 
Did you mean: 

STM32U5 - application with both normal and LPBAM I2C routine with LPDMA and GPDMA

andrenada
Visitor

Hy,

I am trying to implement a code where i am using the I2C3 both in normal mode through the GPDMA and in LPDMA through the linked list.

Switching from the normal mode through the LPBAM linkest list works correctly but then moving back always makes the I2C unusable. 

 

The main procedure to go back is the following:

    SystemClock_Config();
    HAL_ResumeTick();
 
    __HAL_RCC_I2C3_CLK_ENABLE();
    __HAL_RCC_GPDMA1_CLK_ENABLE();
    __HAL_RCC_GPIOC_CLK_ENABLE();
 
    hi2c3.Instance->CR1 &= ~I2C_CR1_PE;
    hi2c3.Instance->AUTOCR = 0;
 
    HAL_DMA_Abort(&handle_LPDMA1_Channel0);
    HAL_DMAEx_List_UnLinkQ(&handle_LPDMA1_Channel0);
    HAL_DMA_DeInit(&handle_LPDMA1_Channel0);
 
    hi2c3.State = HAL_I2C_STATE_RESET;
    handle_GPDMA1_Channel0.State = HAL_DMA_STATE_RESET;
 
    MX_GPDMA1_Init();
    MX_I2C3_Init();
 
    __HAL_LINKDMA(&hi2c3, hdmarx, handle_GPDMA1_Channel0);
 
As for the LPBAM i don't have too much experience and I don't understand where the problem could be.
 
Hope someone has some suggestion on how to fix.
Thanks
0 REPLIES 0