Nico Huber would like Urja Rannikko and build bot (Jenkins) to review this change.

View Change

Fix serprog on FreeBSD

Using serprog on FreeBSD to read an SPI flash (MX25L6406) via an
Arduino Nano V3 with flashrom hangs after 5 seconds while reading. The
problem is that kernel method "ttydisc_rint" ignores some bytes. It
happens due to enabled IEXTEN local flag of termios. TTY cuts a few
bytes, Arduino reads 11264 bytes, but flashrom gets only 11244 bytes
and waits for the remaining 20 bytes.

The fix is simple: turn off the IEXTEN local flag.

Tested on Arduino Nano V3 + FreeBSD 12-CURRENT.

Change-Id: I7aa6a283d523c544d9b8923cd4c622bf08c0fb3f
Signed-off-by: Michael Zhilin <mizhka@gmail.com>
Reviewed-on: https://review.coreboot.org/21919
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Urja Rannikko <urjaman@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
---
M serial.c
1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/34/22334/1
diff --git a/serial.c b/serial.c
index a64a51d..1b14fb5 100644
--- a/serial.c
+++ b/serial.c
@@ -203,7 +203,7 @@
}
wanted.c_cflag &= ~(PARENB | CSTOPB | CSIZE | CRTSCTS);
wanted.c_cflag |= (CS8 | CLOCAL | CREAD);
- wanted.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG);
+ wanted.c_lflag &= ~(ICANON | ECHO | ECHOE | ISIG | IEXTEN);
wanted.c_iflag &= ~(IXON | IXOFF | IXANY | ICRNL | IGNCR | INLCR);
wanted.c_oflag &= ~OPOST;
if (tcsetattr(fd, TCSANOW, &wanted) != 0) {

To view, visit change 22334. To unsubscribe, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: 1.0.x
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7aa6a283d523c544d9b8923cd4c622bf08c0fb3f
Gerrit-Change-Number: 22334
Gerrit-PatchSet: 1
Gerrit-Owner: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: Urja Rannikko <urjaman@gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>