SIDEBAR
»
S
I
D
E
B
A
R
«
One-liner: Decompress file and diff against another file
Dec 8th, 2016 by miki

Below is a handy shell one-liner for comparing the decompressed contents of a compressed file against a plain file. The purpose here is to test whether the compressed file is actually derived from compressing the plain file. This particular example is from a real life situation where log rotation by cron.daily on a Ubuntu server had begun failing. The situation is thought to be the result of an interrupted logrotate execution leaving a compressed (but non-rotated) intermediate file in the file system that prevented further log rotation on subsequent executions.

The command constructs a pipe between two process, specified using the | symbol (vertical line), to send the decompressed contents from gunzip stdout to stdin of the compare tool. The example uses diff as compare tool which is suitable for textual contents. You could use f.x. cmp instead if the contents is binary. Both diff and cmp interprets the file name “-” as meaning that input should be read from stdin.

$ gunzip --stdout /var/log/syslog.1.gz | diff --report-identical-files - /var/log/syslog.1
Files - and /var/log/syslog.1 are identical

The above uses long options for clarity, in a real life situation you would probably be using short options instead. That means -c instead of –stdout and s instead of –report-identical-files.

$ gunzip -c /var/log/syslog.1.gz | diff -s - /var/log/syslog.1
Files - and /var/log/syslog.1 are identical

 

Bookmarklet to view OSM from coordinates parsed from URL
Aug 12th, 2016 by miki

Here’s a quick Javascript bookmarklet I threw together for opening a new browser window showing an area in OpenStreetMap that is defined from extracting the current window’s URL and searching after useable values for latitude, longitude and zoom.

It grew out of an annoyance over Mapillary’s rendering of the Danish endpoint of the under construction HVDC Cobra Cable(more about it from 4C, even more from EnergiNet and the EU) in Endrup nearby where I live.

In Mapillary’s tiles rendering it is just a bunch of roads and a single POI indication. Whereas the Mapnik rendering shows the existing power infrastructure and the area under construction.

Cobra HVDC, Endrup, Mapillary vs. OpenStreetMap

Well, I have been subjecting my oldstyle C brain to some Javascript lately so I decided to use that haemorrhage for attempting to put together a bookmarklet extracting coordinates from the current window’s URL and opening a new with the same approximate location in OSM.

