Marcus Folkesson

Embedded Linux Artist

TIL - Virtual CAN interfaces

TIL - Virtual CAN interfaces 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 There are many scenarios where a virtual Controller Area Network(CAN) interface could be handy. It let you develop and test applications that without an actual physical CAN bus. My scenario is to play around with Berkley Packet Filter(BPF) [1] and do some data manipulation on recieved CAN frames in kernel space.

Raspberry Pi and QEMU

Raspberry Pi and QEMU What is QEMU? QEMU is a generic and open source machine emulator and visualizer. It emulates full machines (boards) of different architectures and is useful for both application and kernel development. The CPU itself could be fully emulated (together with devices, memories and so on) or work with a hypervisor such as KVM or Xen. If support for your hardware is missing, then it's a fairly easy task to write a stub driver that your application can interface. cover

Crosscompile libcamera for RPi

Crosscompile libcamera for RPi Goal The goal is to cross-compile libcamera [1] and libcamera-apps [2] for Raspberry Pi using the latest Raspbian [3] (Bullseye) release. Usually you setup the root filesystem with Buildroot [4] or Yocto [5] and generate a SDK that you can use to compile your application. The Raspbian distribution does not come with a SDK so we have to setup our own. We will use a Raspberry Pi 3b for this. cover

TIL - Debug FindBoost in CMake

TIL - Debug FindBoost in CMake 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 When you use find_package for a Boost component in CMake it will end up with the FindBoost.cmake [1] module. It is usually located in /usr/share/cmake/Modules/FindBoost.cmake. I had to debug a cross compile setup for an application using CMake, and the root file system did use wierd paths for everything.

What is libcamera and why should you use it?

What is libcamera and why should you use it Read out a picture from camera Once in a time, video devices was not that complex. To use a camera back then, your application software could iterated through /dev/video* devices and pick the camera that you want and then immediately start using it. You could query which pixel formats, frame rates, resolutions and all other properties that are supported by the camera. cover

TIL -Yocto bitbake-getvar

TIL - Yocto bitbake-getvar 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 Writing recipes for Yocto has recently become something I do several times a week. All tools that help you with debugging is allways appreciated, and one such tool I found recently is bitbake-getvar that came with the Honister release of Yocto.

TIL - systemd and $MAINPID

TIL - SystemD and $MAINPID 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 A special environmnent variable, $MAINPID, is set and is available for the .service file. The variable exposes the MainPID property of the service and could be useful if your custom services e.g. forks. This let you do

HID report descriptors and Linux

HID report descriptors and Linux HID Devices USB HID (Human Interface Device) device class is the type of computer peripherals that human interacts with, such as keyboards, mice, game controllers and touchscreens. The protocol is probably one of the most simple protocols in the USB specification. Even if HID was originally written for USB in mind, it works with several other transport layers. Your mouse and keyboard do probably use HID over USB, the touchscreen in your smartphone could use HID over I2C. cover

Industrial I/O and triggers

Industrial I/O and triggers I've maintained a couple of IIO-drivers (MCP3911 [4] and LTC1660 [5]) for some time now and it's time to give at least the MCP3911 a face-lift. This time the face lift includes support for: Buffers Triggers Make the driver interrupt driven Add support for setting Oversampling Ratio Add support for setting PGA (Pre Gain Amplifier) Also clean it up a bit by only using device managed resources. cover

Mounting with systemd and udev

Mounting with systemd and udev Systemd hasn't always been my first choice as init system for embedded system, but I cannot ignore that it has many good and handy things that other init systems don't. At the same time, that is just what I don't like with systemd, it does not follow the "Do one thing and do it well"-philosophy that I like so much. I'm very thorn about it. cover