Skip to main content

Posts

Welcome to HRRZI – The Digital Home of Hedley Rainnie

  If you recognize the DECsystem-20 assembly instruction in the URL, you are in exactly the right place. Welcome. I am a retired firmware engineer, a lifelong science fiction fan, and the author of the hard sci-fi corporate thriller, Mind the Machines . About the Book What if death wasn’t the end, but the start of a different kind of life? LifeSim Inc. has made the impossible real: a digital afterlife where minds can live forever. But when consciousness becomes a service, ownership becomes a question. Mind the Machines explores the unsettling cost of eternal existence—and the quiet terror of discovering that your future may belong to someone else. It is a story about gate-level simulations, the logistics of digital immortality, and the ultimate corporate monopoly. Available now on Amazon in Paperback and Kindle https://www.amazon.com/Mind-Machines-Hedley-Rainnie-ebook/dp/B0GT8RD16X Add it to your shelf on Goodreads https://www.goodreads.com/book/show/250164231-mind-the-machines Ab...
Recent posts

The STM32MP257F-EV1

 This is the follow on to the STM32MP1 series. This time a dual core Cortex-A35 a Cortex-M33 and a Cortex-M0+. As shipped, they provide a 16G micro SD card with Linux on it. That card is partitioned with a lot of odd small partitions. The important ones are at the end, p10 and p11. Unfortunately p10, the / partition is only 4G so immediately there is a storage crisis when you start populating the usual tools. A quick dd from that card to a 256G card I had lying around and we now have a start of something useful. Next is to run gparted on my RPi5 and first move p11 which is /usr/local to 1MiB from the end. Don't leave that as 0 or the move will fail. Once moved, you can resize p10 to be 200+G. Now we have some useful space. I added a user with sudoers privs. There is no date/time setup when it boots, that needs to get rectified with a ntp callout.  Now... there is no C compiler or binutils. binutils got installed. Lots of apt update -> apt install xyz's. Here is an interesti...

The VL53L8 8x8 laser ranging sensor

The sensor A VL53L8 is a continuation of a family of laser ranging sensors from ST. They use Single Photon Avalanche Diodes in an 8x8 array giving a pyramid of distances projected out from the sensor from ranges of 2-400cms. It can also do 4x4 with SW interpolation. I ordered a sensor (set) from ST.  511-SATEL-VL53L8 https://www.st.com/en/evaluation-tools/satel-vl53l8.html You get two sensors on breakout boards for your $27. This is good because w/o this fancy breakout board, you will be on the hook for generating 1.2 & 1.8v. Wired up to a modified Bluepill with an STM32L443 as a donor CPU, via some simple Dupont wiring, we can communicate with the sensor via I2C. SPI is also possible but the example code that ST provides that was used to debug the comm was I2C and this made comparing easier. Ada driver An Ada driver was crafted for the sensor. This was a translation of ST's API for the VL53L8. It was a job to translate it. There is 90k of FW that needs to get DL'd into the...

The Air32F103

 Bluepills Its no surprise that Bluepills, such as they were, a smoking sub $2 deal would dry up eventually, taken over by clones, some subtle, some overt. With supply issues still plaguing ST parts for hobbyists, what about these cheap Chinese clone parts? Lets dive into the Air32F103. Air32F103 I bought 5 of these $1.90 boards. They look like this: Some notables vs a stock bluepill: 1) Castellated pins with flat underside for use as a module 2) 3 LEDs R/G/B (vs just the G for a bluepill) 3) Clone of ST's peripherals 4) over clockable to 256Mhz (spec is 216Mhz) (original STM32F103CB is 72Mhz) 5) 32K of ram. But, via secret regs, 97K(!) 6) top and bottom debug pads, top for JLINK, bottom, legacy STLINK SWD 7) USB C vs USB mini 8) BOOT as a button vs jumper 9) 2 12bit DACs (STM32F103CB's don't have that) 10) QSPI (hidden support) 11) Undocumented crypto block from MegaHunt (includes: AES/DES/3DES/SHA/SM[1,3,4,7]) Clocking As mentioned 256Mhz is possible. One Q is how do they...
  The GD32VF103 This chip is a peripheral clone of an STM32F103. The CPU is swapped out for a Risc-V. Openocd debug using JTAG Using the release on github: https://github.com/riscv/riscv-openocd Build it: ./bootstrap  ./configure --enable-ftdi --enable-stlink --enable-ti-icdi --enable-jlink --enable-cmsis-dap --enable-xds110 make   We can connect to the target. Wiring to a J-Link is as so: ARM20 JTAG: Pin1 VCC -> 3V3 Pin3 TRST -> RESET Pin5 TDI -> JTDI (underside of board) Pin7 TMS -> JTMS Pin9 TCLK -> JTCLK Pin13 TDO -> JTDO Add this to openocd/tcl/board as bluepillGDF103.cfg adapter speed 8000 source [find interface/jlink.cfg] source [find target/longan.cfg] jtag_ntrst_assert_width 10 reset_config trst_only Add this to openocd/tcl/target as longan.cfg: # script for Longan nano # # longan nano devices support JTAG # transport select jtag if { [info exists CHIPNAME] } {    set _CHIPNAME $CHIPNAME } else {    set _CHIPNAME riscv } set ...

SVD file optimization

Optimizing SVD files SVD files, what are they? This webpage has a good overview, after all, they penned the format: https://www.keil.com/pack/doc/CMSIS/SVD/html/index.html Basically, its an XML file that describes an SoC from peripherals to registers to individual fields. Typically sucked in by a debugger to get a meaningful view into an SoC. Its also been used as an input to some very useful tools, such as... svd2ada When I started looking at Ada for embedded ARM hacking some years back. Adacore had an early library, Ada_Drivers_Library. It had drivers for all the peripherals in some STM32F4 series parts. How it did this was interesting, underneath the driver was a description of the HW from a bunch of .ads files that were... automatically generated . Adacore had written a tool. svd2ada, that would parse the SVD file provided by the vendor, in this case ST microelectronics, and produce a detailed specification of each peripheral in the part along with type records for e...