Skip to main content
magene
Senior
May 16, 2020
Question

Is there a library or example that shows how to do interrupt and DMA I/O over a with a STM32 UART without using the HAL drivers?

  • May 16, 2020
  • 3 replies
  • 1253 views

I've been able to figure out how to do basic interrupt and DMA I/O on both STM32L4 and STM32F4 UARTs with the HAL Library. But I'd sure like to figure out how to do this without the burden of the HAL libraries. Can someone point me at a complete example?

I think I understand what Clive1 is doing in the IRQ handler here

https://community.st.com/s/feed/0D50X00009XkVxKSAV?t=1589670347809

but I haven't been able to figure out how to write all the setup code (mapping pins, enabling clocks, setting interrupts, etc.) without HAL.

A related question: I wind up doing a lot of I/O to RS232 devices and the message length is almost never known in advance. Ideally, I'd like to be able to implement the MODBUS character match function that seems to be built into the L4 but I'd also like to do the same thing on an F4. Is that possible?

This topic has been closed for replies.

3 replies

TDK
May 17, 2020

> I haven't been able to figure out how to write all the setup code (mapping pins, enabling clocks, setting interrupts, etc.) without HAL.

That's a lot of different things. If you break down what specifically you're having issues with, there is typically an easy answer. LL library is also an option.

> Ideally, I'd like to be able to implement the MODBUS character match function that seems to be built into the L4 but I'd also like to do the same thing on an F4. Is that possible?

Hardware UART Modbus character matching is not available on the STM32F4 series. You can do it in software, of course.

"If you feel a post has answered your question, please click ""Accept as Solution""."
kurta999
Senior
May 17, 2020
waclawek.jan
Super User
May 17, 2020

[shameless self-advertisement] I have some barebones examples at efton.sk/STM32 so that might demonstrate how to set up clocks/GPIO/interrupts, but I don't think there's any particular example for UART there [/shameless self-advertisement]

JW