Changes between Version 2 and Version 3 of OpenWrt/SDK


Ignore:
Timestamp:
03/30/2018 07:35:25 PM (20 months ago)
Author:
Cale Collins
Comment:

added imx6 example

Legend:

Unmodified
Added
Removed
Modified
  • OpenWrt/SDK

    v2 v3  
    1414If you are using pre-built firmware from http://dev.gateworks.com/openwrt then you can use the pre-built toolchain there to build your own code.
    1515
    16 For example, if you wanted to build a hello-world for laguna (cns3xxx) platform:
    17 {{{
    18 $ wget http://dev.gateworks.com/openwrt/latest/cns3xxx/OpenWrt-Toolchain-cns3xxx-for-arm_v6k-gcc-4.6-linaro_uClibc-0.9.33.2_eabi.tar.bz2
     16The steps involved:
     171. Download prebuilt toolchain/SDK, the toolchain contains the compiler and standard libraries only. 
     181. Uncompress it.
     191. Add it to your path (optional)
     201. Use the toolchain cross compiler to cross compile your code.
     21
     22Examples:
     23* Example, if you wanted to build a hello-world for OpenWrt 14.08 for the laguna (cns3xxx) platform:
     24{{{#!bash
     25$ wget http://dev.gateworks.com/openwrt/14.08/cns3xxx/OpenWrt-Toolchain-cns3xxx-for-arm_v6k-gcc-4.6-linaro_uClibc-0.9.33.2_eabi.tar.bz2
    1926$ tar xvf OpenWrt-Toolchain-cns3xxx-for-arm_v6k-gcc-4.6-linaro_uClibc-0.9.33.2_eabi.tar.bz2
    2027$ PATH=$PWD/OpenWrt-Toolchain-cns3xxx-for-arm_v6k-gcc-linaro_uClibc-0.9.32_eabi/toolchain-arm_v6k_gcc-linaro_uClibc-0.9.32_eabi/bin:$PATH
     
    3239hello-world: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped
    3340}}}
    34 
     41* Example OpenWrt 16.02 for the Ventana (imx6) platform:
     42{{{#!bash
     43# download toolchain
     44wget http://dev.gateworks.com/openwrt/16.02/imx6/Gateworks-Toolchain-imx6_gcc-5.2.0_musl-1.1.12_eabi.Linux-x86_64.tar.bz2
     45# extract toolchain
     46tar xvf Gateworks-Toolchain-imx6_gcc-5.2.0_musl-1.1.12_eabi.Linux-x86_64.tar.bz2
     47# add toolchain to path
     48PATH=$PWD/Gateworks-Toolchain-imx6_gcc-5.2.0_musl-1.1.12_eabi.Linux-x86_64/toolchain-arm_cortex-a9+neon_gcc-5.2.0_musl-1.1.12_eabi/bin:$PATH
     49# create a simple program
     50cat << EOF > hello-world.c
     51#include <stdio.h>
     52
     53int main (int argc, char** argv)
     54{
     55printf("Hello World\n");
     56return 0;
     57}
     58EOF
     59# compile your program
     60arm-openwrt-linux-gcc hello-world.c -o hello-world
     61}}}
     62 
    3563Note:  The prebuilt toolchain may have some issue if the script arm-openwrt-linux-uclibcgnueabi-wrapper.sh is used (with regard to paths having whitespace).
    3664