← index #8646Issue #1555
Related · high · value 2.728
QUERY · ISSUE

Pyboard UART.sendbreak

openby skylin008opened 2022-05-10updated 2022-06-22
port-stm32

I used the UART1 on pyboard,the baudrate is 19200bps, when used the UART.sendbreak() function, the 13 bit delay is 677uS, but actual is 520uS in oscillograph.How to solve this issue.Thanks!

CANDIDATE · ISSUE

stmhal: uart chars are being dropped, even when only at 115200 baud

openby dhylandsopened 2015-10-30updated 2015-11-25

If I try to copy a file to the pyboard over a UART using rshell, then characters get dropped.

For this test, boot.py contains:

import pyb
pyb.usb_mode(None)
uart = pyb.UART(6, 115200, timeout_char=200, read_buf_len=600)
pyb.repl_uart(uart)

I brought a GPIO high at the beginning of USART6_IRQHandler and low at the end. Channel 0 is the data arriving on the UART pin, and Channel 1 is the UART IRQ.

Logic Analyzer Capture: https://www.dropbox.com/s/6mj5kr8sn6ad81j/UART_irq.png?dl=0

The UART IRQs are spaced approx 86 usec or so apart (sometimes a bit more) 115200 full tilt would be 86.8 usec per character.

The first gap corresponds to the place in the buffer where the first dropped character occurs. The first gap is 847 usec long and the second gap is 694 usec long.

So this tells me that either interrupts are being disabled for these periods or a higher priority interrupt is occurring. I'll add some more instrumentation to see if I can figure out what might be happening.

I also found it interesting that even though there are timeouts set on the uart, the call to sys.stdin.buffer.readinto() never times out.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied