cancel
Showing results for 
Search instead for 
Did you mean: 

USART in multiprocessor mode (MME / Address Mark) over RS485 with DMA and IDLE interrupt

han11176
Associate

Hello everyone,

I'm currently working on a UART communication protocol using STM32 USART in multiprocessor mode (MME / Address Mark) over RS485. My goal is to receive variable-length data frames only when the address matches, and use DMA + IDLE interrupt to detect the end of each frame.

:wrench:Frame format:
- First byte: 9-bit address word (MSB = 1)
- Followed by N data words (9-bit, MSB = 0)

:white_heavy_check_mark:Setup:
- USART configured in 9-bit data mode (no parity)
- MME (multiprocessor mode) enabled
- Address match set via ADD[7:0]
- DMA reception via `HAL_UARTEx_ReceiveToIdle_DMA(...)`
- `__HAL_UART_ENABLE_IT(&huart, UART_IT_IDLE)` enabled
- IDLE handling expected in `HAL_UARTEx_RxEventCallback()`

:cross_mark:Issue:
- When MME is **disabled**, IDLE interrupt works correctly, and the RxEventCallback is triggered on frame end.
- When MME is **enabled**, the USART correctly detects the address and wakes up from mute mode, and DMA begins receiving data.
- But **IDLE interrupt never triggers** even after long idle times, unless the DMA buffer is filled entirely.
- It appears that **hardware no longer triggers IDLE** after address wake-up when in MME mode.

:books:I've reviewed the reference manual (STM32F4 series), which says IDLE or Address Match should both wake up the USART. But it seems after address match, IDLE detection may remain disabled or blocked.

:question_mark:Has anyone faced this behavior? Is this expected? Are there known limitations when using MME + IDLE together with DMA?

---

**PS:**
I know that CAN bus would be a more suitable solution for addressed variable-length frames, but due to hardware constraints, I’m limited to USART over RS485.

Thanks in advance for any insights!

1 REPLY 1
Guenael Cadier
ST Employee

hi @han11176 

My understanding is that once MME mode is enabled, the IDLE event processing is slightly different than in normal case. In MME mode, the IDLE event is used to wake up from Mute mode, but IDLE flag is not set to 1 in SR register. So, even if IDLEIE bit is enabled, this will not generate an interrupt. I think this explains what you observe.

Please see following excerpt from RM0090 in chapter 30.3.6 :

GuenaelCadier_0-1749795806375.png

Hope this helps.