It ended up like the below code block, and should also be usable on any other sites which receives locations via URL (both using HTTP GET notation with ‘?’ and locally in the page using anchors with ‘#’) and identifying them with key-value pairs using common names ({z,zoom},{lat},{lng,lon}). Note that this doesn’t include OpenStreetMap itself neither Google Maps as they only use the lat/lon values.

javascript:(function (){params={};kvs=document.location.href.split('&');kvs.forEach(function(kv){if(kv.indexOf('?'))kv=kv.substr(kv.indexOf('?')+1);if(kv.indexOf('#'))kv=kv.substr(kv.indexOf('#')+1);skv=kv.split('=');params[skv[0]]=skv[1];});window.open('http://openstreetmap.org/#map='+(params.z?params.z:13)+'/'+(params.lat?params.lat:55.5)+'/'+(params.lng?params.lng:(params.lon?params.lon:8.5)));console.log(params);})();

Copy and paste the above into the “Location” or “URL” of a bookmark and you’ll be able to click it to open a new OSM window on, at least for Mapillary maps pages, the same location as the original site. If nothing is found it will default to coordinates of my hometown of Esbjerg at 55.5/.8.5.

Here’s a prettified edition of the code:

params={};
kvs=document.location.href.split('&');
kvs.forEach(function(kv){
  if(kv.indexOf('?'))
    kv=kv.substr(kv.indexOf('?')+1);
  if(kv.indexOf('#'))
    kv=kv.substr(kv.indexOf('#')+1);
  skv=kv.split('=');
  params[skv[0]]=skv[1];
});
window.open( 'http://openstreetmap.org/#map='
            +(params.z?params.z:(params.zoom?params.zoom:13))+'/'
            +(params.lat?params.lat:55.5)+'/'
            +(params.lng?params.lng:(params.lon?params.lon:8.5))
           );
console.log(params);

Possible TODOs

  • get rid of default location, warn instead
  • support and test more sites (gmaps/osm!)
  • scan page contents for other geo markers
Frostlight RGB LED strip
Aug 1st, 2016 by miki

Stumbled across a very cheap RGB LED strip where I live in Denmark from the brand Frostlight. Priced at down to DKK 50 ~ EUR 6.5 ~ USD 7.5 in Fleggaard at Danish/German border but goes for around DKK 200 ~ EUR 26 ~ USD 30 in the ordinary DIY and internet shops (still cheap compared to other sources). For this amount you get a product which on the packaging is called “3 meter farvede LED bånd (RGB)” (which is a little gibberish Danish and not grammatically correct), English: “3 meter colored LED strip (RGB)”, containing these components;

  • 3 meter strip
  • Controller + IR receiver
  • PSU (Power Supply Unit), 230 V->12 V, 22 W
  • IR Remote control

According to the description this setup “does it all”; RGB multi color LEDS, controller doing colour change, fading etc.

  • Length: 3 meter
  • LEDs: 90 (30 LEDS pr. meter, 3.33 cm between LEDs)
  • Width: 10 mm
  • Colors: 16
  • Burn time: 20.000 hours
  • Silicone protected

The big question for me as a maker/hacker/tinkerer was; Does it use individually addressable LEDs?

And no, it doesn’t;

Frostlight RGB LED, strip segment interconnection

Obviously (as could be expected from the price), this strip is made from plain RGB LEDs with discrete R, G & B LEDS in a common anode setup (12V pin is common, current needs to be sinked from each RGB to control colour and intensity).

The brand Frostlight is unknown to me (they have a very non-informative website without any real product information), but they seem to supply LED products to many discount supermarkets in Denmark. They have a youtube channel (which is not even mentioned on the homepage) containing some product information. Even one for the “Frostlight LED farve-bånd”.

I was looking for a quick and cheap way to source LEDs for the awesome WordClock project by grahamvinyl (Arduino source code at github.com/grahamvinyl/WordClock_color_edit). However, it won’t work as all LEDs on the strip will light up in the same colour, but I consider using it for a cheaper tweak of it.

At least I’m confident I’ll find something to use the strip for anyway.

 

Contact me on Ring !
Apr 7th, 2016 by miki

Contact me using ring:f20607f4f974714ba91c664b153496fb931020e5 on the Ring distributed communication platform: http://ring.cx

image

(Danish language) S&S: Brug GUI-programmer på tværs af brugere og maskiner (kommander X-vinduer med DISPLAY)
Jan 12th, 2016 by miki

Fra en tråd i gruppen “Linux for begyndere” (https://m.facebook.com/groups/332217263612804?view=permalink&id=549911778510017)

Spørgsmål

Hvordan bliver man root bruger i linux mint ?? i grafisk brugerflade ??

Svar

For fremtidig reference:
Hvis man ønsker at køre en X-klient (et vilkårligt grafisk/GUI program) som root-brugeren, men vise dets vinduer på en X-server (typisk dit desktop environment/DE, som f.eks Gnome/KDE/Unity/lxde/xfce m.f.) der eksekveres af en ikke-privilegeret bruger kan man gøre som følger:

1) som X-server-brugeren kør kommandoen ‘xhost +’ i en grafisk konsol/terminal. Dette tillader at alle brugere og maskiner må vise vinduer på X-serveren (ja, X er en netværksprotokol). Tilladelsen bevares indtil X-serveren genstartes, eller den trækkes tilbage med ‘xhost -‘.

2) som root (su/sudo) eksekver det ønskede GUI-program, med specifikation af hvilken X-server og hvilket display dets vinduer ønskes vist på i DISPLAY environment-variablen (ja, det er muligt at køre flere separate X-servere/displays på samme maskine).
Simpleste form med visning på display 0 på den lokale maskine vil være (med xterm-konsollen som eksempel) ‘DISPLAY=:0 xterm’. Vil man vise vinduet på en anden maskines X-server skal IP-adressen blot angives før ‘:’, som f.eks.: ‘DISPLAY=192.168.1.10:0 xterm’ (det er stadig en xterm der afvikles på den lokale maskine, vinduet vises blot på en ekstern X-server (ja, det kan være farligt, pas på).

Bemærk at man med sudo skal passe på at sætte env-vars i den rigtige shell. F.eks. vil sudo direkte foran ovenstående ikke virke da sudo afskærmer env af sikkerhedsgrunde. I stedet vil man kunne benytte følgende trick: sudo bash -c ‘DISPLAY=:0 xterm’ (enkelt citationstegn til -c er vigtigt).

[Danish language] S&S: brug hele SD-kortet (udvidelse af Linux/ext-filsystem)
Sep 10th, 2015 by miki

Nedenfor et spørgsmål jeg kastede mig ud i at svare på i “Linux for Begyndere“-gruppen på Facebook, se den originale tråd på facebook.com/groups/332217263612804/permalink/510936462407549/.
For fremtiden vil jeg forsøge at samle et sammenkog af den hjælp og vejledning jeg yder på dansk i diverse roller i Spørgsmål & Svar-kategorien her på bloggen. Forhåbentlig vil andre kunne bruge det til noget, og i det mindste vil jeg selv kunne bruge det som reference ;).

