-
Notifications
You must be signed in to change notification settings - Fork 16
Description
This is not really an issue, as I've already solved it, but rather a guide that could be worthwhile to add to the repo.
If you're not using the official adapter and cable supplied with the Car Thing, you'll most likely run into the boot error message instructing you to use the official power adapter.
This is of course bollocks, because this thing can easily run off of any power adapter that can supply the appropriate amount of amps at 5V. 1A seems to be more than enough as I was able to get past this screen via my dumb power strip's USB port.
But, it is an annoyance, and it isn't that simple to get past it, unless your Google-fu is top notch (hint: it's done by pressing the small front button, and Button 5 on top, holding the two together until the alert goes away).
There is, however, a permanent way to get rid of this, by editing the bootcmd environment variable.
This var by default is set to run check_charger, which in turn runs the check_charger env var's content, the following string of commands:
mw 0xFF6346DC 0x33000000;mw.b 0x1337DEAD 0x00 1;mw.b 0x1330DEAD 0x12 1;mw.b 0x1331DEAD 0x13 1;mw.b 0x1332DEAD 0x15 1;mw.b 0x1333DEAD 0x16 1;i2c dev 2;i2c read 0x35 0x3 1 0x1337DEAD;if cmp.b 0x1337DEAD 0x1330DEAD 1; then run storeboot;elif cmp.b 0x1337DEAD 0x1331DEAD 1; then run storeboot;elif cmp.b 0x1337DEAD 0x1332DEAD 1; then run storeboot;elif cmp.b 0x1337DEAD 0x1333DEAD 1; then run storeboot;else osd open;osd clear;imgread pic logo bad_charger $loadaddr;bmp display $bad_charger_offset;bmp scale;vout output ${outputmode};while true; do sleep 1; if gpio input GPIOAO_3; then run splash_boot; fi; i2c read 0x35 0x3 1 0x1337DEAD;if cmp.b 0x1337DEAD 0x1330DEAD 1; then run splash_boot;elif cmp.b 0x1337DEAD 0x1331DEAD 1; then run splash_boot;elif cmp.b 0x1337DEAD 0x1332DEAD 1; then run splash_boot;elif cmp.b 0x1337DEAD 0x1333DEAD 1; then run splash_boot;fi;i2c mw 0x35 0x09 0x8F 1;done;fi;
Here it is, a bit formatted:
mw 0xFF6346DC 0x33000000;
mw.b 0x1337DEAD 0x00 1;
mw.b 0x1330DEAD 0x12 1;
mw.b 0x1331DEAD 0x13 1;
mw.b 0x1332DEAD 0x15 1;
mw.b 0x1333DEAD 0x16 1;
i2c dev 2;
i2c read 0x35 0x3 1 0x1337DEAD;
if cmp.b 0x1337DEAD 0x1330DEAD 1;
then run storeboot;
elif cmp.b 0x1337DEAD 0x1331DEAD 1;
then run storeboot;
elif cmp.b 0x1337DEAD 0x1332DEAD 1;
then run storeboot;
elif cmp.b 0x1337DEAD 0x1333DEAD 1;
then run storeboot;
else osd open;
osd clear;
imgread pic logo bad_charger $loadaddr;
bmp display $bad_charger_offset;
bmp scale;
vout output ${outputmode};
while true;
do sleep 1;
if gpio input GPIOAO_3;
then run splash_boot;
fi;
i2c read 0x35 0x3 1 0x1337DEAD;
if cmp.b 0x1337DEAD 0x1330DEAD 1;
then run splash_boot;
elif cmp.b 0x1337DEAD 0x1331DEAD 1;
then run splash_boot;
elif cmp.b 0x1337DEAD 0x1332DEAD 1;
then run splash_boot;
elif cmp.b 0x1337DEAD 0x1333DEAD 1;
then run splash_boot;
fi;
i2c mw 0x35 0x09 0x8F 1;
done;
fi;
Now I'm not claiming that I fully understand the above script, but what I broke it down to (and please correct me if I'm wrong) is basically:
- Store a few predefined values in the indicated
0x1337DEAD,0x1330DEAD-0x1333DEADaddresses - Read from I2C device 2 at address 0x35 0x3, into the memory address
0x1337DEAD(I presume writing0x00on line 2 simply resets that memory address) - Compare the read value with the predefined values set in step 1.
- If the read value matches any of the predefined values (
0x12,0x13,0x15or0x16), go to step 9 - If the read value does not match, display the
bad_chargerbitmap, and continue - Refresh every second/millisecond (
sleep 1- not sure if in U-boot env this means 1s or 1ms) - If GPIOAO_3 (button 4) is pressed, go to step 9
- Read and compare values again
a. I presume thei2c mw .....command resets the I2C device in question to get a new (power?) reading run splash_boot- continue booting the system.
This check can be easily bypassed simply by setting the bootcmd env var to run splash_boot instead of check_charger:
./bin/update bulkcmd 'amlmmc env'
./bin/update bulkcmd 'setenv bootcmd run splash_boot'
./bin/update bulkcmd 'env save'
After sending these commands, the Car Thing should now completely bypass all power adapter checks.