From: Jan Kaisrlik Date: Mon, 4 Nov 2019 16:28:01 +0000 (+0100) Subject: Disable echo in default stty arguments X-Git-Tag: 20201217~24 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/novaboot.git/commitdiff_plain/3ff51fbf7b986b873287842aa53a928b7f0d3868 Disable echo in default stty arguments From time to time I observe that the novaboot hangs in the uboot menu with weird characters on the line like this => MC: mmc@7000: 0^M^JLoading Environment from MMC... OK^M^JIn: serial@3000^M^JNet: eth0: ethernet@ff3f0000^M^JHit any key to stop autoboot: 2 ^H^H^H 0^M^J=> MC: mmc@7000: 0^M^JLoading Environment from MMC... OK^M^JIn: serial@3000^M^JNet: Unknown command 'MC:' - try 'help' When I tried to play with stty options I realized that the echo option breaks the communication. The reason is that when echo is enabled (which is by default), all characters sent by the target are echoed back to the target, which may interpret them. To confirm that, I tested the following options: --stty="raw -crtscts -onlcr 115200 -echo" (working) --stty="raw -crtscts -onlcr 115200 echo" (not working) It turns out that the problem appears only during the first initial novaboot conversation with the bootloader after. After switching to interactive mode, echo is automatically disabled by Expect.pm and for subsequent boots, echo remains disabled. [Note: Commit message updated by Michal Sojka based on GitHub discussion https://github.com/wentasah/novaboot/pull/5 and his investigation of the issue.] --- diff --git a/novaboot b/novaboot index ed347cf..b86dba0 100755 --- a/novaboot +++ b/novaboot @@ -141,7 +141,7 @@ my ($target_reset, $target_power_on, $target_power_off); ); $rsync_flags = ''; $rom_prefix = 'rom://'; -$stty = 'raw -crtscts -onlcr 115200'; +$stty = 'raw -crtscts -onlcr -echo 115200'; $reset = 1; # Reset target by default $interaction = 1; # Perform target interaction by default $final_eol = 1;