AnsweredAssumed Answered

maximum throughput for usart

Question asked by mccarty.michael on Sep 25, 2012
Latest reply on Sep 28, 2012 by mccarty.michael
Hello All, 
  Finally got to a stm32 discovery specific question. I've turned my baud up to a really high rate 921600. I have a simple loop that sends a request for data and then gets data back from the stm32 as fast as possible. 

  I only ever see about 300Kbs. I dont see any errors so I'm wondering if simply the processing of the packet takes so long that it bottlenecks my baud rate ? 

  I'm using the F0 
STM32F051 series for testing. 

  I have thought about dma'ing the usart data into memory and then using a crc inside the memory sent to check the memory on dma TC, then mark the data as good, bad or new. This I think would give me the maximum throughput, allowing one dma of rx to kick off the dma of tx. But i dont know if thats a good idea. 

  I'm currently using a circular buffer and pulling/reading the bytes out into another buffer before processing that data as a packet. Then I send the response packet after building it using dma. My packet sizes are just over 100 bytes. 

  I want to tell if the program flow is whats taking the time and causing the bottleneck, because that would be cross telemetry/periph. 

  Guess I could run some tests getting the time in ms since getting the first byte and sending the packet to profile the code. 

  Any advice is appreciated ! 
  Thanks

Outcomes