cancel
Showing results for 
Search instead for 
Did you mean: 

DMA LPUART work only once when power on

MLam
Associate III

Hello everyone,

I work on a project with STM32L072CBT6.

I want to use a DMA RX on LPUART1, after reading differents ressources i have setup my LPUART and my DMA.

I want to receive an interrupt from my DMA when transmit IDLE (end of transmit).

My problem is the following, when i download my firmware and check my debug, no interrupt are flaged. When i power down/up my card, my interrupt work only once.

I have try differents things but i have obtain no result.

I would like to know if you have advice that can help me about this problem ?

Thanks for your help,

Best regards,

MLam

DMA Configuration

0693W00000WL1NuQAL.pngLPUART1 Configuration

0693W00000WL1OEQA1.pngNVIC Configuration

0693W00000WL1OTQA1.png

1 ACCEPTED SOLUTION

Accepted Solutions
MLam
Associate III

The solution was to memset to 0 the buffer that i give to the DMA. I memset in the interrupt function just before recall HAL_UARTEx_ReceiveToIdle_DMA

View solution in original post

3 REPLIES 3
MLam
Associate III

Hey,

After new tests, i found that the problem come from my iprintf.

When i made my test, my debug message in my fonction erase in my terminal the iprintf which come from my interrupt.

To conclude the DMA works but the debug information are not correct.

To find this i have test my code alone in a new project. This code works so i put the project in attached document if this can help someone.

MLam
Associate III

Hey,

In the same orientation, i would like to clear my buffer. So i try to make a memset of the buffer that i give to my DMA.

I have try to clear the before withtout a stop and i have try with a stop. But nothing works and he keep information into the buffer.

Do you have advice that can help me to clear this buffer ?

Best regards,

MLam
Associate III

The solution was to memset to 0 the buffer that i give to the DMA. I memset in the interrupt function just before recall HAL_UARTEx_ReceiveToIdle_DMA