Update for August, year of total chaos 2020

Close to month and a half has passed since the last update. So many things have happened during that time. I’ll only write about tech related topics. It’s not a hard constraint but it’s also not a personal blog about my life.

The project that takes most of my free time is the custom controller for CG artists. Unfortunately the BLE version is on hold. I have not been able to fix Windows pairing problems. I have bought The Bluefruit LE Friend and uploaded the sniffer firmware. That helps me to fix the advertising packets. I was inspired by the Logitech mouse’s sniffed, advertising packets.

In order to continue with what’s important about this project I’ve moved to using the Bluepill. That means using USB instead of BLE. I was able to, in a span of several days, implement working USB HID device. Even Windows doesn’t complain. If you’re curious about this project, you can read the full log here. Latest post is about prototyping the shape with plasteline… spoiler: it was lots of fun.

When I went back to Bluepill I brought some new knowledge with me. The BLE board I’ve been using for the controller project taught me about ITM tracing on Cortex-Ms. I wanted to add it to the USB, Bluepill powered version. I’ve learned that you can activate ITM from OpenOCD. The cheap STLink programmers don’t route the SWO pin to the gold pins header. You can easily do it yourself though. If you don’t want to mess around with soldering, you can just use a UART to USB converter and read the data like it’s a UART serial data output… because it is, if the ITM is property configured. That’s what I did for now, since my soldering station is… limited in possibilities.

ITM is more performant than UART. One of the reason is the fact that ITM’s registers are 32 bit wide. That means you can push 4 bytes at the same time. I wasn’t able to figure out how to convince the compiler to optimize this write, in a loop. It still copies byte by byte. Oh well, something to look forward to.

Before I’ve started writing my USB HID firmware for the Bluepill board I googled for existing solutions. An obvious choice is QMK firmware. It supports a lot of microcontrollers and it’s pretty easy to add your own custom keyboard. Another, interesting project that stood out is the Efficient State Machine framework. One of the examples written with this framework is a keyboard firmware for the Bluepill board. It’s an interesting project, especially when it comes to its architecture. It uses the idea of Active Object Model It’s not the time and place to explain what’s so interesting about it, but I do encourage you to read about it. In the end I chose to write my own firmware based on my older project.

I started working on a website that stores tabs for songs I like to play on guitar. The goal is to keep the tabs with additional info in a YAML files and generate that website using Python with Jinja2. Everything builds via the Gitlab’s CI and uses Gitlab pages as a hosting service.

I’ve also messed around with the song practice app concept. I’ve used the Love2D framework, which is very nice. I’ve lost some enthusiasm when tackling the metronome syncing with the music. It’s a difficult task, especially since the tempo in songs might, and often does, change. I’ll update the linked post showing the result.

There might be something else that I can’t recall right now. It is an exhausting year. Even in my highly privileged position the pandemic affects me and my life. I do enjoy writing posts and maintaining my own website. It’s quite a bit of work but seeing the growing backlog of my efforts is empowering.

Below you’ll find some exciting goodies I’ve found on the internet.

You can use Rust to write AVR firmware. Here you can find more about it. I really want to play around with this. Seems like a great way to start writing more Rust.

Did you know about OpenDiablo2 project? It’s an open source Diablo 2 running in an engine written in Go. Bring your own assets situation. Projects like that are fascinating. I’d love to contribute but I still didn’t get into Go and my plate is full.