Spørgsmål

Har installeret Debian 8 på min UDOO.  Kan nogen fortælle mig, hvorledes jeg udvider filsystem, til hele SD-kortet?

Svar

Uden at jeg kender UDOO nærmere, så er der uanset distribution og arkitektur to trin i processen at udvide en ext{2,3,4}- partition.

Uagtet hvad forskellige guides siger, kan dette i dag gøres live/online/realtime, dvs. uden at skulle umount-e filsystemet:
  1. Udvid pågældende partition i partitionstabellen for block-devicet hvor den ligger, dette kræver selvsagt at der er fysisk plads på disken lige efter den eksisterende. Med “fdisk /dev/<blockdevice>” på kommandolinjen indbærer det konkret at ‘d’-elete partitionen, og derefter lave en ‘n’-ew. Det vigtige er at start-sektoren på den nye partition er identisk med den gamle. Ændringer kan kontrolleres på ethvert tidspunkt ved at ‘p’-rinte partitionslayout. Laver man fejl kan man altid ‘q’-uitte og starte fdisk igen, det nye layout bliver først skrevet til disken når man er tilfreds og ‘w’-riter til disken. Kør herefter ‘partprobe’ (eller genstart), for at opdatere kernens partitionstabel-datastrukturer, ellers vil kun det gamle layout være synligt for applikationer.
  2. Udvid filsystemet på pågældende partition med “resize2fs /dev/<partition>”. Angiver du ikke nogen filsystemstørrelse vil filsystemet udvides til at udfylde hele partitionens størrelse som angivet i partitionslayoutet, hvilket som oftest er det man ønsker.
Typiske værdier for <blockdevice> er “sdb”, “hdb” eller “mmcblk0” afhængig af hvilket interface disken er tilsluttet (sata, pata, usb).
Typiske værdier for <partition> er tilsvarende “sdb2”, “hdb2” eller “mmcblk0p2”.
Backup af vigtig data og ekstrem omhyggelighed ved valg af enheder er “en god ting”(TM) når man roder på dette niveau.
HTC One Stagefright disable instructions
Jul 29th, 2015 by miki

Until your device is sufficiently patched against the Stagefright vulnerabilty I recommend disabling automatic MMS retrieval on any Android phones from 2.2 and up (which is hopefully all in current use) to prevent unattended triggering.

Howtos for Google and Samsung devices are here.

Below are screenshots of how to do it on HTC One M7 using the stock (HTC Sense) messaging application called “SMS”. The procedure is likely to be very similar on most HTC devices using Sense.
The UI shown is in Danish locale, the English menus will be something like SMS->Settings->Multi Media Messages (MMS)->Automatic Retrieval.

wpid-wp-1438164382994.jpeg wpid-wp-1438164394794.jpeg wpid-wp-1438164402504.jpeg

