From dccdfa62c1e70cb8d65b861f25e022fdff7a4797 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 8 Nov 2021 21:47:27 +0100 Subject: [PATCH] bossa: add patch to fix flash failures on serial bossa only waited 1ms for the serial device instead calling tcdrain(). Without this patch bossa is failing to flash a ATSAM3S4 8/10 times. Patch has been submitted as PR#150 upstream. https://github.com/shumatech/BOSSA/pull/150 Signed-off-by: Alexander Couzens --- ...rt-Call-tcdrain-to-write-serial-data.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 utils/bossa/patches/101-PosixSerialPort-Call-tcdrain-to-write-serial-data.patch diff --git a/utils/bossa/patches/101-PosixSerialPort-Call-tcdrain-to-write-serial-data.patch b/utils/bossa/patches/101-PosixSerialPort-Call-tcdrain-to-write-serial-data.patch new file mode 100644 index 000000000..b285dd0a6 --- /dev/null +++ b/utils/bossa/patches/101-PosixSerialPort-Call-tcdrain-to-write-serial-data.patch @@ -0,0 +1,24 @@ +From 0fd3078b4863002e5d384d7e453d668841414abe Mon Sep 17 00:00:00 2001 +From: Kay Sievers +Date: Wed, 13 Jan 2021 01:34:08 +0100 +Subject: [PATCH] PosixSerialPort: Call tcdrain() to write serial data +GithubPR: 150 + +--- + src/PosixSerialPort.cpp | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/src/PosixSerialPort.cpp ++++ b/src/PosixSerialPort.cpp +@@ -290,10 +290,7 @@ PosixSerialPort::put(int c) + void + PosixSerialPort::flush() + { +- // There isn't a reliable way to flush on a file descriptor +- // so we just wait it out. One millisecond is the USB poll +- // interval so that should cover it. +- usleep(1000); ++ tcdrain(_devfd); + } + + bool