Software, electronics and anything else

Installing a new kernel onto the CHIP, round 2

In my last post, I wrote about how I installed a new kernel onto my old C.H.I.P. As it turned out, not long after writing that post my C.H.I.P. died. It wouldn’t respond to anything, and the heartbeat blinking LED stopped. I didn’t bother to connect a serial port to it, as I figured there was no point. My suspicion is that the flash somehow got corrupted.

Since I didn’t want to repeat the entire reflashing procedure again, only to wait for another random death, I looked into what options were available to me. As it turns out, macromorgan has done some work on the C.H.I.P and came up with a new way to flash it over on reddit.

I won’t repeat all his instructions here, as they’re clear and I was able to pretty easily follow them. With it, you have an easy way to reflash your device if it ever gets bricked again. As a bonus, you also get Debian 11 with a modern (5.x) kernel, unlike the old C.H.I.P software I previously showed. Unfortunately, there is one trade-off: you lose half your storage capacity, dropping it down to 2GB. In my case, this wasn’t a problem, and I was happy to trade some space for reliability considering how long it just lasted before.

All of that to say, if all you want is Debian 11 and a modern kernel, you can follow his guide and be done.

Unfortunately, I wanted to continue getting PPS working, and his kernel does not include the needed support, so I needed to build it again. As well, the procedure is different, being debian-based, and honestly the documentation out there is just confusing.

I was going to write a guide on it – and still might – but at the moment I have absolutely no time to, and probably won’t for some time. Some key notes:

  • I was able to get PPS working for GPS time synchronization
  • The kernel has been stable for going on a year now. No issues with flash or anything
  • You will need to be familiar with building a Linux kernel and some embedded development. In my case, it had been a while, but after some time I figured it out thanks to the aforementioned guides
  • You need to modify the dtb file (compiled from dts) to actually get the PPS driver to load and specify the pin to listen on. Much more of a pain than on a Raspberry Pi.
  • In the future, and if they ever become available to buy again, I’ll be getting another Pi. Much better documentation, support for new kernels, and general ease of use as a result.

macromorgan documents some of the basics and provide some essential files on his git repo here.

PPS working:

chip@CHIP:~$ chronyc sourcestats -v
                             .- Number of sample points in measurement set.
                            /    .- Number of residual runs with same sign.
                           |    /    .- Length of measurement set (time).
                           |   |    /      .- Est. clock freq error (ppm).
                           |   |   |      /           .- Est. error in freq.
                           |   |   |     |           /         .- Est. offset.
                           |   |   |     |          |          |   On the -.
                           |   |   |     |          |          |   samples. \
                           |   |   |     |          |          |             |
Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
GPS                         9   4   123     +8.098     37.073   +18.4s   831us
PPS                         8   4   111     +0.002      0.322    +16ns  5613ns
216.232.132.95              7   5  103m     +0.642      1.485  +1783us   984us
ntp1.torix.ca               6   3  103m     +0.677      1.226   +559us   813us
dns3.switch.ca              6   3  103m     +0.642      1.194   +679us   791us
backoffice-1.incentre.net  12   5  241m     +1.278      0.288  +1889us   857us

Leave a Reply

Your email address will not be published. Required fields are marked *