Bug 16365 - There are i2c command failures during the run time
: There are i2c command failures during the run time
Status: CLOSED FIXED
Product: SB Radio
Classification: Unclassified
Component: Other
: Include FW version in comment
: PC Windows XP
: -- normal (vote)
: 7.6.0
Assigned To: Vahid Fereydouny
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-07-13 18:41 UTC by Vahid Fereydouny
Modified: 2011-05-18 15:33 UTC (History)
6 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vahid Fereydouny 2010-07-13 18:41:52 UTC
There are times that i2c commands issued to MSP430 fail at run time.
Comment 1 Vahid Fereydouny 2010-07-13 19:54:17 UTC
One test I ran was to erase the MSP430 content after the Baby is completely up and running and to see the behavior of the Baby. The system goes to an infinite loop of failing i2c commands to MSP430.
# echo erase >/sys/bus/i2c/devices/1-0010/flash
[  302.885981] ssi1_irq SISR 11a1 SIER 180100 fifo_errs=1
[  302.904091] i2c-adapter i2c-1: ACK not received 
[  302.941532] msp430: flash erased
# [  303.022246] i2c-adapter i2c-1: ACK not received 
[  303.112213] i2c-adapter i2c-1: ACK not received 
[  303.252241] i2c-adapter i2c-1: ACK not received 
[  303.342242] i2c-adapter i2c-1: ACK not received 
[  303.432258] i2c-adapter i2c-1: ACK not received
Comment 2 Vahid Fereydouny 2010-07-13 20:39:00 UTC
This should be fixed so that if there are several i2c failure occurrence then the MSP430 is marked as failed. Either reset the MSP430 or reset the whole system.
Comment 3 Vahid Fereydouny 2010-07-19 15:49:50 UTC
The problem seems to be related to the check of the Brightness in SqueezeboxBabyApplet.lua. I put some log entries in the related functions and I noticed that the related functions get called around 10 times a second. Not sure why?
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:412 VAHID: doAutomaticBrightnessTimer ambient:   32
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:412 VAHID: doAutomaticBrightnessTimer ambient:   32
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:412 VAHID: doAutomaticBrightnessTimer ambient:   33
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:412 VAHID: doAutomaticBrightnessTimer ambient:   33
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:412 VAHID: doAutomaticBrightnessTimer ambient:   33
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:412 VAHID: doAutomaticBrightnessTimer ambient:   33
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:412 VAHID: doAutomaticBrightnessTimer ambient:   33
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:412 VAHID: doAutomaticBrightnessTimer ambient:   33
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:412 VAHID: doAutomaticBrightnessTimer ambient:   32
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:412 VAHID: doAutomaticBrightnessTimer ambient:   32
Jul 19 15:46:43 squeezeplay: ERROR  applet.SqueezeboxBaby - SqueezeboxBabyApplet.lua:461 VAHID: in get brightness
Comment 4 Felix Mueller 2010-07-19 23:30:29 UTC
This are calls to read the ambient light sensor value. The values then are averaged and also spikes are sorted out to get a smoothed value to work with. This is done in function getSmoothedLux().

Do you think reducing the reads / second to the ambient light sensor would actually fix the issue or only make it less frequent to happen?
Comment 5 Vahid Fereydouny 2010-07-20 00:53:44 UTC
We should be checking the Ambient once or twice every second. There is no need to check for Ambient more than 10 times a second.
Also if the reading of the Ambient fails more than 3-4 times we have to mark the communication to MSP430 as failure and crash the system OR we can add the check for functional communication to MSP430 in the watchdog.
Comment 6 Vahid Fereydouny 2010-07-20 01:02:35 UTC
After the discussion I had with Felix here is our resolution:
1. Felix will reduce the number of times we are checking Ambient
2. Vahid will add the check for the health of the communication to MSP430 in the watchdog.
Comment 7 SVN Bot 2010-07-20 08:13:36 UTC
 == Auto-comment from SVN commit #8969 to the jive repo by fmueller ==
 == http://svn.slimdevices.com/jive?view=revision&revision=8969 ==

Bug: 16365 
Description: Ambient light sensor: Reduce reading value to 500ms (was 100ms)
Comment 8 SVN Bot 2010-07-20 08:18:21 UTC
 == Auto-comment from SVN commit #8970 to the jive repo by fmueller ==
 == http://svn.slimdevices.com/jive?view=revision&revision=8970 ==

Bug: 16365 
Description: Ambient light sensor: Reduce reading value to 500ms (was 100ms)
Comment 9 Felix Mueller 2010-07-20 08:27:33 UTC
Hello Vahid

Fixed Baby (and Fab4 for that matter) to read ambient light sensor value every 500ms instead of every 100ms.

It's checked into 7.6 trunk.

Felix
Comment 10 Vahid Fereydouny 2010-07-22 18:36:18 UTC
The implementation of the watchdog in user space is located at:
squeezeos/poky/build/tmp-baby/work/armv5te-none-linux-gnueabi/watchdog-5.6-r5/watchdog-5.6
The watchdog uses a watchdog.conf file which is located at /etc/watchdog.conf at runtime. This specifies the behavior of the watchdog in user space.
In the kernel the watchdog source code is at linux-2.6.26/drivers/watchdog/mxc_wdt.c.
If the watchdog in user space fails to communicate the health of the user space through /dev/watchdog then the kernel would consider this as a failure case and causes the system to reset.
To monitor the MSP430 we should add a new application that monitors the MSP430 communication and add its pid to the watchdog.conf file.
Comment 11 Vahid Fereydouny 2010-07-28 18:09:36 UTC
The code to monitor the MSP430 is implemented as monitor_msp430 and will be checked into the 7.6 branch very soon. Also the watchdog will be changed to check the monitor_msp430 process and make sure that it is running.
Comment 12 Vahid Fereydouny 2010-08-13 15:13:44 UTC
The code is checked into the 7.6 branch. It monitors the MSP430 and makes sure that it is running fine and answering the i2c commands.
Comment 13 Bradley D. Wall 2011-05-18 15:33:54 UTC
Closing due to fix