]> rtime.felk.cvut.cz Git - novaboot.git/commit
Disable echo in default stty arguments
authorJan Kaisrlik <jan.kaisrlik@avast.com>
Mon, 4 Nov 2019 16:28:01 +0000 (17:28 +0100)
committerMichal Sojka <michal.sojka@cvut.cz>
Wed, 6 Nov 2019 09:04:32 +0000 (10:04 +0100)
commit3ff51fbf7b986b873287842aa53a928b7f0d3868
tree61ade109282682ff26d843063e1463363d86ad32
parent3d82783b28cc9c77e11758484698f1fac2acec16
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.]
novaboot