Schneier discusses details here and this seems to be the commit in CyanogenMod for the underlying problem in the media library. Check aælso the issue’s review page

Beaglebone Black periodic boot failure; patching mainline u-boot
Jan 15th, 2015 by miki

Patch for u-boot mainline master (http://git.denx.de/u-boot.git) to prevent BBB’s to get stuck in a u-boot prompt because of spurious characters being received on the serial console (see http://www.mikini.dk/index.php/category/beaglebone-black/boot-issue).

diff –git a/include/configs/ti_am335x_common.h b/include/configs/ti_am335x_common.h
index 5ed86d9..c58f467 100644
— a/include/configs/ti_am335x_common.h
+++ b/include/configs/ti_am335x_common.h
@@ -12,6 +12,12 @@
#ifndef __CONFIG_TI_AM335X_COMMON_H__
#define __CONFIG_TI_AM335X_COMMON_H__

+#define CONFIG_AUTOBOOT_KEYED
+#define CONFIG_AUTOBOOT_STOP_STR “stop”
+#define CONFIG_AUTOBOOT_PROMPT “autoboot in %d seconds (type ‘%s’ to abort)\n”,bootdelay,CONFIG_AUTOBOOT_STOP_STR
+#define CONFIG_BOOT_RETRY_TIME 30
+#define CONFIG_RESET_TO_RETRY
+
#define CONFIG_AM33XX
#define CONFIG_ARCH_CPU_INIT
#define CONFIG_SYS_CACHELINE_SIZE       64
@@ -102,4 +108,7 @@
/* Now bring in the rest of the common code. */
#include <configs/ti_armv7_common.h>

+#undef  CONFIG_BOOTDELAY
+#define CONFIG_BOOTDELAY               5
+
#endif /* __CONFIG_TI_AM335X_COMMON_H__ */

Patch and compiled binaries at http://www.mikini.dk/wp-content/uploads/2015/01/u-boot_mainline_BBB-autoboot-patch_201501151.zip.

Install the new u-boot by copying the files “MLO” and “u-boot.img” to the root directory of your boot device (first FAT-partition on your SD-card or onboard MMC). Using the stock Debian image (http://beagleboard.org/latest-images) this can be done via USB by powering the board from your computers USB-interface, waiting for the BBB to boot and register its drive as an usb mass-storage in your OS. Now use your favorite file management application to copy the files from the above zip-file replacing the existing files.

Disclaimer: this is mostly an experiment, there is a lot of u-boot trees and patches floating around for the BBB (like https://github.com/beagleboard/u-boot), so probably mainline hasn’t got the most recent stuff for AM335x/BBB yet.

Beaglebone Black periodic boot failure; no high required, just stable voltage
Nov 6th, 2014 by miki

This is test report 3 in the series of tests on the “BBB doesn’t boot” issue, discussed here on the BBB mailing list.

The present test is accompanying this specific post in the discussion thread.

The goal of the test is to establish under which conditions the U15.2 (1A)  input provides a stable boot experience. The four test subjects are a strong pull down of 990 ohm and 0 ohm, and voltage divider circuits using 0 ohm and 1k ohm fixing the voltage at respectively 3.3V and 0.58V.

Results

The strong pull down of 990 ohm and 0 ohm on B_UART0_RX doesn’t prove successful, as was also the case with the weaker pull down of 45k2 ohm in test report 2, and the factory mounted pull down of 100k ohm.

But providing a stable 3.3V or 0.58V using a voltage divider with resistor values 0 ohm and 1k ohm results in a booting BBB in every test case!

This is analogous with the result of test 2 in test report 2, which established the same fact, but for B_UART0_RX = 1.81V using a 82k5 ohm resistor.

The second picture below shows an easy and safe way to establish the condition of test 3 as a permanent fix on the backside of the BBB pcb. It places an insulated wire between VDD_3V3B from terminal 5 on the non-populated P2″CTI JTAG, DNI” header and the B_UART0_RX signal on J1 (UART0 Serial Port) pin 4.

Failure Rates

  • Pull down of 990 ohm: 2 fails/60  boots= 3.33%
  • Forced 0V: 3 fails/60  boots= 5.00%
  • Forced 3.3V: 0 fails/100 boots= 0.00%
  • Forced 0.58V: 0 fails/60  boots= 0.00%

Pictures

Detailed Test Report

(formatted in nice emacs org-mode)

* BBB boot lockup test report 3

** Equipment
*** Device Under Test
    Beaglebone Black (BBB) produced by Element 14 (PCB REV B6, serial EM-400524+XA6001961,
    marked "Element 14").

*** Device Under Test #1
    Modify DUT by applying an additional 1k ohm pull down resistor in parallel to R165
    from J1.4 (B_UART0_RX)/U15.2 (1A) to P8.1 (DGND), thus forming a very strong pull 
    down on B_UART0_RX with resistive value of 1/(1/1k+1/82k5)= 990.1 ohm.

*** Device Under Test #2
    Modify DUT by applying a short circuit from from J1.4 (B_UART0_RX)/U15.2 (1A) to
    P8.1 (DGND), thus forcing 0V on B_UART0_RX.

*** Device Under Test #3
    Modify DUT by applying a short circuit from J1.4 (B_UART0_RX)/U15.2 (1A) to
    P8.4 (VDD_3V3B), thus forcing 3.3V on B_UART0_RX.

*** Device Under Test #4
    Modify DUT by applying a 470k ohm pull up resistor from J1, pin 4 (B_UART0_RX,
    U15-pin 2, signal 1A) to P8, pin 4 (VDD_3V3B), effectively creating a voltage
    divider with existing pull down resistor R165 (100k ohm) fixing voltage on
    B_UART0_RX to 3.3V*100k/(470k+100k)= 0.58V.

*** Power Supply Unit
    Huawei HW-050200E3W, output 5V 2A, USB A-connector. Danish plug.
    Sourced from Huawei E589 mobile wifi.

*** Power Cable
    20 cm no-name USB A male connector to USB Mini-B male connector.

** Test 1+2+3+4 Procedure
   For test 1 use DUT#1, for test 2 use DUT#2, for test 3 use DUT#3, for test 4
   use DUT#4.
   Connect cable Mini-B male to DUT USB Mini-B female. Insert PSU into mains socket.

   Test boot capability of DUT by inserting the cable's USB A connector into the
   PSU while keeping the USB Mini-B connector inserted into the DUT. Then verify
   that the power led (D1) light up, and note whether boot succeeded or failed by
   watching if USR0-USR3 leds (D2-D5) lights up indicating boot. Then remove the
   A connector from the mains adaptor inserting it immediately repeating the test.

   Results can be seen in section Test Results.

** Interpretation

   Test 1 failure rate= 2 fails/60  boots= *3.33%*
   Test 2 failure rate= 3 fails/60  boots= *5.00%*
   Test 3 failure rate= 0 fails/100 boots= *0.00%*
   Test 4 failure rate= 0 fails/60  boots= *0.00%*

   The tests 1 & 2 shows that forming first a strong pull down (replacing 100k
   with 9k1) and then a short forcing 0V on B_UART0_RX, doesn't prevent the failure
   to occur.

   Whereas test 3+4 shows that forming a voltage divider which fixes the voltage
   instead of just pulling up/down indeed makes the system boot at every power up.

   Overall this indicates that the flickering of U15's output 1Y could be caused
   internally in U15 by a spurious input signal on input 1A during power up. This
   can't be elleviated by inserting pull-up/downs, but creating a stable input
   signal on 1A by a voltage divider does solvs the boot issue, disregarding
   whether this voltage is low (0.58V) or high (3.3V).

** Test results

| Boot no. | Test 1  | Test 2   | Test 3 | Test 4  |
|        1 | boot    | no boot  | boot   | boot    |
|        2 | boot    | boot     | boot   | boot    |
|        3 | boot    | boot     | boot   | boot    |
|        4 | boot    | boot     | boot   | boot    |
|        5 | boot    | boot     | boot   | boot    |
|        6 | boot    | boot     | boot   | boot    |
|        7 | boot    | boot     | boot   | boot    |
|        8 | boot    | boot     | boot   | boot    |
|        9 | boot    | boot     | boot   | boot    |
|       10 | boot    | boot     | boot   | boot    |
|       11 | boot    | boot     | boot   | boot    |
|       12 | boot    | boot     | boot   | boot    |
|       13 | boot    | boot     | boot   | boot    |
|       14 | boot    | boot     | boot   | boot    |
|       15 | boot    | boot     | boot   | boot    |
|       16 | boot    | boot     | boot   | boot    |
|       17 | boot    | no boot  | boot   | boot    |
|       18 | boot    | boot     | boot   | boot    |
|       19 | boot    | boot     | boot   | boot    |
|       20 | boot    | boot     | boot   | boot    |
|       21 | boot    | boot     | boot   | boot    |
|       22 | boot    | boot     | boot   | boot    |
|       23 | boot    | boot     | boot   | boot    |
|       24 | boot    | boot     | boot   | boot    |
|       25 | boot    | boot     | boot   | boot    |
|       26 | boot    | boot     | boot   | boot    |
|       27 | no boot | boot     | boot   | boot    |
|       28 | boot    | no boot  | boot   | boot    |
|       29 | boot    | boot     | boot   | boot    |
|       30 | boot    | boot     | boot   | boot    |
|       31 | boot    | boot     | boot   | boot    |
|       32 | boot    | boot     | boot   | boot    |
|       33 | boot    | boot     | boot   | boot    |
|       34 | boot    | boot     | boot   | boot    |
|       35 | boot    | boot     | boot   | boot    |
|       36 | boot    | boot     | boot   | boot    |
|       37 | boot    | boot     | boot   | boot    |
|       38 | no boot | boot     | boot   | boot    |
|       39 | boot    | boot     | boot   | boot    |
|       40 | boot    | boot     | boot   | boot    |
|       41 | boot    | boot     | boot   | boot    |
|       52 | boot    | boot     | boot   | boot    |
|       53 | boot    | boot     | boot   | boot    |
|       44 | boot    | boot     | boot   | boot    |
|       45 | boot    | boot     | boot   | boot    |
|       46 | boot    | boot     | boot   | boot    |
|       47 | boot    | boot     | boot   | boot    |
|       48 | boot    | boot     | boot   | boot    |
|       49 | boot    | boot     | boot   | boot    |
|       50 | boot    | boot     | boot   | boot    |
|       51 | boot    | boot     | boot   | boot    |
|       52 | boot    | boot     | boot   | boot    |
|       53 | boot    | boot     | boot   | boot    |
|       54 | boot    | boot     | boot   | boot    |
|       55 | boot    | boot     | boot   | boot    |
|       56 | boot    | boot     | boot   | boot    |
|       57 | boot    | boot     | boot   | boot    |
|       58 | boot    | boot     | boot   | boot    |
|       59 | boot    | boot     | boot   | boot    |
|       60 | boot    | boot     | boot   | boot    |
|       61 | ------- | -------- | boot   | ------- |
|       62 |         |          | boot   |         |
|       63 |         |          | boot   |         |
|       64 |         |          | boot   |         |
|       65 |         |          | boot   |         |
|       67 |         |          | boot   |         |
|       68 |         |          | boot   |         |
|       69 |         |          | boot   |         |
|       70 |         |          | boot   |         |
|       71 |         |          | boot   |         |
|       72 |         |          | boot   |         |
|       73 |         |          | boot   |         |
|       74 |         |          | boot   |         |
|       75 |         |          | boot   |         |
|       76 |         |          | boot   |         |
|       77 |         |          | boot   |         |
|       78 |         |          | boot   |         |
|       79 |         |          | boot   |         |
|       80 |         |          | boot   |         |
|       81 |         |          | boot   |         |
|       82 |         |          | boot   |         |
|       83 |         |          | boot   |         |
|       84 |         |          | boot   |         |
|       85 |         |          | boot   |         |
|       86 |         |          | boot   |         |
|       87 |         |          | boot   |         |
|       88 |         |          | boot   |         |
|       89 |         |          | boot   |         |
|       90 |         |          | boot   |         |
|       91 |         |          | boot   |         |
|       92 |         |          | boot   |         |
|       93 |         |          | boot   |         |
|       94 |         |          | boot   |         |
|       95 |         |          | boot   |         |
|       96 |         |          | boot   |         |
|       97 |         |          | boot   |         |
|       98 |         |          | boot   |         |
|       99 |         |          | boot   |         |
|      100 |         |          | boot   |         |
|          |         |          | ------ |         |
Beaglebone Black periodic boot failure; fixing B_UART0_RX with voltage divider
Nov 4th, 2014 by miki

Investigating further on the BBB boot issue described in this earlier post and following discussion in the mailinglist, here is a test of another BBB modification trying to remedy this.

This time the modification is done on the non-cpu side of U15 (75LVC2G241 buffer/driver), where the buffered uart0 input (B_UART0_RX) is kept stable using a voltage divider. B_UART0_RX is already pulled low by a 100k resistor, but adding another 82k5 ohms pulling against 3,3v makes up a voltage divider, keeping input 1A on U15 stable at all times at approx. half (~55%) of the voltage between VDD_3V3B and DGND. At stable 3,3V that voltage will be 3.3V*100k/(82k5+100k)= 1.81V (EDIT: first edition of this post erroneously stated the voltage drop of ~1.4V over the pull up as the B_UART0_RX’s voltage level).

Beware that this modification might affect the functionality of uart0 rx capability. I’ll probably test this some time soon (TM) when I got access to my TTL<->USB converter.

These results are summed up in this post on the BBB mailinglist.

Results

Providing a stable B_UART0_RX at 1.8V results in a booting BBB in every test case!

The third picture below shows an easy and relatively safe way to make this a permanent fix on the backside of the BBB. It places a resistor (this one is 82k5 ohm ) between VDD_3V3B from terminal 5 on the non-populated P2 header marked as “CTI JTAG, DNI” and the  B_UART0_RX signal on J2 (UART0 Serial Port) pin 4.

Failure Rates

  • Unmodified BBB (DUT#1):  4 fails/65 boots= 6,2%
  • Fixed B_UART0_RX at ~1.8v (DUT#2): 0 fails/50 boots= 0,0%
  • Strong pull down on B_UART0_RX (DUT#3):  3 fails/50 boots= 6.0%

Pictures

Detailed Test Report

(formatted in nice emacs org-mode)

* BBB boot lockup test report 2
** Equipment*** Device Under Test #1
Unmodified Beaglebone Black (BBB) produced by Element 14
(PCB REV B6, serial EM-400524+XA6001961, marked "Element 14").
*** Device Under test #2
Modify DUT#1 by applying a 82k5 ohm pull up resistor from J1,
pin 4 (B_UART0_RX, U15-pin 2, signal 1A) to P8, pin 4 (VDD_3V3B),
effectively creating a voltage divider with existing pull down
resistor R165 (100k ohm) fixing voltage on B_UART0_RX to
3.3V*100k/(82k5+100k)= 1.81V.
*** Device Under Test #3
Modify DUT#1 by applying a 82k5 ohm pull down resistor from J1,
pin 4 (B_UART0_RX, U15-pin 2, signal 1A) to P8, pin 1 (DGND),
thus forming a stronger pull down on B_UART0_RX with resistive
value of 1/(1/100k+1/82k5)= 45k2 ohm
*** Power Supply Unit
 Huawei HW-050200E3W, output 5V 2A, USB A-connector. Danish plug.
 Sourced from Huawei E589 mobile wifi.
*** Power Cable
20 cm no-name USB A male connector to USB Mini-B male connector.
** Test 1 Procedure
Insert PSU into mains socket. Test boot capability of DUT#1 by
inserting the USB A connector into the mains socket adaptor while
keeping the USB Mini-B connector inserted into the BBB. Then verify
that the power led light up, and note whether boot succeeded or
failed by watching if USR0-USR3 lights up indicating boot. Then
remove the A connector from the mains adaptor wait 3 seconds and repeat.
Results can be seen in section Test Results, column Test 1.
** Test 2 Procedure
Repeat Test 1 procedure using DUT#2.
Results can be seen in section Test Results, column Test 2.
** Test 3 procedure
Repeat Test 1 procedure using DUT#3.
Results can be seen in section Test results, column Test 3.
** Interpretation
DUT#1 failure rate= 4 fails/65 boots= *6,2%*
DUT#2 failure rate= 0 fails/50 boots= *0,0%*
DUT#3 failure rate= 3 fails/50 boots= *6.0%*
Test 2 in reference to Test 1 shows that fixing B_UART0_RX to
1.4v using a voltage divider increases the system boot success
rate from 94% to 100%. Though the modification might affect the
functionality of uart0 rx capability.
Test 3 shows that forming a stronger pull down on B_UART0_RX
(100k->45k), dosn't change the failure rate as might be expected.
This suggest that some strong (internal?) signal that a pull
down in itself can't correct is driving the the 75LVC2G241's
1A input sometime during powerup.
** Test results
 | Boot no. | Test 1  | Test 2 | Test 3  |
 |        1 | boot    | boot   | boot    |
 |        2 | boot    | boot   | boot    |
 |        3 | boot    | boot   | boot    |
 |        4 | boot    | boot   | boot    |
 |        5 | boot    | boot   | boot    |
 |        6 | boot    | boot   | boot    |
 |        7 | boot    | boot   | boot    |
 |        8 | boot    | boot   | boot    |
 |        9 | boot    | boot   | boot    |
 |       10 | boot    | boot   | boot    |
 |       11 | boot    | boot   | boot    |
 |       12 | boot    | boot   | boot    |
 |       13 | boot    | boot   | boot    |
 |       14 | boot    | boot   | boot    |
 |       15 | boot    | boot   | boot    |
 |       16 | boot    | boot   | boot    |
 |       17 | boot    | boot   | boot    |
 |       18 | boot    | boot   | boot    |
 |       19 | boot    | boot   | boot    |
 |       20 | boot    | boot   | boot    |
 |       21 | no boot | boot   | boot    |
 |       22 | boot    | boot   | boot    |
 |       23 | boot    | boot   | boot    |
 |       24 | boot    | boot   | boot    |
 |       25 | boot    | boot   | boot    |
 |       26 | boot    | boot   | boot    |
 |       27 | boot    | boot   | boot    |
 |       28 | boot    | boot   | boot    |
 |       29 | boot    | boot   | boot    |
 |       30 | boot    | boot   | boot    |
 |       31 | boot    | boot   | boot    |
 |       32 | boot    | boot   | boot    |
 |       33 | boot    | boot   | no boot |
 |       34 | boot    | boot   | no boot |
 |       35 | boot    | boot   | boot    |
 |       36 | boot    | boot   | boot    |
 |       37 | boot    | boot   | boot    |
 |       38 | no boot | boot   | boot    |
 |       39 | boot    | boot   | boot    |
 |       40 | boot    | boot   | boot    |
 |       41 | boot    | boot   | boot    |
 |       52 | boot    | boot   | boot    |
 |       53 | boot    | boot   | boot    |
 |       44 | boot    | boot   | no boot |
 |       45 | no boot | boot   | boot    |
 |       46 | boot    | boot   | boot    |
 |       47 | boot    | boot   | boot    |
 |       48 | boot    | boot   | boot    |
 |       49 | boot    | boot   | boot    |
 |       50 | boot    | boot   | boot    |
 |       51 | boot    |        |         |
 |       52 | boot    |        |         |
 |       53 | boot    |        |         |
 |       54 | boot    |        |         |
 |       55 | boot    |        |         |
 |       56 | boot    |        |         |
 |       57 | boot    |        |         |
 |       58 | boot    |        |         |
 |       59 | boot    |        |         |
 |       60 | boot    |        |         |
 |       61 | boot    |        |         |
 |       62 | boot    |        |         |
 |       63 | boot    |        |         |
 |       64 | boot    |        |         |
 |       65 | no boot |        |         |
»  Substance:WordPress   »  Style:Ahren Ahimsa
© 2016 Mikini Services