This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mission:resources:picoprint:software [2014-01-08 09:58] – chrono | mission:resources:picoprint:software [2015-01-26 22:15] (current) – [GPIOs] chrono | ||
---|---|---|---|
Line 9: | Line 9: | ||
</ | </ | ||
- | Create a cubieboard2 specific cross-development environment: | + | Create a stable armv7a-hardfloat-linux-gnueabi tool chain for the Cubieboard2: |
< | < | ||
Line 67: | Line 67: | ||
-rwxr-xr-x 17644 Jan 8 10:47 ./ | -rwxr-xr-x 17644 Jan 8 10:47 ./ | ||
</ | </ | ||
+ | |||
+ | ==== Install and compile kernel ==== | ||
+ | |||
+ | === Get the sources === | ||
+ | |||
+ | < | ||
+ | $ cd .. | ||
+ | $ git clone https:// | ||
+ | $ cd linux-sunxi | ||
+ | $ git checkout sunxi-3.4 | ||
+ | </ | ||
+ | |||
+ | === Prepare the kernel === | ||
+ | |||
+ | Use default config to get something to start with | ||
+ | |||
+ | < | ||
+ | $ CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make sun7i_defconfig | ||
+ | </ | ||
+ | |||
+ | Tweak your kernel according to your wishes | ||
+ | |||
+ | < | ||
+ | $ CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make menuconfig | ||
+ | </ | ||
+ | |||
+ | <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.// | ||
+ | </ | ||
+ | |||
+ | <sxh c; toolbar: | ||
+ | --- arch/ | ||
+ | +++ / | ||
+ | @@ -165,7 +165,7 @@ | ||
+ | int negative = 0; //defualt is positive value | ||
+ | int i; | ||
+ | int j; | ||
+ | - char digit_string[] = " | ||
+ | + char * digit_string = " | ||
+ | | ||
+ | if(value == 0) | ||
+ | { | ||
+ | @@ -211,7 +211,7 @@ | ||
+ | char stack[16]; | ||
+ | int i; | ||
+ | int j; | ||
+ | - char digit_string[] = " | ||
+ | + char * digit_string = " | ||
+ | | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | Compile kernel | ||
+ | |||
+ | < | ||
+ | $ CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make -j4 uImage | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | Image Name: | ||
+ | Created: | ||
+ | Image Type: ARM Linux Kernel Image (uncompressed) | ||
+ | Data Size: 4385184 Bytes = 4282.41 kB = 4.18 MB | ||
+ | Load Address: 40008000 | ||
+ | Entry Point: | ||
+ | Image arch/ | ||
+ | </ | ||
+ | |||
+ | Compile modules | ||
+ | |||
+ | < | ||
+ | $ CROSS_COMPILE=armv7a-hardfloat-linux-gnueabi- ARCH=arm make -j4 modules | ||
+ | </ | ||
+ | |||
+ | ==== Install and compile sunxi-tools ==== | ||
+ | |||
+ | < | ||
+ | $ cd .. | ||
+ | $ git clone https:// | ||
+ | $ cd sunxi-tools | ||
+ | $ make bin2fex fex2bin | ||
+ | $ git clone https:// | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | emerge -pv nginx pycurl mjpg-streamer | ||
+ | </ | ||
+ | |||
+ | ===== GPIOs ===== | ||
+ | |||
+ | http:// | ||
+ | ===== nginx config ===== | ||
+ | |||
+ | < | ||
+ | worker_processes | ||
+ | |||
+ | events | ||
+ | { | ||
+ | worker_connections | ||
+ | } | ||
+ | |||
+ | http | ||
+ | { | ||
+ | include | ||
+ | default_type | ||
+ | sendfile | ||
+ | keepalive_timeout | ||
+ | |||
+ | map | ||
+ | { | ||
+ | default | ||
+ | '' | ||
+ | } | ||
+ | |||
+ | upstream | ||
+ | { | ||
+ | server | ||
+ | } | ||
+ | |||
+ | upstream | ||
+ | { | ||
+ | server | ||
+ | } | ||
+ | |||
+ | server | ||
+ | { | ||
+ | listen | ||
+ | server_name | ||
+ | |||
+ | client_max_body_size 50M; | ||
+ | |||
+ | location /framecam/ | ||
+ | { | ||
+ | proxy_pass http:// | ||
+ | proxy_buffering off; | ||
+ | } | ||
+ | | ||
+ | | ||
+ | location /sockjs | ||
+ | { | ||
+ | proxy_pass http:// | ||
+ | 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:// | ||
+ | if ( $args = ' | ||
+ | set $pp_d http:// | ||
+ | } | ||
+ | | ||
+ | if ( $args = ' | ||
+ | set $pp_d http:// | ||
+ | } | ||
+ | |||
+ | proxy_pass $pp_d; | ||
+ | proxy_http_version 1.1; | ||
+ | proxy_set_header Upgrade $http_upgrade; | ||
+ | proxy_set_header Connection " | ||
+ | proxy_set_header Host $host: | ||
+ | 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 | ||
+ | location = / | ||
+ | { | ||
+ | root html; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | {{tag> | ||
+ | |||
+ | {{keywords> | ||
+ | |||
+ | ~~DISCUSSION~~ |