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.]