Skip to content

Commit 98417ea

Browse files
Fix another hang bug, fix not printing certain test output
1 parent 5557f66 commit 98417ea

File tree

2 files changed

+11
-0
lines changed
  • targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device
  • tools/python/mbed_os_tools/test/host_tests_conn_proxy

2 files changed

+11
-0
lines changed

targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/serial_api.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,15 @@ int serial_getc(serial_t *obj)
292292
return 'x';
293293
}
294294

295+
// Similar to above but with the overflow flag. Without this logic we can hang when receiving
296+
// at 921600 baud. Oddly, the overflow flag in RSR does not seem to be reliable, but the overflow
297+
// flag in IES seems to be. Not sure why this UART has two overflow flags in the first place, smh...
298+
if(bytes_read == 0 && UARTn(obj->serial.uart_control->inst)->IES_b.OERIS)
299+
{
300+
UARTn(obj->serial.uart_control->inst)->IEC_b.OEIC = 1;
301+
return 'x';
302+
}
303+
295304
} while (bytes_read == 0);
296305

297306
return (int)rx_c;

tools/python/mbed_os_tools/test/host_tests_conn_proxy/conn_proxy.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,11 @@ def append(self, payload: bytes):
6262
before = line[:pos]
6363
after = line[pos + len(match):]
6464
if len(before) > 0:
65+
logger.prn_rxd(before)
6566
discarded.append(before)
6667
if len(after) > 0:
6768
# not a K,V pair part
69+
logger.prn_rxd(after)
6870
discarded.append(after)
6971
logger.prn_inf("found KV pair in stream: {{%s;%s}}, queued..."% (key, value))
7072
else:

0 commit comments

Comments
 (0)