New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 917868 link

Starred by 2 users

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

eve: ec: BM160 stuck at boot using ToT ec firmware

Project Member Reported by gwendal@chromium.org, Dec 26

Issue description

Using ToT firmware, reading data from the base accel BMI160 is not possible.

Looking at the chip, there is an interrupt, but the soft irq_hanlder is not called:

> gpioget ACCELGYRO3_INT_L
  0  ACCELGYRO3_INT_L

#interrupt register:
> i2cxfer r 2 0xd0 0x1c
0x00 [0]
> i2cxfer r 2 0xd0 0x1d
0x60 [96]  <<<<<< fifo water mark + fifo full
> i2cxfer r 2 0xd0 0x1e
0x00 [0]
> i2cxfer r 2 0xd0 0x1f
0x00 [0]
# Fifo length
> i2cxfer r 2 0xd0 0x22
0xeb [235]
> i2cxfer r 2 0xd0 0x23
0x03 [3]        <<<< 1K

To unlock the situation, I used
accel_init 1:

Reading on the host side
while true ; do ectool motionsense | grep "Sensor 1:" ; sleep 1 ; done
Sensor 1: -194  747     16043
Sensor 1: -194  747     16043
...
Sensor 1: -194  747     16043
Sensor 1: -194  747     16043
Sensor 1: -194  747     16043
Sensor 1: -152  744     16061  << accelinit 1 occurs.
Sensor 1: -141  727     16149
Sensor 1: -152  764     16033
Sensor 1: -111  696     15948
Sensor 1: -137  731     16080

After that, IRQ gpio is high as expected:
> gpioget ACCELGYRO3_INT_L
  1  ACCELGYRO3_INT_L

One major difference is on eve, given double tap is enabled, the accelerometer runs at 200Hz from the get go.
 
Cc: scollyer@chromium.org amstan@chromium.org
To repro after accel_init occurs, "shutdown -h 0" will put back the BM160 is stuck position.

I am uploading RO firmware, so the issue is not a transition to RW.
Using accelread while booting, the sensor is not read after transition to S0.

I am using an EVT device that still has the magnetometer.
I notice the active_state is not correct in eve/board.c: As the BMM150 and BMI160 are powered by PP3300_DSW, they are on in S5, so their active state should be .active_mask = SENSOR_ACTIVE_S0_S3_S5,

But this is just a workaround. The real issue is accelinit 3 (the magnetometer) lock the FIFO interrupt:

Dumping the iio buffer after enabling light+accel+gyro+mag.

2 6 -11 -27 1969-12-31 17:44:45       <- gyro sample
1 -161 175 15991 1969-12-31 17:44:45  <- accel sample
2 4 -12 -26 1969-12-31 17:44:45
4 106 0 0 1969-12-31 17:44:45         <- light sample
1 -148 167 16247 1969-12-31 17:44:45
2 8 -8 -28 1969-12-31 17:44:45
4 109 0 0 1969-12-31 17:44:46
<<< sending accelinit 3 on the EC console >>>
4 111 0 0 1969-12-31 17:44:46
4 110 0 0 1969-12-31 17:44:46
4 108 0 0 1969-12-31 17:44:46
4 109 0 0 1969-12-31 17:44:46
4 113 0 0 1969-12-31 17:44:46
4 112 0 0 1969-12-31 17:44:46
4 110 0 0 1969-12-31 17:44:46
4 112 0 0 1969-12-31 17:44:46
4 110 0 0 1969-12-31 17:44:46
4 105 0 0 1969-12-31 17:44:46
4 111 0 0 1969-12-31 17:44:46
4 104 0 0 1969-12-31 17:44:46
4 106 0 0 1969-12-31 17:44:46

As soon as I run accelinit 3, the soft irq hanlder is not called (INT_STATUS has fifo data, with gpioget  ACCELGYRO3_INT_L is low).

Adding an event to force the soft interrupt hanlder to  trigger unlock the situation. 

Sign in to add a comment