ubuntu 16.04 forçar a velocidade do terminal serial

1

Não consigo manter a velocidade fixa no terminal serial / dev / ttyS0. Eu uso:

stty -F /dev/ttyS0 115200
root@ubuntu:/# stty -F /dev/ttyS0 -a
speed 115200 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = <undef>; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

Aparentemente, isso mudou. No entanto, quando eu começo a enviar alguns caracteres através da porta serial (eu sou 100% positivo que eu uso 115200, eu verifiquei se conectar ao windows com port), o terminal do Ubuntu muda automaticamente para 9600 novamente!

stty -F /dev/ttyS0 -a
speed 9600 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = <undef>; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon ixoff -iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig -icanon -iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc

Como forçar o terminal a usar o 115200 fixo?
Aparentemente, ele está mudando para 9600 por motivo desconhecido, ou (tenta) detectar automaticamente a velocidade serial?

Mais informações. O GRUB (configurado via / etc / default / grub) está sendo gerado corretamente em 115200

error: no video mode activated.

                    GNU GRUB  version 2.02~beta2-36ubuntu3.2

 +----------------------------------------------------------------------------+
 |*Ubuntu                                                                     |
 | Advanced options for Ubuntu                                                |
 | Memory test (memtest86+)                                                   |
 | Memory test (memtest86+, serial console 115200)                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 |                                                                            |
 +----------------------------------------------------------------------------+

      Use the ^ and v keys to select which entry is highlighted.
      Press enter to boot the selected OS, 'e' to edit the commands
      before booting or 'c' for a command-line.
   The highlighted entry will be executed automatically in 0s.

Mas imediatamente após o GRUB, apenas lixo, meu Ubuntu 16.04 está enviando novamente para 9600.

Mais atualizações: De acordo com isso, pode ser um bug da agetty
link

systemctl status [email protected][email protected] - Serial Getty on ttyS0
   Loaded: loaded (/lib/systemd/system/[email protected]; disabled; vendor p
   Active: active (running) since Du 2016-11-13 17:58:28 EET; 1s ago
     Docs: man:agetty(8)
           man:systemd-getty-generator(8)
           http://0pointer.de/blog/projects/serial-console.html
 Main PID: 12526 (agetty)
   CGroup: /system.slice/system-serial\x2dgetty.slice/[email protected]
           └─12526 /sbin/agetty --keep-baud 115200 38400 9600 ttyS0 vt220

quando eu emito manualmente, sem --keep-baud, funciona

/sbin/agetty 115200 ttyS0 vt220

Então a questão agora é como desativar a opção --keep-baud para sempre. Não consigo encontrar qualquer inicialização de agetty.

Obrigado antecipadamente!

    
por orfruit 13.11.2016 / 10:49

0 respostas