Arkiv för december, 2018

Solder Fume Extractor

Posted in allmänt grinande on 2018-12-28 by Kristian

Solder fumes are evil. 

Hence, I’ve planned to add a fume extractor to my workshop for years, but haven’t been really motivated until after finishing my PhD which oddly enough resulted in time to have hobbies again -> more soldering.


I used a square ventilation duct mounted on the garage wall to get the fumes out of the building, then a flexible ventilation hose from the round connector at the bottom of the duct to allow positioning of the extractor close to the work area.

The first proof of concept used a circular fan, but that suffered from low capacity as well as a tendency to roll around on the table.

Having a spare 120 mm high-capacity fan, I decided to CAD and 3D-print an adapter, which turned out really nice. It stays put where you place it and have a much higher capacity than the round one.

There will of course be a fan cover to protect the fingers, once I find it (or print a new).

(STL and FreeCAD sources are available from Thingiverse)


STM32 / ARM toolchain

Posted in nörderier with tags , on 2018-12-26 by Kristian

Since I bricked the ROTHULT lock by somehow managing to accidentally zero the firmware, I need to write my own firmware. Having done mostly embedded coding for Arduino (and AVR328P in stand-alone configuration) and ESP8266, I figured that the Arduino IDE surely had some nice additions to solve the problem.

Wrong, or at least I didn’t find any suitable for the STM32L05. (This might be wrong, there is for example Arduino IDE support for several types of STM32 processors available here )

Then what?

I decided to not go for any of the ”free for hobbyists and students” options that I got flyers for in the ST-Link package, partly because I need another IDE like I need the plague, partly because I decided to use the old macbook (hence not windows) for hacking since it has a decent command line, partly because I want to go open source for the principle of it.

As usual when I try something new, I end up trying Eclipse. Then I uninstall it. The next day, I usually reinstall it, try again, and give up once more. There are lots of rants online describing why Eclipse sucks, so it seems like I’m not alone. My main reason is that it is overly complex for the job and configuration is a hell. It is probably very nice if you have the time and energy, but it is not for me.

Anyway, if you like Eclipse, there are a few options: and

Then (after _a lot_ of searching) I found which seems like the right way to do things, and I managed to blink the two LEDs on my discovery board.

What you need (assuming that you use Homebrew on your mac, similar packages are available for Linux and should be easy to find with your favorite package manager):

  • brew install arm-gcc-bin stlink open-ocd
  • git clone

Then config and run the examples.


IKEA Rothult Part 3 – Reassembly and debug connectors

Posted in allmänt grinande on 2018-12-23 by Kristian

I cut out a slot for the breakout cabling and reassembled the lock. A better solution would have been to drill a small hole in the side, desolder/resolder the wires and route them through the hole instead. I will do that _later_, if I manage to reprogram the lock.


A quick test with various RFID cards revealed that the message on the serial bus always is ”52 46 41 4c 3a 20 63 75 72 53 74 3a 20 39 30 20 20 45 72 72 6f 72 3a 20 34 20 00 0a” which translates to ”RFAL: curSt: 90 Error: 4 ”.

This does not change regardless of the how the lock reacts to the card. Hence, useless.

It is intriguing though, why send ”error 4” even when the card is accepted?

I also connected the probe to H1 and H2, the connectors to the SWD port, but no signalling occurred on those.


Bus Pirate and Rothult

Unfortunately, the bus pirate and Rothult didn’t really work out. There is an implementation of the SWD protocol for the bus pirate, that I totally would have tried unless I had worked 50+ hour weeks for most of the winter. So I gave up and ordered some more toys from Mouser.


Left to Right: STM32 discovery board, Busblaster v4, ST-Link V2.1 with cables

OK, the STM32 discovery board would have been sufficient, it has a built in separately usable ST-Link, but the other items more or less paid for themselves due to the free delivery over 50 dollars thing. Or at least that is what I tell myself…

Waiting for Fedex

Have you ever tried getting a delivery with Fedex in a rural area? Then you know.

To be continued in part 4, ”connecting and using the debug tools”

Meanwhile, install OpenOCD, gdb, and if running an appropriate OS, the ST-Link utility.

%d bloggare gillar detta: