I'm using both serial ports in UART mode on the 32F051, plus one or both I2C ports - so not enough DMA controllers to go round.
I'm only using serial at 9600 baud, so added a compile-time option to the UART driver so that it could be interrupt-driven rather than use DMA.
Use the attached to replace the standard STM32/UARTv2 files, and for interrupt-driven handlers add in mcuconf.h:
#define STM32_UART_USE_INTERRUPTS TRUE
(if not defined, the driver defaults to DMA for BC)
[TODO] Interrupt-driven UART Driver for STM32F05x
[TODO] Interrupt-driven UART Driver for STM32F05x
- Attachments
-
- USARTv2.zip
- Unzip in platforms/STM32 directory
- (19.91 KiB) Downloaded 840 times
Re: Interrupt-driven UART Driver for STM32F05x
uh...nice. Please add this to trunk. I'm not able to test it extensively though now ...
Also I'd like to have that option for I2C and SPI...this is the usual case on AVR, where no DMA is present.
Cheers
Stefan
Also I'd like to have that option for I2C and SPI...this is the usual case on AVR, where no DMA is present.
Cheers
Stefan
Re: [TODO] Interrupt-driven UART Driver for STM32F05x
Updated version for 3.x attached
- Attachments
-
- USARTv2.zip
- (7.92 KiB) Downloaded 759 times
Re: [TODO] Interrupt-driven UART Driver for STM32F05x
Thanks steved, I am glad to see this. I hope to see, or possibly write myself, interrupt-driven options for SPI and I2C on the STM32F0 as well, since I want to use two SPI and two I2C concurrently for a project.
Re: [TODO] Interrupt-driven UART Driver for STM32F05x
Oh yeah, actually someone has developed an interrupt-driven I2C driver for STM32F0 already
Re: [TODO] Interrupt-driven UART Driver for STM32F05x
colin wrote:Oh yeah, actually someone has developed an interrupt-driven I2C driver for STM32F0 already
Unfortunately looks like that one is for the STM32F1, unless I've missed something. (I'd noted it as a possible basis for a 32F0 version).
I did start on an interrupt-driven I2C driver, without total success; some of what I was trying to achieve is covered in this thread
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Has thanked: 3 times
- Been thanked: 3 times
Re: [TODO] Interrupt-driven UART Driver for STM32F05x
steved wrote:I'm using both serial ports in UART mode on the 32F051, plus one or both I2C ports - so not enough DMA controllers to go round.
I'm only using serial at 9600 baud, so added a compile-time option to the UART driver so that it could be interrupt-driven rather than use DMA.
Use the attached to replace the standard STM32/UARTv2 files, and for interrupt-driven handlers add in mcuconf.h:
#define STM32_UART_USE_INTERRUPTS TRUE
(if not defined, the driver defaults to DMA for BC)
Great job! I used it and it works as expected. Thank you.
- DeusExMachina
- Posts: 223
- Joined: Tue Apr 03, 2012 5:08 am
- Has thanked: 3 times
- Been thanked: 3 times
Re: [TODO] Interrupt-driven UART Driver for STM32F05x
I have a byte-oriented protocol, so it's easier to manipulate the input data using UART driver.