I'm hardly the right person to provide a tutorial, but once you have got a Linux development host then you can follow the instructions here to set up an OpenWrt development environment on it:
http://vocore.io/wiki/index/id:15When you 'make menuconfig' you will need to choose the configuration options. Select "Ralink RT288x/RT3xxx" as the Target System and select "RT3x5x/RT5350 based boards" as the Subtarget, then select "VoCore" as the Target Profile.
Then run 'make'. As the WiKi suggests, this will take a long time. I found it needed several tries to complete because some of the GIT repositories that it needed were offline, but it did eventually complete. The 'make' will create a flash image that could be uploaded to the VoCore if you wanted, but you don't need to. More importantly it will create the cross-compiler that you need to build your own applications. In my case, the compiler was built here:
openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-uclibc-g++
You can test the compiler with a simple Hello World application:
- Code: Select all
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello World!\n");
}
If you save this to HelloWorld.cpp you can invoke the compiler above with arguments HelloWorld.cpp -o HelloWorld to compile and link it, which will create an executable file HelloWorld.
You need to have a network connection between your development host and the VoCore in order to upload your executable file over the network. One way to do that is to have your development host connect to the VoCore's WiFi AP. Once it is connected you can use SCP to copy the executable file to the VoCore:
- Code: Select all
scp HelloWorld root@192.168.61.1:HelloWorld
Provide the password "vocore" when prompted.
To run your application you will need to open a shell session on the VoCore. The easiest way to do that is to use PuTTY or similar to connect an SSH session. If you type 'ls' at the command prompt you should find your new HelloWorld file listed, and you can run it by typing './HelloWorld'.
The first time you do this it will probably fail because your HelloWorld application needs the std 'C' libraries to run. They are built as part of the OpenWRT development environment. In my case the required file was here:
- Code: Select all
openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libstdc++.so.6
You can copy it to the VoCore like this:
- Code: Select all
scp openwrt/staging_dir/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/lib/libstdc++.so.6 root@192.168.61.1:/lib/libstdc++.so.6
With that in place you should now be able to run ./HelloWorld in your SSH session and see the message "Hello World!" on the console.
OpenWrt has a scheme for packaging your applications as part of OpenWrt so that you can 'make' it within the OpenWRT development environment and have it included in the OpenWrt flash image, and you can read the OpenWRT documentation to learn how to do that.