Thursday, August 24, 2017

Linux ARM on QEMU

Many times we want to develop a generic device driver for ARM processor, but we want first to test it on an emulator.  In this case, the emulator we're gonna use is ARM.

Here's the content of my script to build Linux for generic ARM (Versatile/PB (ARM926EJ-S). According to https://www.kernel.org/doc/Documentation/arm/Booting, Typically the physical RAM does not start at address zero. LOADADDR specifies the address where the kernel image will be located by U-Boot and is stored in the U-Boot header by the mkimage utility. Typically the load address (for placement in memory) is also the start address (for execution). Note that the uImage file is typically just the (self-extracting, compressed) zImage file with the U-Boot wrapper.

ARCH=arm

core=$(nproc)
make ARCH=$ARCH versatile_defcocnfig
make -j${core} ARCH=$ARCH CROSS_COMPILE=arm-linux-gnueabihf- uImage LOADADDR=0x80008000


There is a much easier way: using Yocto.

The following steps would be everything needed to run Linux arm on Qemu:


1.  git clone git://git.yoctoproject.org/poky

2.  cd poky

3.  git checkout -b pyro origin/pyro

4.  Edit ./build/conf/local.conf and add:

    INHERIT += "rm_work"

    Uncomment (and comment out the x32 one):
     MACHINE ?= "qemuarm"

    exit from editor

5.  From shell, type:
 
    . ./oe-init-build-env

    bitbake core-image-sato

or, if we want to build everything:

  bitbake world 

6.  Once a particular image (in this case is qemuarm) has been built, we can
    test it with command:

        runqemu qemuarm


The target files are located in ${yocto_dir}/build.  In my case it is in ${HOME}/poky.  For example, in my case:

./qemuarm-poky-linux-gnueabi/linux-yocto/4.10.17+gitAUTOINC+e92bd55409_3926e38630-r0/deploy-linux-yocto/zImage


Sunday, August 20, 2017

Are US tech companies so picky nowadays?

For last few months I have been looking for technical job in my area of expertise and experience.  I know, it is harder to find jobs in low-level or embedded system compared to application software, but I never realize even when I got some interviews, there are so picky.  A small mistake (not necessarily to judge that I will not be able to do the job), that's it.  You're done.  Next applicant, please.

I am still endeavoring to land my future job. Meanwhile, I am brushing my skills and learn some new stuff.  For example, I now know there is an opensource doing dataplane packet processing.  I also now relearning  Linux kernel and driver, Bluetooth and Wifi.

Thursday, August 17, 2017

Some videos of My Embedded projects I have done

Couple of projects done during my spare time:

ATMega32 interfacing to MAX7219 7seg via SPI 

PIC18F9520 doing ultrasonic ranging 

I wish I made video for the PIC-based IoT sensors I made (part of Computer Engineering project in my master program; It was able to push temperatur and humidty data to 'remote' server periodically, which then display it on the web)