Marcus Folkesson

Embedded Linux Artist

Control my geothermal heat pump

Control my geothermal heat pump The electicity price in Sweden varies a lot during the day. It's usually cheapest during the night and most expensive during the day, but not always. One day a week ago, it was not much wind in Germany and therefore we exported electricity there which resulted in very high prices here in Sweden. 1 kWh cost over 10 SEK (almost 1 USD per kWh) for a few hours, this excluding transmission fees and taxes. cover

UBI volumes in Yocto

UBI volumes in Yocto These days, managed NAND flash memories such as eMMC or SD-cards has become more common in the embedded Linux systems as they abstract (or hide..) the complicated raw NAND memory under the hood. Even if raw NAND memories are more complicated to handle, they are still used in many new products out there. When working with raw NAND flashes, UBI [1] with UBIFS on top of that is the way to go. cover

Remoteproc, rpmsg and SYSBIOS

Remoteproc, rpmsg and SYSBIOS I'm currently working with a couple of SoCs (OMAPL-138, DRA7xx) from Texas Instruments where both has an C6xx DSP core along with the ARM core. This is no unusual configuration, many modern SoCs today have heterogeneous remote processor devices in asymetric multiprocessing (AMP) configurations like these two. In this case, the DSP-cores where supposed to run SYS/BIOS with the TI IPC MessageQ stack to communicate with the ARM core. cover

Detect time jumps in Linux

Detect time jumps in Linux Recently I had a case where the application created multiple timers for different events. After the timers was created, the NTP client updates the system time resulting in that all timers being off and needing to be adjusted. Adjust the timers is one thing, but how do we detect the time jump? It's not the first time I'm in a situation where I have to deal with such time jumps, I guess it's quite a common case, so why not write a few words about it? cover

TIL - suid_dumpable

TIL - suid_dumpable TIL, Today I Learned, is more of a "I just figured this out: here are my notes, you may find them useful too" rather than a full blog post Ever notice that you can't get a coredump from a process running with extra privileges like capabilites or setuid? This is related to a previous post [1] about some restrictions that is applied to such processes. I suggest to read that post first to get the context.

Protected FIFOs and regular files

Protected FIFOs and regular files Since version 4.19 [1], Linux has the default behaviour to prevents opening of regular files and FIFOs that is not owned by the user in world writable sticky directories. Example on such directory is /tmp/ which usually has the sticky bit set. This may sound obvious, but what is not so obvious is that this restriction also applies to the root user. You can therefore end up in a situation where e. cover

Restoring a power hammer

Restoring a power hammer I have bought myself a power hammer - something that I have wanted for a long time. It is a Abno nr1, a swedish made 25kg spring hammer. It has been unused for many years and is in need of a little restoration. The last Abno hammers were manufactured in the sixties, so it is at least 60 years old. I've seen 60 year olds in worse condition than this, although there are parts that need improvement. cover

Writing a clocksource driver for Linux

Writing a clocksource driver for Linux Today we are going to write a clocksource [1] driver for Linux! A clocksource in a Linux system is one of several parts of the kernel timekeeping abstractions. The clocksource is the the timeline of the Linux system and is the one you go to whenever you issue the command date. To do this, the clocksource should provide a monotonic, atomic counter that is as accurate as possible. cover

Writing a UART driver for Linux

Writing a UART driver for Linux Today we are going to write a UART driver for Linux! UART (Universal asynchronous receiver-transmitter) is on of the most common device-to-device communication protocols that almost every SoC or microcontroller has hardware support for. Most SoC has several UART ports, but sometimes that is not enough as in this case. Background I'm working in a project where we have an ARM SoC connected to an FPGA on the AEMIF interface. cover

Include code from a file with Hugo

Include code from a file with Hugo First of all, all credit goes to Marcus Olsson [1] who pretty much wrote this Hugo Shortcode [2] which I only have made some small changes to. I also refer to his post [3] for a good explaination on how it works. Background I prepare for some bigger posts with a lot of code examples where I only want to show fragments of a whole file. cover