New issue
Advanced search Search tips

Issue 591768 link

Starred by 1 user

Issue metadata

Status: Verified
Owner:
Closed: Apr 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

servo_micro has incorrect newlines with ryu/socat

Project Member Reported by davidri...@chromium.org, Mar 3 2016

Issue description

Using https://chromium-review.googlesource.com/#/c/328101/8 after "rmmod raiden.ko", I'm able to connect servod to the servo micro:

➜ sudo servod -b smaug -c servo_micro.xml
2016-03-03 11:06:53,581 - servod - INFO - Start
2016-03-03 11:06:53,739 - servod - INFO - Found servo, vid: 0x18d1 pid: 0x5002 sid: 730422-00050
2016-03-03 11:06:53,740 - servod - INFO - Found servo, vid: 0x18d1 pid: 0x501a sid: None
2016-03-03 11:06:53,740 - servod - INFO - 
2016-03-03 11:06:53,742 - servod - INFO - Press '0' for servo, vid: 0x18d1 pid: 0x5002 sid: 730422-00050
2016-03-03 11:06:53,743 - servod - INFO - Press '1' for servo, vid: 0x18d1 pid: 0x501a sid: None
1
2016-03-03 11:06:55,141 - root - INFO - 
2016-03-03 11:06:55,142 - root - INFO - Chose 1 ... starting servod on servo vid: 0x18d1 pid: 0x501a sid: None
2016-03-03 11:06:55,143 - root - INFO - 
2016-03-03 11:06:55,144 - servod - WARNING - Servo device has no iserial value
2016-03-03 11:06:55,144 - servod - WARNING - Unable to determine configs to load for board version = None
2016-03-03 11:06:55,145 - servod - INFO - Found XML overlay for board smaug
2016-03-03 11:06:55,145 - SystemConfig - INFO - Loading XML config /usr/lib64/python2.7/site-packages/servo/data/servo_micro.xml
2016-03-03 11:06:55,149 - SystemConfig - INFO - Loading XML config /usr/lib64/python2.7/site-packages/servo/data/common.xml
2016-03-03 11:06:55,155 - SystemConfig - INFO - Loading XML config /usr/lib64/python2.7/site-packages/servo/data/servo_smaug_overlay.xml
2016-03-03 11:06:55,156 - SystemConfig - INFO - Loading XML config /usr/lib64/python2.7/site-packages/servo/data/servoflex_v2_r0_p50.xml
2016-03-03 11:06:55,157 - SystemConfig - INFO - Loading XML config /usr/lib64/python2.7/site-packages/servo/data/stm32_ec_common.xml
2016-03-03 11:06:55,157 - SystemConfig - INFO - Loading XML config /usr/lib64/python2.7/site-packages/servo/data/arm_ec_common.xml
2016-03-03 11:06:55,159 - SystemConfig - INFO - Loading XML config /usr/lib64/python2.7/site-packages/servo/data/ec_common.xml
2016-03-03 11:06:55,164 - Servod - INFO - Initializing interface 1 to stm32_gpio
2016-03-03 11:06:55,166 - Servod - INFO - Initializing interface 2 to stm32_uart
2016-03-03 11:06:55,166 - Servod - INFO - Suart: interface: {'interface': 0, 'index': 1, 'name': 'stm32_uart'}
2016-03-03 11:06:55,169 - Servod - INFO - /dev/pts/6
2016-03-03 11:06:55,169 - Servod - INFO - Initializing interface 3 to stm32_uart
2016-03-03 11:06:55,169 - Servod - INFO - Suart: interface: {'interface': 3, 'index': 2, 'name': 'stm32_uart'}
2016-03-03 11:06:55,174 - Servod - INFO - /dev/pts/7
2016-03-03 11:06:55,175 - Servod - INFO - Initializing interface 4 to stm32_i2c
2016-03-03 11:06:55,175 - Servod - INFO - Si2cBus: interface: {'interface': 4, 'index': 3, 'name': 'stm32_i2c'}
2016-03-03 11:06:55,179 - Servod - INFO - Initializing interface 5 to stm32_uart
2016-03-03 11:06:55,179 - Servod - INFO - Suart: interface: {'interface': 5, 'index': 4, 'name': 'stm32_uart'}
2016-03-03 11:06:55,184 - Servod - INFO - /dev/pts/8
2016-03-03 11:06:55,184 - Servod - INFO - Initializing interface 6 to stm32_uart
2016-03-03 11:06:55,184 - Servod - INFO - Suart: interface: {'interface': 6, 'index': 5, 'name': 'stm32_uart'}
2016-03-03 11:06:55,186 - Servod - INFO - /dev/pts/9
2016-03-03 11:06:55,196 - Servod - INFO - Initialized uart1_enable to on
2016-03-03 11:06:55,202 - Servod - INFO - Initialized servo_jtag_trst to off
2016-03-03 11:06:55,205 - Servod - INFO - Initialized spi1_buf_en to off
2016-03-03 11:06:55,208 - Servod - INFO - Initialized spi2_buf_en to off
2016-03-03 11:06:55,213 - Servod - INFO - Initialized uart2_enable to on
2016-03-03 11:06:55,214 - Servod - INFO - Initialized spi1_vref to off
2016-03-03 11:06:55,216 - Servod - INFO - Initialized spi2_vref to off
2016-03-03 11:06:55,220 - Servod - INFO - Initialized servo_jtag_trst_dir to off
2016-03-03 11:06:55,223 - Servod - INFO - Initialized servo_jtag_tdi_dir to off
2016-03-03 11:06:55,224 - Servod - ERROR - Getting fw_wp_en: 'Suart' object has no attribute 'wr_rd'
2016-03-03 11:06:55,224 - Servod - ERROR - Problem initializing fw_wp_en -> off :: 'Suart' object has no attribute 'wr_rd'
2016-03-03 11:06:55,224 - Servod - INFO - Initialized fw_wp_en to off
2016-03-03 11:06:55,226 - Servod - INFO - Initialized tp1 to off
2016-03-03 11:06:55,227 - Servod - INFO - Initialized cold_reset to off
2016-03-03 11:06:55,229 - Servod - INFO - Initialized pwr_button to release
2016-03-03 11:06:55,231 - Servod - INFO - Initialized warm_reset to off
2016-03-03 11:06:55,231 - Servod - ERROR - Problem initializing rec_mode -> off :: list index out of range
2016-03-03 11:06:55,231 - Servod - INFO - Initialized rec_mode to off
2016-03-03 11:06:55,232 - Servod - INFO - Initialized fw_up to off
2016-03-03 11:06:55,234 - Servod - INFO - Initialized lid_open to yes
2016-03-03 11:06:55,237 - Servod - INFO - Initialized pch_disable to off
2016-03-03 11:06:55,238 - Servod - INFO - Initialized tp2 to off
2016-03-03 11:06:55,238 - servod - INFO - Listening on localhost port 9999
2016-03-03 11:07:02,555 - Servod - ERROR - Getting spi2_buf_on_flex_en: 'Suart' object has no attribute 'wr_rd'
2016-03-03 11:07:02,558 - Servod - ERROR - Getting fw_wp_en: 'Suart' object has no attribute 'wr_rd'
2016-03-03 11:07:02,570 - Servod - ERROR - Getting spi1_buf_on_flex_en: 'Suart' object has no attribute 'wr_rd'
2016-03-03 11:07:02,578 - Servod - ERROR - Getting jtag_buf_on_flex_en: 'Suart' object has no attribute 'wr_rd'

