Randall Hyde's Blog
April 2, 2022
The Book of I2C
No Starch has just announced the pre-production release of my new book “The Book of I2C.” This book covers the use of the I2C bus used in many embedded computer systems. In particular, this bus is very popular for adding peripheral devices to Arduino and Raspberry Pi systems.
You can find out more information about The Book of I2C at https://nostarch.com/book-i²c.
February 28, 2022
Humble Bundle with WGC
No Starch Press is offering a “Humble Bundle” which includes Write Great Code vols 1, 2, and 3. Check it out before it goes away! https://www.humblebundle.com/books/jo...
October 4, 2021
Art of 64-Bit Assembly
Due to Covid-19 and certain marketing constraints, No Starch Press is putting off the formal release of “The Art of 16-Bit Assembly Language” until January 11, 2022. However, if you pre-order a copy (https://nostarch.com/art-64-bit-assembly), they will send you a hard copy as soon as they arrive from the printers (expected date: Oct 20, 2021). Of course, electronic copies will be available after that date as well.
Sorry for the confusion and delays. Pray that next year the pandemic will start to become a bad memory.
August 25, 2021
TRTR
October 17-21 (2021) I will be attending the TRTR (Test, Research, and Training Reactors) annual conference in Raleigh NC. I’ll be showcasing Plantation Productions’ Nuclear Reactor Digital Console upgrades (hardware and software). For more details, check out https://projects.ncsu.edu/mckimmon/cp... and https://trtr.org.
Avoid Budget Truck Rentals Website…
I was recently moving from California to Tennessee (just couldn’t take CA anymore). I wanted to compare truck rental prices between UHaul, Budget, and Penske. I made the mistake of going to the Budget truck rental website, entering email and phone number (required to get an estimate from them). I expected a phone call with a dollar amount. Low and behold, they released my phone number and email address to *dozens* of moving companies. Now I’m getting spammed, texted, and called constantly from companies all over the US.
Don’t make the same mistake I did. Stay way from Budget Truck rental’s website.
June 25, 2021
2018 Mac Mini vs. 2020 Mac Mini M1
I recently purchased a Mac Mini M1 in order to begin working on The Art of ARM Assembly Language. To preserve desk space, I just connected it (via Ethernet) to my iMac Pro and used Apple’s Remote Desktop application in order to operate the Mini M1 from my iMac Pro desktop (in a window, much like running Microsoft Windows in a Parallels window). While there was a tiny bit of lag (barely noticeable), performance was fine. This surprised me as the (couple of years’ old) reviews of the product suggested the performance was trash. Oh well, Apple’s product description in the app store mentioned that improved performance was one of the latest and greatest features, I chalked up my experience to that.
One area where performance was noticeably lacking was when running Ubuntu Linux under Parallels on the M1 (this was an ARM version of Linux, so the performance drop was not due to emulation). The cursor was very “laggy” when running under Parallels on Remote Desktop. Fortunately, I only use the command-line shell for my work on The Art of ARM Assembly, so this isn’t an issue. For those running Linux GUI apps, this might be an issue.
One “bug” in the set up is that when you instruct Remote desktop to shut down the M1, it properly shuts down the OS but does not always power off the Mac Mini itself. You have to hold the power button in for 10 seconds (or so) to complete the power-down operation. This is probably a bug on the Mac Mini M1 side.
I also had a 2018 Mac Mini laying around (Intel i7, six cores, 32GB RAM) that I’d used on and off (mostly off) as an Apple Server (running Apple’s Server software). I figured I’d run it in a Remote Desktop window as well to get a little more use out of the thing (currently, I have to hook up a monitor and keyboard to it every time I use it, because of the afore mentioned lack of desk space problem). It works fine under Remote Desktop as well.
Note, by the way, that powering down the x86 Mac Mini from Remote Desktop always works fine.
Art of 64-bit Assembly has Arrived!
https://nostarch.com/art-64-bit-assembly
No Starch is making the Art of 64-bit Assembly available as part of their “early” access program. You can take advantage of this preview offer at the link above.
Cheers,
Randy Hyde
April 24, 2021
The Cat is Out of the Bag
Well, Amazon has posted a preliminary (pre-order) ad for it, so I may as well announce it:
The Art of 64-Bit Assembly Language is coming soon!
(Amazon claims August 31; that usually means late Sept/early October).
The book has gone through two-and-a-half sets of editing thus far: initial editing, technical review, and it’s about ⅔ of the way through a final edit phase now (I just returned chapter 10 of 16 to No Starch). Once the final editing (copy editing) is done, it goes to layout. There will be two passes on that (one pass with individual chapters in PDF form, one pass with the whole book in PDF form) and then it’s off to the printers. Based on my past experience, Sept/Oct looks very good.
Next week I’m supposed to start getting PDF proofs for the individual chapters. That probably means that No Starch will put the book into their “early access program” within a month or two.
In any case, the new support web page is now active. You can check it out at https://artofasm.randallhyde.com/
It used to point at the 32-bit stuff, now it’s been hijacked for The Art of 64-bit Assembly Language.
April 23, 2021
Raspberry Pi in Secure Embedded Systems: WTF? (What? That Fails)
Although I haven’t made much use of the Raspberry Pi as an embedded CPU, I’ve always wanted to make more use of it and I constantly promote the little board as such a tool. The Pi isn’t perfect, but at the price point and hardware capabilities, I’ve always thought it was a great tool for many embedded uses despite a common joke I repeat about the Pi:
“The Pi is great for embedded system except during three different times of execution: during startup, during normal execution, and during shutdown.”
The follow up is this:
During startup, the Pi takes too long to boot. Many embedded system require near-immediate operation (operating within a couple of seconds) and can’t tolerate the 30 seconds to a couple minutes boot time of Pi OS.
During normal operation, the Pi cannot support real-time response, so it is completely unsuitable for those applications requiring real-time operation.
During shutdown, you must explicitly shut down the Pi (i.e., you cannot simply cut power to it without risking damage to the SD card).
Very little can be done about the boot time. Fortunately, not all embedded applications require immediate operation after applying power, so although the Pi isn’t usable for all embedded application, it can still be used for many that can tolerate a slow startup period.
If your application requires real-time response, you’re not going to get it out of Pi OS. Fortunately, not all applications require this type of response time. Furthermore, for many applications that do require real-time response, it’s easy enough attach a small SBC (such as a Teensy 4.x or other Arduino-class device) to handle the real-time portions of your application.
Most embedded systems are shut down by removing power from device. That’s a very bad practice for Linux-based systems (such as Pi OS). Fortunately, there is a hardware solution for the Raspberry Pi 3: https://juice4halt.com. This is a supercapacitor-based “uninterruptable power supply” module that will provide about 30 seconds of power to the Pi when power is removed. This device sends a signal to the Pi that power has been lost so it can shut down in a safe fashion before the super capacitor supply is exhausted.
I actually used a Pi 3 (with a Pi touchscreen display) in a Nuclear Fuel Temperature Monitor (NFTM) device I installed at National Tsing-Hua University (NTHU) in Taiwan. This device monitors the nuclear fuel temperature and SCRAMs the reactor if the fuel temperature exceeds some set point (typically around 500C). FWIW, the FTM contains three main components: an analog trip system (SCRAMming the reactor is always done by analog circuitry, never by software; this makes the regulators much happier), a Weensy 4.1 board (based on the Teensy 4.1 module), and a Raspberry Pi 3. The Raspberry Pi is basically a glorified video display card for the system, providing a user interface and temperature display. The Weensy provides all the real-time control. The analog trip board handles the actual reactor SCRAMs.
Originally, I had planned to have the Raspberry Pi also provide an Ethernet interface to the reactor console. This feature was never needed at NTHU, so I never finished that code and left the Ethernet jack on the Pi disconnected. This turned out to be a very good thing.
Recently, I was involved with another reactor project at Idaho National Labs (INL). On their NRAD reactor (a small TRIGA reactor used for neutron radiography), they wanted to be able to monitor the reactor operation remotely. The NRAD reactor uses a General Atomics digital control console (Ethernet based). They wanted to pass some operational data from the local reactor network to the general INL network. Now, you *DON’T* connect a reactor’s network directly to any outside network. The NRC (or DOE in INL’s case) doesn’t allow this. However, by using some special (uber-firewall) equipment that guarantees a one-way transmission from the reactor’s network to the outside world, it is possible to satisfy regulatory agencies and they will allow this.
So I designed a two-Pi system that included one Pi on the local reactor network that received UDP messages from the reactor’s computer. This “inside Pi” retransmits the UDP packets across the uber-firewall to the “outside Pi” sitting on the INL network (which is highly controlled and not an “open Internet” type network). This Pi makes the data available to INL services (using TCP/IP transmissions).
I developed the software, tested it out on the reactor (without connecting it to the INL network, using a Pi 400 to simulate the INL server), and got it all working nice and pretty. Then the day arrived that we plugged it into the network. All of a sudden I’m getting calls from the INL IT crew: “why is your machine trying to contact Google? Why is it slamming our DNS? We cannot allow this device on our secured network.”
Now I knew that the Pi would try to contact an NTP server to get the time. So I had installed an Adafruit DS3231 RTC on the Pi (and properly installed the drivers; see https://www.adafruit.com/product/4282) to avoid this. Contacting Google? That was new to me. Slamming their DNS? No idea what was going on there. Needless to say, this is not a behavior you want from a system connected to a nuclear reactor (or even on a secured network operated by the Department of Energy).
A couple hours’ spent trying to figure out what was going on didn’t turn up anything. By this point, the INL IT staff was telling me there was no way they were going to allow a Pi running Pi OS on their network, so I abandoned further research on the matter. They suggested installing a version of Ubuntu. However, I wasn’t sure whether this would support the Juice4Pi drivers or even the Pi touchscreen. So I had to abandon the Pi and switch to a small Windows-based PC.
Perhaps, at some point, I’ll look back into what caused this problem. Until that day arrives, however, I’m very reticent about recommending the Pi for embedded applications. I just don’t feel good about machines accessing things on the Internet that I haven’t explicitly asked them to do. This could be something innocuous, such as automatically checking for updates (though, why Google?). However, it should be documented and easy to shut off. Until then, caveat emptor is the key word here.
March 25, 2021
http://artofasm.randallhyde.com is now live
I used to own the domain http://artofasm.com.
While on vacation, it expired and a spammer grabbed it before I noticed it was in need of renewal. Oh well.
I’ve added the subdomain “artofasm” to randallhyde.com. So you can now easily access all the original Webster material at http://artofasm.randallhyde.com/
Randall Hyde's Blog
- Randall Hyde's profile
- 16 followers
