Featured posts

Building FreeBSD for BeagleBone Black

What you’ll need:
• BeagleBone Black.
• 5v power supply or Mini-USB cable.
• Micro-SDHC card 4GB or larger.
• FTDI cable

1) Download current FreeBSD image for BBB to working directory


2) Uncompress the img.xz file and burn it to the sd card
xzcat FreeBSD-12.0-CURRENT-arm-armv7-BEAGLEBONE-20180215-r329338.img.xz | dd of=/dev/sdb

Note that you might need admin rights for above command. Also, verify that your sd card is at /dev/sdb change it if it's other then sdb. In caes of unavailability of xzcat command, just install it by installing xz utils.

GSoC Project Introduction : Importing SDIO stack and Benchmarking

Hi all, This post is basically an introduction of my GSoC 2018 project under RTEMS. It marks the beginning of a series of blog posts that will be put on ( under the tag 'GSoC' ) for documenting my work throughout the time span.

Before moving on, I would like to thank RTEMS project and Google for giving me this opportunity of working on a highly fruitful Open source project, whose proposal can be found here ,under the mentorship of Christian Mauderer and punit vara. It would be great working with you both :).

Some important links:

Wiki page:

Project Github Repo:

Issues targeted : ticket#3429 , ticket#3430 , ticket#3428

Project proposal: Google doc

GSoC acceptance letter(To whom it may concern): here

Starting with the project description, so the project objective is divided into two sections:
First part of this project is intended to add SDIO support t…

Building FreeBSD's SDIO driver for BeagleBone Black

Hi all, This post mainly concern with building FreeBSD's SDIO driver for BeagleBone Black by cross compiling it on AMD platform. I had few unresolved issues with the master branch of current FreeBSD tree. So, for this i used another unofficial branch: . It does have the required KERNCONF file with stable SDIO driver.

A lot of steps below are similar to the one given on:  with slight but inevitable changes.


 Before proceeding you need to first install git.
sudo pkg update -f sudo pkg install git
 Setup project directory by mkdir /BBB
 Clone the repository to /BBB/src by
git clone -b mmcam-new /BBB/src
Setup environment variables as
setenv BASEDIR /BBB setenv MAKEOBJDIRPREFIX $BASEDIR/obj setenv TARGET arm setenv TARGET_ARCH armv6
Note that sometime it shows an error like: Undefined command setenv, in that …

Setting up FreeBSD environment on virtualbox

Hi all, In this post we will review the procedure of setting up FreeBSD environment on virtualbox along with setting up Internet on the guest OS(this was pretty tricky!).BTW, my host OS is Ubuntu 14.04

So, i am assuming you have already installed virtualbox as per your host OS and has downloaded the FreeBSD amd64 iso image(If not you can do it from here and extract it appropriately to get a .iso file.
Installing FreeBSD on virtualbox
Installing FreeBSD on virtual box is pretty straight forward, just insert use the downloaded iso to boot up the VM with default hardware settings for 64 bit FreeBSD OS. Following will be the bootup window:

Just press enter and follow default procedure. Don't attempt to configure network adapter at this stage ww'll do it later after complete installation.

Note: Please don't forget to remove the installation disc from virtual machine settings after complete installation. Otherwise, every time during bootup it will recall the install procedure.

Effect of file-system on sd card's performance

I had a task to compare different protocols( and their different implementations) like SD, SPI, SDIO(in FreeBSD's MMCCAM implementation) by accessing SD Card. Now, for unbiased comparison, i must eliminate file system type in sd card from the equation.

In this blog post, i'll discuss/share my findings about how file-system on a card(SD and MMC) affect its performance.

So, let's start with a very quick introduction to some basic concepts:

MMC- Multimedia Card is a memory card unveiled in 1997 by SanDisk and Siemens based on NAND flash memory. eMMC is a regular MMC in a BGA package.

SD Card: SecureDigital Card was introduced in 1999 based on MMC but adding extra features such as security.

[caption id="" align="alignright" width="321"][/caption]

MMC is made up of broadly 3 parts:

MMC interface - Responsible for handling communication
FTL(Flash Transitio…

Implementing a MMC/SD/SDIO stack using CAM framework(Part 2)

Hi, In the next part lets look at other files which makes up the SDIO stack within mmccam framework. Please have  a look at previous part for more info:

+void sdio_fill_mmcio_rw_direct(union ccb *ccb, uint8_t f, uint8_t wr, uint32_t adr, uint8_t *data) {
+ struct ccb_mmcio *mmcio;
+ CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE,
+ ("sdio_fill_mmcio(f=%d, wr=%d, adr=%02x, data=%02x)\n", f, wr, adr, (data == NULL ? 0 : *data)));
+ mmcio = &ccb->mmcio;
+ mmcio->cmd.opcode = SD_IO_RW_DIRECT;
+ mmcio->cmd.arg = SD_IO_RW_FUNC(f) | SD_IO_RW_ADR(adr);
+ if (wr)
+ mmcio->cmd.arg |= SD_IO_RW_WR | SD_IO_RW_RAW | SD_IO_RW_DAT(*data);
+ mmcio->cmd.flags = MMC_RSP_R5 | MMC_CMD_AC;
+ mmcio->>len = 0;
sdio_fill_mmcio_rw_direct is basically a wrapper for CMD_52 that's needed to read/write d…

Detailed SDIO protocol Implementation

Reference: Wikipedia, 

SDIO cards are intended to provide high speed data Input/Output on our regular sd card slot. SDIO cards are compatible with any sd card slot and will not cause any physical damage to the host if it's not compatible with SDIO. When SDIO is plugged in a SDIO compatible host, in its early stage it is in low power mode and consumes very little current. Host identifies the SDIO card ,it's power requirement, it's I/O capabilities etc. If host finds that power requirement is manageable and there is driver for the I/O functionality card is offering it allows the SDIO card to power up completely and start it's I/O functions.  SDIO card allows up to 7 different I/O functions along with 1 memory function. It's available in market in 2 form factors: miniSDIO and full size SDIO. For example is a miniSDIO wifi card by spectec.