Feb 23, 2015 0 Comments in Learning, OpenWRT by
Running OpenWRT on Cosino

OpenWRT is a powerful embedded distribution which fits well into Cosino’s on board NAND.

Getting the code

To install it into our Cosino’s based board we need to download on our host PC the OpenWRT source code that you can find on our GitHub repositories and can be downloaded by using the command below:

Distribution versions

In the tables below are reported all available distribution releases for each Cosino based boards. These OpenWRT releases are the only ones supported by us.

Each release can be extracted with the command below:

where <name> is the name you wish to use for the new branch holding the code of the distribution tag <tag>.

Cosino Mega 2560

Distribution tag Kernel version Note
cosino_mega2560-v1 3.10
HEAD 3.10

The HEAD is not a tag, it represents the latest kernel release and it’s automatically extracted at each repository cloning or updating.

Compiling the sources

Now go into openwrt directory and get the default configuration file for your Cosino’s based board. For instance, if you wish running OpenWRT on a Cosino Mega 2560 you should use:

Now you should correctly set up the configuration variable CONFIG_KERNEL_GIT_CLONE_URI by setting it to referring your Cosino’s kernel tree. On my system I have:

At this point is up to you to keep the default settings or add/delete some software packages or change some system’s setting (please refer to the OpenWRT’s documentation site for further information), in any case to compile OpenWRT you should use:

When the compilation ends you should get the following files into the directory bin:

Installing the images on NAND

Ok, now we are quite ready, we just need to put into the Cosino’s NAND flash the bootloaders images, the kernel and then the OpenWRT’s rootfs.

warning Note: to do these next steps you need a microSD with a Debian OS installed.

The kernel and rootfs images came from our just compiled OpenWRT tree, while the bootloaders can be downloaded from our GitHUB repository by using the command:

Now, still supposing we are working with a Cosino Mega 2560, for the bootloaders we need to copy the following files from the directory cosino.github.io/data to our Cosino board:

warning Note: you should replace the IP address to suite your network settings.

warning Note: the destination directory /opt/openwrt/ is random, just use the one you prefer.

Now put on the same directory on the OpenWRT kernel and rootfs image compiled before:

If you copied all the above files into directory /opt/openwrt/ on you Cosino you should have:

Great, now we are done, just put all these images on the NAND flash by using the following commands sequence:

Now just halt the system, remove the microSD and reset the board. If you did everything ok you will get on the serial console:

Then, after boot stage is finished we get:

Now you can login into the system just pressing the ENTER key:

Leave a Reply

Your email address will not be published. Required fields are marked *

85 + = 91