Use Raspberry Pi (2/3) as a JTAG/SWD adapter

Did you know that we can use the Raspberry Pi GPIO to bitbang the JTAG/SWD protocols? We can actually use our Raspberry Pi as a JTAG adapter for programming microcontrollers, FPGAs, or another Raspberry Pi! JTAG is a protocol similar to SPI, but works a little different. It’s commonly used for board bring-up, debugging, and programming in bare-metal environments. It’s incredibly useful because you have direct low-level access to hardware and peripherals, which allows things like reading and modifying CPU registers or reading/writing memory. SWD is a newer technology developed around Cortex-based processors which boasts a reduced pin-count vs JTAG (2 vs 4) and can actually be used over JTAG pins if the device supports it. While SWD doesn’t support things like boundary-scan, it’s perfectly suited for debugging and bare-metal programming. Let’s get started! ...

September 2, 2016 · 6 min · ryan

Convert Raspberry Pi (1/2/3) to F2FS

What is F2FS? From Wikipedia: F2FS (Flash-Friendly File System) is a flash file system initially developed by Samsung Electronics for the Linux kernel.[2] The motive for F2FS was to build a file system that, from the start, takes into account the characteristics of NAND flash memory-based storage devices (such as solid-state disks, eMMC, and SD cards), which are widely used in computer systems ranging from mobile devices to servers. Basically, F2FS was a file system designed from the ground up for NAND-based devices. Motorola even started using F2FS for their Android smartphones. It’s designed to help reduce wear on the device, and improve performance on this type of storage medium. Since the Raspberry Pi was designed to run off of an SD card, it makes it a perfect candidate to play around with F2FS. It’s currently supported in the 4.4.y kernel so no need to compile your own kernel this time. For this project, you will need a USB flash drive or SSD/HDD via a USB adapter (You will lose all data on your USB device, back it up!) Let’s begin. First we’ll want to upgrade our kernel and firmware to the latest available. Let’s update all of our packages first: ...

August 19, 2016 · 6 min · ryan

Compile Raspberry Pi (2/3) kernel from source with BFQ

Today we are going to learn how to compile the Raspberry Pi (2/3 only) kernel from source and then patch the kernel with BFQ IO scheduler support. As of today (8/18/16) the latest kernel is 4.4.17. I am using the latest (Jessie) Raspbian release. So what is BFQ?�More about BFQ BFQ is a proportional-share storage-I/O scheduler that also supports hierarchical scheduling with a cgroups interface. BFQ provides low latency for interactive and soft real-time applications, high throughput, and strong fairness guarantees. The code is fairly mature�and it has been around for awhile. I especially�prefer BFQ on mobile and embedded devices. Let’s dive in. (Note that this guide only covers native compiling, if you are cross-compiling from another arch, check out�this�article for more information.) ...

August 18, 2016 · 4 min · ryan

How To JTAG Raspberry Pi 2 (Without custom kernel)

Welcome to MOV r0, and my first blog post. The goal of this article is to teach you how to JTAG the Raspberry Pi 2 without having to compile a custom kernel to enable the GPIOs to do JTAG. Let’s begin! The tools and equipment I’ll be using today are as follows: TIAO USB Multi-protocol JTAG adapter. This device is like a BusPirate on steroids. It’ll do everything. It’s got an FT2232H chip inside, and supports dual-MPSSE. That means we can use UART/JTAG simultaneously, or SPI1/SPI2, or SWD. It’s really an amazing device at a great price. You can find it here (Link) Raspberry Pi 2 running Raspbian (Jessie) Female-to-female jumper wires (Can’t ever have enough of these) Host system is using Ubuntu Mate 15.04, with latest OpenOCD and FTDI support Grab the latest build of OpenOCD (On your host machine, not your Raspberry Pi, these directions are specific to an FTDI JTAG adapter) ...

October 15, 2015 · 3 min · ryan