User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mission:resources:picoprint:software [2014/01/08 10:17] – [Install and compile kernel] chronomission:resources:picoprint:software [2015/01/26 22:15] (current) – [GPIOs] chrono
Line 9: Line 9:
 </code> </code>
  
-Create a cubieboard2 specific cross-development environment:+Create a stable armv7a-hardfloat-linux-gnueabi tool chain for the Cubieboard2:
  
 <code> <code>
Line 69: Line 69:
  
 ==== Install and compile kernel ==== ==== Install and compile kernel ====
 +
 +=== Get the sources ===
  
 <code> <code>
Line 76: Line 78:
 $ git checkout sunxi-3.4 $ git checkout sunxi-3.4
 </code> </code>
 +
 +=== Prepare the kernel ===
  
 Use default config to get something to start with Use default config to get something to start with
Line 81: Line 85:
 <code> <code>
 $ CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make sun7i_defconfig $ CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make sun7i_defconfig
-</code> 
-<code> 
-  HOSTCC  scripts/basic/fixdep 
-  HOSTCC  scripts/kconfig/conf.o 
-  SHIPPED scripts/kconfig/zconf.tab.c 
-  SHIPPED scripts/kconfig/zconf.lex.c 
-  SHIPPED scripts/kconfig/zconf.hash.c 
-  HOSTCC  scripts/kconfig/zconf.tab.o 
-  HOSTLD  scripts/kconfig/conf 
-# 
-# configuration written to .config 
-# 
 </code> </code>
  
Line 101: Line 93:
 </code> </code>
  
-Compile kernel and modules+<WRAP round tip> 
 +**The kernel seems to fail to compile when the following settings are enabled:** 
 +  * Networking support -> [*] RF Switch subsystem support 
 +    //Solution: Disable RF Switch subsystem support (not needed on CB2 anyways).// 
 +  * Power Management options -> [*] Run-time PM core functionality 
 +    //Solution: Disable Run-time PM core functionality or apply the following patch.// 
 +</WRAP> 
 + 
 +<sxh c; toolbar:false> 
 +--- arch/arm/mach-sun7i/pm/standby/mem_printk.c 2014-01-08 12:42:26.641644236 +0100 
 ++++ /tmp/mem_printk.c   2014-01-08 12:42:18.706835502 +0100 
 +@@ -165,7 +165,7 @@ 
 +        int  negative = 0;                //defualt is positive value 
 +        int  i; 
 +        int  j; 
 +-       char digit_string[] = "0123456789ABCDEF";        
 ++       char * digit_string = "0123456789ABCDEF";        
 +         
 +        if(value == 0) 
 +        { 
 +@@ -211,7 +211,7 @@ 
 +        char stack[16]; 
 +        int  i; 
 +        int  j; 
 +-       char digit_string[] = "0123456789ABCDEF";        
 ++       char * digit_string = "0123456789ABCDEF";        
 +         
 +        if(value == 0) 
 +        { 
 +@@ -366,7 +366,7 @@ 
 + { 
 +        //fill with space ' ' when align request, 
 +        //the max align length is 16 byte. 
 +-       char fill_ch[] = "                "; 
 ++       char * fill_ch = "                "; 
 +        if (len < align) 
 +        { 
 +                //fill at right 
 +</sxh> 
 + 
 + 
 + 
 +Compile kernel 
  
 <code> <code>
-$ CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make uImage modules+$ CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make -j4 uImage
 </code> </code>
  
 +<code>
 +Image Name:   Linux-3.4.75-00001-g9cfbbed-dirt
 +Created:      Wed Jan  8 12:55:16 2014
 +Image Type:   ARM Linux Kernel Image (uncompressed)
 +Data Size:    4385184 Bytes = 4282.41 kB = 4.18 MB
 +Load Address: 40008000
 +Entry Point:  40008000
 +  Image arch/arm/boot/uImage is ready
 +</code>
  
 +Compile modules 
  
-Other software+<code> 
 +$ CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make -j4 modules 
 +</code> 
 + 
 +==== Install and compile sunxi-tools ==== 
 + 
 +<code> 
 +$ cd .. 
 +$ git clone https://github.com/linux-sunxi/sunxi-tools.git 
 +$ cd sunxi-tools 
 +$ make bin2fex fex2bin 
 +$ git clone https://github.com/linux-sunxi/sunxi-boards.git 
 +</code>
  
 <code> <code>
 emerge -pv nginx pycurl mjpg-streamer emerge -pv nginx pycurl mjpg-streamer
 </code> </code>
 +
 +===== GPIOs =====
 +
 +http://docs.cubieboard.org/tutorials/common/using_python_program_control_gpios
 +===== nginx config =====
 +
 +<code>
 +worker_processes  1;
 +
 +events 
 +{
 +    worker_connections  1024;
 +}
 +
 +http 
 +{
 +    include            mime.types;
 +    default_type       application/octet-stream;
 +    sendfile           on;
 +    keepalive_timeout  65;
 +
 +    map                 $http_upgrade $connection_upgrade 
 +    {
 +        default         upgrade;
 +        ''              close;
 +    }
 +
 +    upstream            "octoprint" 
 +    {
 +        server          127.0.0.1:5000;
 +    }
 +
 +    upstream            "framecam" 
 +    {
 +        server          127.0.0.1:8080;
 +    }
 +
 +    server 
 +    {
 +        listen       80;
 +        server_name  feliks;
 +
 +        client_max_body_size 50M;
 +
 +        location /framecam/
 +        {   
 +            proxy_pass http://framecam/;
 +            proxy_buffering off;
 +        }
 +        
 +        
 +        location /sockjs
 +        {  
 +            proxy_pass http://octoprint;   # NO trailing slash 
 +            proxy_buffering off;
 +            proxy_http_version 1.1;
 +            proxy_set_header Upgrade $http_upgrade;
 +            proxy_set_header Connection $connection_upgrade;
 +
 +        }
 +
 +        location / 
 +        {
 +          
 +            set $pp_d http://127.0.0.1:5000;
 +            if ( $args = 'action=stream' ) {
 +                set $pp_d http://127.0.0.1:8080/$is_args$args;
 +            }
 +            
 +            if ( $args = 'action=snapshot' ) {
 +                set $pp_d http://127.0.0.1:8080/$is_args$args;
 +            }
 +
 +            proxy_pass $pp_d;
 +            proxy_http_version 1.1;
 +            proxy_set_header Upgrade $http_upgrade;
 +            proxy_set_header Connection "upgrade";
 +            proxy_set_header Host $host:$server_port;
 +            proxy_set_header X-Forwarded-Proto $scheme;
 +            proxy_set_header X-Forwarded-For $remote_addr;
 +            proxy_set_header X-Forwarded-Port $server_port;
 +            proxy_set_header X-Request-Start $msec; 
 +          
 +        }
 +
 +        # redirect server error pages to the static page /50x.html
 +        error_page   500 502 503 504  /50x.html;
 +        location = /50x.html 
 +        {
 +            root   html;
 +        }
 +    }
 +}
 +</code>
 +
 +{{tag>lab 3d-printer picoprint robot cubieboard gentoo}}
 +
 +{{keywords>Apollo-NG hackerspace hacker space development makerspace fablab lab community open-resource open resource mobile hackbus 3d-printer picoprint robot cubieboard gentoo}}
 +
 +~~DISCUSSION~~