cancel
Showing results for 
Search instead for 
Did you mean: 

Why the EN flag bit in DMA_SxCR register is cleared when I powered up the peripheral device? I have linked DMA with UART for receiving purpose only.

JPate.1
Associate

I am using Nucleo-F429ZIT. I have used UART4 and linked it with DMA for reception. The EN flag bit in DMA_SxCR register is cleared when I connect peripheral board with STM. This issue is happening only when I disconnect the power supply of peripheral board and reconnect it. The peripheral board is powered up from Nucleo board (3V3).

I have also tried to give power to my peripheral board from another reliable source but still its flag is cleared. And also, the communication between Nucleo and periph board gets lose after reconnecting the board. This issue is recoverd only when I reset the STM.

3 REPLIES 3

The NUCLEO really isn't designed to hot-plug other boards into.

Make sure the grounds are common and connect first.

Consider RS232 connectivity.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
JPate.1
Associate

Thank you @Community member​  for response.

  • I have also tried to power up the periph board using external power supply and in that case I have make sure about common ground. (I have attached the block diagram of connections I made)

0690X00000D83d4QAB.jpg

  • Also, in my project, there is no need to introduce RS232 connectivity. The actual problem I am facing is, when I disconnect power of peripheral board and reconnect it, its rare instances where communication is still working. Most of the time (about 90%), communication lost when device is powered up again.
  • When I tried to debug from TrueStudio, I came to know that EN flag bit in DMA_SxCR register is cleared when receiving functionality is lost.
  • I have also verified that data is correctly transmitted to the periph board and periph board is also responding accordingly. But DMA interrupt has not been generated and data is not received by Nucleo board.

Powering the "periph board" down or up means it will probably load the Rx line down by its protection structures. Connect an oscilloscope and observe what happens there. The UART in STM32 sees this as incoming random bytes (that's why your DMA EN bit gets cleared - it actually DOES receive bytes) and BREAK events, and acts accordingly.

> communication lost

You ought to have an upper level protocol on UART which is robust enough to withstand these random data - use packetization, checksumming, timeouts.

JW