2010-10-21 01:16 PM
STM32F103V performance high enough?
2011-05-17 05:12 AM
Assuming you want 5 RS-232 channels to operate at once you will have to check if there are enough DMA channels.
But direct DMA to/from USB from/to RS-232 is out. You should be able to move RS-232 data to/from USB *buffers* via DMA because you can DMA RAM to RAM. But why use DMA at all? A little arithmetic: 300K baud = 30K bytes/sec = 30 bytes/millisecond or 72000/30 = 2400 clocks/byte. 5 channels at once gives 2400/5 = 480 clocks/byte. I.e. if you are careful with the USB you can to the whole thing without DMA. Indeed, it were 5 bi-directional RS-232 ports running flat out you could still interrupt once per byte. Each RS-232 interrupt should take <100 clocks. 100 clocks * 10 half-duplex channels * 30 bytes/millisecond each channel = RS-232 30000 clocks/millisecond. Which is still under half of the processor compute power. Of course the other demands on the processor may exceed the remaining processor bandwidth.2011-05-17 05:12 AM
Check the datasheet very careful and test your application!
DMA-channels are hard-wired. You cannot choose them like you want. Check the images in the datasheet. 5 UARTs in F103 are new for me. You should check if they can be used at the same time and in combination of USB ;)2011-05-17 05:12 AM
UARTs 1...4 can be used with DMA, UART5 can only work in interrupt driven mode.
If you are able to design the system avoiding buffer to buffer copy operations then the STM32 should have enough performance for that task. You will have to manipulate USB, UART and DMA operations exclusively from interrupt handlers however, not easy to debug IMO. Giovanni ---2011-05-17 05:12 AM
What do you mean exactly by buffer to buffer copy operations? I`ll try to use the interrupt mode for all usarts and if a new data packet arrived I store this pkt in the sram until I`ve received a full packet.
After that I have to copy this buffer to the memory part of the usb, so that the usb will see that a new data packet is availalbe to transmit to the processor.2011-05-17 05:12 AM
I meant that it would probably be possible to DMA incoming USB data directly from the USB memory to the UART data register without copying it into another buffer first, this would minimize the CPU usage during the transfer. On the DMA transfer-end interrupt the USB buffer would be released.
Giovanni2011-05-17 05:12 AM