Skip to main content
MLam
Associate III
December 14, 2022
Solved

DMA LPUART work only once when power on

  • December 14, 2022
  • 3 replies
  • 2085 views

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

This topic has been closed for replies.
Best answer by MLam

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

3 replies

MLam
MLamAuthor
Associate III
December 14, 2022

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
MLamAuthor
Associate III
December 16, 2022

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
MLamAuthorBest answer
Associate III
December 16, 2022

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