Frequent freezes with Debian on A20-Lime2

Started by rplasson, March 19, 2015, 05:30:31 PM

Previous topic - Next topic

rplasson

Hi,

I installed debian on the nand on my Lime2 with no problem (using the Igor Pečovnik image, kernel 3.4.105 on Jessie). The purpose is to build a file server via NFS (HD on the SATA port). It works likes a charm... for some time. Actually, it seems perfectly stable as long as I do not use too intensely the file server, precisely :-/. The machine frequently freezes with no warning, especially on heavy charges (both on sata and CPU, as NFS uses implies a quite important CPU load on such small machines).

The freeze is sudden and total, so impossible to get any information foe the reason of the freeze. Nothing is saved in the logs, watching a tail -f of the logs in live during freezes via ssh doesn't give any information anyway (the first visible characteristic of the freeze being a loss of the network link). I even tried to have a tail -f of the logs running on the console and monitor it by plugging a monitor via HDMI: same think, just a screen freeze. Copied the system on sd card, boot from it; no change. The chip only seems slightly hot when the problems occurs, so I don't think it is some overheating problem (I rebooted quickly after a freeze, a temperature of about 38°C was then reported).

Any idea where this problem may come from? Anyone met similar problem? Any suggestion to where to look for pinpointing the origin of the problem?

Thank you

progmetalbg


rplasson

It is the 5V/1A power supply sold by Olimex. I additionally attached a small 1400mAh LiPo Battery to keep the board on power, as a (cheap) protection in case of short power outage.

Would this be potentially an insufficient power source for high CPU/SATA peak use?

progmetalbg

Under high CPU load board power consumption is probably around 3-4 W, 2.5" disks also consume up to 5W.
So it is like having an AMD Bulldozer FX-9590 + Radeon 295X2 powered by a noname 300W chinese PSU :)
Try to power the board with at least 2A 5V power supply of high quality.

rplasson

Oh, I wouldn't have expected such high numbers... But indeed it would perfectly explain the problem. I was focused on potential bottlenecks on either CPU, SATA or ethernet when building the file server, and just didn't think about power issues >_<

Just some thoughts:
— can attached batteries provide temporarily _additional_ power to the supply in case of high demand, or is the board only switching to it when no power is provided? Any idea of the power the LiPo batteries sold by Olimex can deliver (only voltage and capacity are given)
— the board can also be powered by USB; same question, would this power source be added to main one?
— of course, in any case, above solutions (if efficient) may only be used as temporary workarounds. Any idea where  more powerful powerful supply suitable for Lime2 can be found? Only the 5V/1A are sold on Olimex website.

Thank you,

Raphaël

progmetalbg

As far as I know board cannot be powered by 2 power sources at the same time.
Examples:
PSU and battery are connected then:
if battery is at 100% board will be powered by PSU.
if battery is below 100% board will be powered by PSU, but battery will also be charged by the AXP209 chip.
if PSU is switched off then board is powered by battery.
Olimex power jack specs: https://www.olimex.com/wiki/PWRJACK
In Eastern and Central Europe Sunny PSUs are quite popular, I think Olimex also sell them (their non-Chinese, more expensive PSUs)
This one http://www.sunny-euro.com/en/products/sys1381-1005-w2e-europe-2-1x5-5x11-s-2wc-1-4m-4-5ft seems suitable and costs 7-8 euro where I live.

As for the Olimex batteries: I have A10 LIME, 4400 mAh battery and an ancient 40 GB Toshiba 2.5" disk, rated 5V, 1A.
Battery was able to power the board+HDD for almost 7 hours with not so intensive use though.

JohnS

And USB standard means cannot provide much power.

John

jmyreen

Quote from: rplasson on March 19, 2015, 07:23:37 PM

Just some thoughts:
— can attached batteries provide temporarily _additional_ power to the supply in case of high demand, or is the board only switching to it when no power is provided? Any idea of the power the LiPo batteries sold by Olimex can deliver (only voltage and capacity are given)
— the board can also be powered by USB; same question, would this power source be added to main one?
— of course, in any case, above solutions (if efficient) may only be used as temporary workarounds. Any idea where  more powerful powerful supply suitable for Lime2 can be found? Only the 5V/1A are sold on Olimex website.

Thank you,

Raphaël

Things are a bit complicated. The Lime2 has an AXP209 Power System Management IC on board. From the datasheet:

"The AXP209 power input can come from lithium battery (BAT),USB VBUS Input, external power
supply (ACIN). The IPS will select an appropriate power source depending on the battery and external
power conditions.
O When only the battery is available, no external power input, the battery powers the system;
O When there is a valid external power source(VBUS Or ACIN), is is the preferred power supply.
O When the external power is removed, the IPS will seamlessly switch over to battery power.
O When both VBUS and ACIN are available, ACIN will be used to power the system and recharge
the lithium battery;
O If the ACIN cannot provide sufficient current, VBUS is also connected to source more
current;
O If the drive capacity is still insufficient, then the charge current is reduced to zero, the
battery is used to power the system.

[...]

As shown above, when ACIN provides insufficient load ability, IPSOUT voltage will fall, and BAT
will change from charge to discharge to supply load current together with ACIN."

So yes, the board can in principle use additional power from the battery and USB in addition to the power supplied via the power connector.

However, I would recommend getting a stronger power supply. A 2 Amp supply is not so hard to find. Here's a 3.1 A model: http://www.hwkitchen.com/products/advanced-dual-usb-5v-3a1-wall-charger-with-cables/



rplasson

Yeah, just what I feard...

As for the power consumption of my system, the HD I use is reported to consume 1.6W on read/write as an average value, and 1.8 on seek (average value also). The Lime2 User manual reports a board consumption of 0.45 to 0.65A, that is 2.25 to 3.25W. So if the HD use remains "average", the consumption is 3.85 to 4.85W on read write, and up to 5.05W on seek. So no surprise that this setup works perfectly on normal use with a 5W power supply, while laying dangerously close to the max power that can be provided. Which explains the stability of he system on normal charges (I could have my Lime2 running for several day with HD plugged) and its sudden freeze on high drive access.

Well, thanks for the help. I will indeed look for a better power supply.

rplasson

PS: FYI, to enable the "SATA link power management" as suggested by a utility like powertop may seem a good idea (it implies to switch /sys/class/scsi_host/host0/link_power_management_policy from max_performance to min_power). It is not. The HD surely did consume less power, but I couldn't activate it back and had to reboot >_<

jmyreen

USB power supplies providing enough power are readily available. You can buy a USB to barrel connector cable separately:

https://www.sparkfun.com/products/8639

Note that powering the board solely via the USB OTG connector is not recommended. The problem is that the board refuses to draw more than 900 mA via the USB port. See this post for more information:

https://www.olimex.com/forum/index.php?topic=4058.msg17333#msg17333