Bugzilla – Bug 16365
There are i2c command failures during the run time
Last modified: 2011-05-18 15:33:54 UTC
There are times that i2c commands issued to MSP430 fail at run time.
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
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.
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
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?
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.
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.
== 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)
== 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)
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
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.
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.
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.
Closing due to fix