Initially, socat resulted in extra new lines:
sudo socat /dev/pts/8,b115200 stdout
[  303.785404] dhd_pno_initiate_gscan_request enter - run 0 flush 0

[  309.577739] healthd: battery l=99 v=4315 t=29.1 h=2 st=2 c=0 chg=u 2016-03-03 19:09:03.195170910 UTC

[  318.945148] mmc0: cmd error, mask 00060001

[  321.835983] OPEN_CLIENT_SESSION: 0x13f616f9 0x4a6f8572 0xaa03f1a1 0xfff9059b

[quest: 0xffffffc0bc3a0ce8

[  321.847436] type        0x70000001  0x00000000


After running the stty commands to fix suzy-q:
sudo stty -F /dev/pts/8  -icrnl -imaxbel -opost -onlcr -isig -icanon -echo

Newlines still look incorrect:
[  463.157167] nouveau  [     DRM] waiting for kernel channels to go idle...
[  463.164885] nouveau  [     DRM] waiting for client channels to go idle...
[ 
[  463.179419] nouveau  [     DRM] suspending kernel object tr[  463.467217] binder: release 6077:6248 transaction 336864 out, still active
[  463.481773] nouveau  [     DRM] re-enabling device...
[  463[  463.542683] nouveau  [    VOLT][57000000.gpu] GPU voltage: 843[  463.584320] nouveau  [     DRM] resuming client object trees...
[  463.698200] binder: 6101:6239 transaction failed 29189, size 220-0
[  463.704434] binder: send failed reply for transaction 336864, target dead
[  464.128179] nouveau  [     DRM] waiting for kernel channels to ing for client cle...
[  464.146408] nouveau  [     DRM] suspending client object trees...
[  464.1534ouveau  [     DRM] suspending kernel object tree...
[  465.144873] nouveau  [     DRM] re-enabling device...
[  465.rnel object treez 

Also affects the EC console.  Does not affect normal servo, nor require the explicit stty command.
 
Running the following to duplicate minicom settings seems to make things happier.
sudo stty -F /dev/pts/8 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke 

The first here is what the TTY settings are when minicom is running:
^C(cr) davidriley fuzzy 11:37 smaug| micro  ~/trunk/src/third_party/hdctools
➜ sudo stty -F /dev/pts/8
speed 115200 baud; line = 0;
min = 1; time = 5;
ignbrk -brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke

Here are the settings without minicom running, the default when the TTY is presented by servod:
(cr) davidriley fuzzy 11:38 smaug| micro  ~/trunk/src/third_party/hdctools
➜ sudo stty -F /dev/pts/8
speed 38400 baud; line = 0;
-brkint -imaxbel
-echo

Here's the settings when servod starts on normal servo:
➜ sudo stty -F /dev/pts/9
speed 38400 baud; line = 0;
min = 1; time = 0;
-brkint -icrnl -imaxbel
-opost
-isig -icanon -iexten -echo

Can you take a look at https://chromium-review.googlesource.com/#/c/328101? 

It seems to fix the socat issue by hardcoding all the termios options found on normal servo. If you are familiar with tty configs, can you take a look at stm32uart.py and ec3po_interface.py and see if the code makes sense? 
Not familiar with the code but much happier now, but permissions of the pty are wrong:

Micro:
➜ ls -l /dev/pts/8
crw-rw---- 1 root tty 136, 8 Mar  4 08:15 /dev/pts/8

Normal servo:
➜ ls -l /dev/pts/9
crw-rw-rw- 1 root tty 136, 9 Mar  4 08:16 /dev/pts/9


Status: Fixed (was: Untriaged)
fixed in:
https://chromium-review.googlesource.com/#/c/328101/
Status: Verified (was: Fixed)
Bulk verified

Sign in to add a comment