Wednesday 17 December 2014

How to build Yocto RT for Minnowboard Max Drone



Before you begin, it good idea to read through Yocto getting started guide.  And we assume you are using Ubuntu.

How to build Yocto for Minnowboard Max drone:

1) Install require tool/software for Yocto build:
 


sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat libsdl1.2-dev xterm

2) Download Yocto and meta-intel:



mkdir maxdrone
cd maxdrone
cd poky
git clone git://git.yoctoproject.org/meta-intel


3) Setup build directory

cd ..
source poky/oe-init-build-env mybuild
  
 4) Add meta-intel path to  bblayers.conf

vi conf/bblayers.conf

add “/home/<user>/maxdrone/poky/meta-intel \”to BBLAYER section like below:



5) Add platform,  RT and Linux version to local.config.



vi conf/local.conf

And add this line to the end of the file:

MACHINE ?= "intel-corei7-64"
PREFERRED_VERSION_linux-yocto = "3.14%"
PREFERRED_PROVIDER_virtual/kernel = "linux-yocto-rt"

      6) Create local Linux kernel for Kernel or driver customization (skip if not build for debug):



bitbake linux-yocto -c kernel_configme -f
bitbake linux-yocto -c menuconfig

You will see a menu like this, make sure you save and then exit if you are making change to the configuration.




7) Build the image, we use sato sdk.  Other image like “core-image-sato” if you are done with development.  Also if you want build with yoction image with UI interface, try “hop” command instead of "bitbake".


bitbake core-image-sato-sdk



8)      Once the OS image is build, it will be store in <Build Dir>/ tmp/deploy/images/intel-corei7-64, and we use dd to write to USB drive.  You can use df to quickly search for the usb drive located, our case, it at /dev/sdc.



Then use DD to write to USB drive:

sudo dd if= core-image-sato-sdk-intel-corei7-64.hddimg   of=/dev/sdc

Wait until the light on the USB drive stop blinking.  Now you have a Yocto RT USB drive. 

Have fun.

Tuesday 9 December 2014

Kicad on Win7

Recently I created a PCB for the drone project that I'm working on and I would like to share my experience with Kicad for PCB creation.


Above is the finish PCB design that I send for fabrication this afternoon, will post the PCB photo once I got my PCB back from China, hopefully by next week.


First, you need to download the kicad for window,  I use this version from:

http://kicad.nosoftware.cz/

The latest build I can find on net is default stable version is 2013, which does not have the latest interactive routing.  I wish they could update the stable version to late 2014 build..

Just download from the latest version.  I found it to be really stable, no crash so far (after I fix the really annoying PCB footprint library)


Once you install kicad on window, you should copy the PCB footprint library to local disk, default is getting the library from github, which is really slow, and some time cause crash (I think someone fix the github path crash issues, it use to point to some path that is no longer exist).

There is python script that will download all the github library to local disk. But the posted version seem to be have error in it, will post my version later.  You can read about the frustration of using the footprint library here

Basically, you need to download all the footprint library to local disk, here is the step
  1. Download library using git from python script. (script to be send out later, make sure you install git and python in your PC)
  2. Copy fp-lib-table.for-pretty from C:\KiCad\share\template to C:\Users\<user>\AppData\Roaming\kicad as fp-lib-table
  3.  create or update runkicad.bat with  KISYSMOD to local disk. SET KISYSMOD=C:\kicadlib\kicad\share\github-repo <your local area>

Now you need to start kicad with the bat file, so that it will point to the local library.

Kicad schematic editing is really easy, just open a new project start creating.  Here is example of my drone schematic.


Just place and round the schematic, and sometime you may need to design your schematic symbol, which also very easy in kicad. the library editor is really easy to use too, just open an existing symbol, make change and save as your new symbol.


Once you are done with schematic design, the next stage is to create netlist for PCB as well as assigning footprint, it done using another tool call CvPCB.



Once you are done with footprint assignment, you move to PCB design.   We base our board design base on MinnowBoard Max lure.  you can import the board outline easily, and the Minnowvoard Max board design file is freely downloadable. (pointer to be update later)

Before start editing in PCB, you need to set few more thing, one is the PCB design rule, you need to review you PCB manufacture design rule and update you kicad design rules accordingly.   Normally they display the rule at front of the order page, here is the example PCB  rule found on ebay:

Here is where you set the rule in kicad (Design Rules --> Global Design Rules):




Also you may want to create wide wire for power or some net that need wide track, it better to do this before starting routing, else you need to use "change segment/track width" canvas pulldown menu to change the wire width.

To create wide wire, go to Design Rules --> Net Class Editor.  First by adding a new net classes in the window, then select the newly create net class in the pull down menu on the right of membership. You just add and remove the net from the net class.   



OK.  Once you are done with the design, you need to generate and send the gerber to PCB manufacture for review and quote.   Normally they will comeback with some request if there is problem.  Below is our gerber output setting that our PCB manufacture requested after some feedback from them.  Our board is 2 layer design:




Also you will generate a drill file as well, and here is our setting:

 

 As always, you should review your gerber file before sending for fabrication. Any mistake will be costly.  Here is our final design view in gerber file viewer provided by kicad.





This my quick update on how to setup and use kicad on window platform.  Hope you enjoy it..