|
|
Line 56: |
Line 56: |
| [[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot | | [[Build Bootable SD Card with Debian]] Step by step instructions how to make SD card image with above Kernel and U-boot |
| | | |
− | ====Script files==== | + | ====Setup and configure the installed debian image==== |
− | '''Script file'''
| |
| | | |
− | The script.bin is a text file with very important configuration parameters like port GPIO assignments, DDR memory parameters, Video resolution etc, by changing these parameters in the script.bin you can configure your Linux without need to re-compile your kernel again and again this is smart way Allwinner provides for tweaking A13 Linux Kernel
| + | There are several settings that can be made for a particular hardware configuration in the script file. |
| | | |
− | '''fex'''
| + | The following link explains the script file as well as wifi or ethernet setup and GPIO settings |
| | | |
− | The fex tool will convert a script.bin file to a text file and back again.
| + | [[Configuration of hardware in the debian image]] |
| | | |
− | This allows the easy modification of the settings that are in the script.bin file
| |
− |
| |
− | '''Tools and script files'''
| |
− |
| |
− | [https://docs.google.com/open?id=0B-bAEPML8fwlNElERXRUZURTTUU A13 script bin and fex tool]
| |
− |
| |
− | The directory A13_script_files contains:
| |
− |
| |
− | * script.bin - the default script with VGA800x600settings
| |
− | * fex2bin_bin_fex_tools.tar.gz - tools fex2bin and bin2fex for converting the *.bin script file to *.fex(text file)
| |
− | * script_GPIO_VGA - script with VGA800x600settings
| |
− | * script_GPIO_LCD_800x480 - script with LCD800x480settings
| |
− |
| |
− | === Changing A13-OLinuxino settings to VGA800x600 or LCD800x480 ===
| |
− |
| |
− | The default SD card setup is made with settings for VGA 800x600.
| |
− | If you want to switch between VGA 800x600 and LCD800x480 mode then you have to replace the existing script.bin file from the first SD card partitition (note that this partition is FAT - so you can replace the file under Windows or Linux) with the script.bin file from script_GPIO_VGA directory (if you want to change to VGA800x600 mode) or from script_GPIO_LCD_800x480 directory (if you want to change to LCD800x600 mode).
| |
− |
| |
− | === Establish WIFI connection ===
| |
− |
| |
− | plug in [https://www.olimex.com/Products/Modules/RF/MOD-WIFI-RTL8188/ MOD-WIFI-RTL8188] if the board is not A13-OLinuXino-WIFI
| |
− |
| |
− | type
| |
− | ifconfig -a
| |
− |
| |
− | lo Link encap:Local Loopback
| |
− | inet addr:127.0.0.1 Mask:255.0.0.0
| |
− | UP LOOPBACK RUNNING MTU:16436 Metric:1
| |
− | RX packets:0 errors:0 dropped:0 overruns:0 frame:0
| |
− | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
| |
− | collisions:0 txqueuelen:0
| |
− | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
| |
− |
| |
− | tunl0 Link encap:IPIP Tunnel HWaddr
| |
− | NOARP MTU:1480 Metric:1
| |
− | RX packets:0 errors:0 dropped:0 overruns:0 frame:0
| |
− | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
| |
− | collisions:0 txqueuelen:0
| |
− | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
| |
− |
| |
− | wlan2 Link encap:Ethernet HWaddr 48:02:2a:eb:21:1c
| |
− | inet addr:192.168.0.229 Bcast:192.168.0.255 Mask:255.255.255.0
| |
− | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
| |
− | RX packets:166 errors:0 dropped:726 overruns:0 frame:0
| |
− | TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
| |
− | collisions:0 txqueuelen:1000
| |
− | RX bytes:31361 (30.6 KiB) TX bytes:1248 (1.2 KiB)
| |
− |
| |
− | and look at your wlan number. In this case we have wlan2
| |
− |
| |
− | open the file /etc/network/interfaces- for example using vi tool
| |
− |
| |
− | vi /etc/network/interfaces
| |
− |
| |
− | and change
| |
− |
| |
− | auto wlan2
| |
− |
| |
− | iface wlan2 inet dhcp
| |
− |
| |
− | wpa-ssid YourSSIDname
| |
− |
| |
− | wpa-psk YourWPAkey
| |
− |
| |
− | reboot A13-OLinuXino board
| |
− |
| |
− | Chek your connection
| |
− |
| |
− | ifconfig -a
| |
− |
| |
− | if everything is ok you should see something as:
| |
− |
| |
− | wlan1 Link encap:Ethernet HWaddr 48:02:2a:eb:21:1c
| |
− | inet addr:192.168.0.229 Bcast:192.168.0.255 Mask:255.255.255.0
| |
− | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
| |
− | RX packets:166 errors:0 dropped:726 overruns:0 frame:0
| |
− | TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
| |
− | collisions:0 txqueuelen:1000
| |
− | RX bytes:31361 (30.6 KiB) TX bytes:1248 (1.2 KiB)
| |
− |
| |
− |
| |
− | === Establish ethernet connection using USB-ETHERNET adapter ===
| |
− |
| |
− | [https://www.olimex.com/Products/OLinuXino/A13/USB-ETHERNET-AX88772B/ recommended supported adapter USB-ETHERNET-AX88772B]
| |
− |
| |
− | plug in USB-ETHERNET-AX88772B adapter
| |
− |
| |
− | type
| |
− |
| |
− | ifconfig -a
| |
− |
| |
− | you should see something like this
| |
− |
| |
− | eth1 Link encap:Ethernet HWaddr 00:80:80:9a:4a:63
| |
− | inet addr:192.168.0.113 Bcast:192.168.0.255 Mask:255.255.255.0
| |
− | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
| |
− | RX packets:58 errors:0 dropped:0 overruns:0 frame:0
| |
− | TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
| |
− | collisions:0 txqueuelen:1000
| |
− | RX bytes:7852 (7.6 KiB) TX bytes:510 (510.0 B)
| |
− |
| |
− | lo Link encap:Local Loopback
| |
− | inet addr:127.0.0.1 Mask:255.0.0.0
| |
− | UP LOOPBACK RUNNING MTU:16436 Metric:1
| |
− | RX packets:0 errors:0 dropped:0 overruns:0 frame:0
| |
− | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
| |
− | collisions:0 txqueuelen:0
| |
− | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
| |
− |
| |
− | tunl0 Link encap:IPIP Tunnel HWaddr
| |
− | NOARP MTU:1480 Metric:1
| |
− | RX packets:0 errors:0 dropped:0 overruns:0 frame:0
| |
− | TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
| |
− | collisions:0 txqueuelen:0
| |
− | RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
| |
− |
| |
− | look at your eth number. In this case we have eth1
| |
− |
| |
− | open the file /etc/network/interfaces- for example using vi tool
| |
− |
| |
− | vi /etc/network/interfaces
| |
− |
| |
− | and change the following rows
| |
− |
| |
− | auto eth1
| |
− |
| |
− | iface eth1 inet dhcp
| |
− |
| |
− | where eth1 is the interface number
| |
− |
| |
− | reboot A13-OLinuXino board
| |
− |
| |
− | or type ifup eth1
| |
− |
| |
− | Check your connection
| |
− |
| |
− | ifconfig -a
| |
− |
| |
− | if everything is ok you should see something as:
| |
− |
| |
− | eth1 Link encap:Ethernet HWaddr 00:80:80:9a:4a:63
| |
− | inet addr:192.168.0.113 Bcast:192.168.0.255 Mask:255.255.255.0
| |
− | UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
| |
− | RX packets:725 errors:0 dropped:0 overruns:0 frame:0
| |
− | TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
| |
− | collisions:0 txqueuelen:1000
| |
− | RX bytes:77056 (75.2 KiB) TX bytes:1686 (1.6 KiB)
| |
− |
| |
− |
| |
− |
| |
− | === GPIO ===
| |
− |
| |
− |
| |
− | '''GPIO changing'''
| |
− |
| |
− | type lsmod
| |
− |
| |
− | if sun4i-gpio is present - OK
| |
− |
| |
− | unless type modprobe sun4i-gpio
| |
− |
| |
− | go to /sys/devices/virtual/misc/sun4i-gpio/pins and type ls
| |
− |
| |
− | list of supported pins will be shown
| |
− |
| |
− | example for port reading:
| |
− | cat pe4 read PortE4
| |
− | the result should be
| |
− | 0 or 1
| |
− | example for port writing:
| |
− | echo 1 > pg9 - turn on LED
| |
− |
| |
− | '''Changing A13 GPIO direction'''
| |
− |
| |
− | extract fex2bin_bin2fex_tools on linux machine
| |
− |
| |
− | sudo su
| |
− |
| |
− | enter password
| |
− |
| |
− | cd fex2bin_bin2fex_tools directory
| |
− |
| |
− |
| |
− | mount /dev/sdx1 /mnt/sd - mount first partitition on SD card
| |
− |
| |
− | ./bin2fex /mnt/sd/script.bin > /mnt/sd/script_test.fex - convert bin file to fex
| |
− |
| |
− | gedit /mnt/sd/script_test.fex
| |
− |
| |
− | GPIOs are defined in the end.
| |
− |
| |
− | where
| |
− |
| |
− | Pxx<mode><pull><drive><data>
| |
− | mode 0-7, 0=input, 1=ouput, 2-7 I/O function
| |
− | pull 0=none, 1=up, 2=down
| |
− | drive 0-3, I/O drive level
| |
− | data - data output - logical 0 or 1
| |
− |
| |
− | for example:
| |
− | if you want to change GPIO direction then change first parameter after port name:
| |
− | gpio_pin_8 = port:PE08<0><default><default><default> make PE8 input
| |
− | gpio_pin_8 = port:PE08<1><default><default><default> make PE8 output
| |
− |
| |
− | save and exit
| |
− |
| |
− | ./fex2bin /mnt/sd/script_test.fex > /mnt/sd/script.bin - convert fex to bin
| |
| | | |
| === Creating a program to run on the A13-OlinuXino board === | | === Creating a program to run on the A13-OlinuXino board === |
Hardware
Schematics and board designs can be found here
Olimex Hardware
Designs were created with Eagle
A limited functionality freeware version of Eagle can be downloaded here
Eagle Freeware
There is very limited information about the A13 processor. The only detailed data found is an A10 datasheet which has some errors in it apparently. As this is the best source of low level information it is linked here
A10 datasheet
Software
Bare Metal programming - no OS
Using the JTAG port on the A13 board and eclipse it is possible to program and debug code written directly on the chip without an OS.
The advantage is no kernel overhead and tighter control of the CPU operation.
Due to the lack of documentation from Allwinner the chip manufacturer nobody has yet been able to program directly on the chip.
If anyone is successful or gathers more information on this please post on the forum and the wiki will be updated.
Using an operating system - Nand flash
The Wifi version of the A13 board comes preprogrammed with android, which is held in the Nand flash.
The image in the Nand flash can be updated using the following link
LiveSuit for loading images to the NAND flash; to activate A13 bootloader do as follows: run Livesuit, disconnect the power supply and USB cable, then press HOME button, apply power supply, attach USB cable and release the button, Livesuit will detect the bootloader and will ask which file to program to the NAND flash.
Prebuilt images that can be programmed into the Nand flash can be found here.
Andoroid 4.0.3 NAND flash prebuild image for VGA 800x600 resolution (default shipped with A13-OLinuXino-WIFI)
Andoroid 4.0.3 NAND flash prebuild image for LCD 800x480 resolution
Using an operating system - SD card
Prebuilt images
Some prebuilt images have been created, follow the link below for details.
Prebuilt SD card images running debian
Build your own kernel and image onto SD card
Some developers want more control over the kernel and modules that are included. The link below shows directions to build your own kernel and image it onto an SD card.
Build Bootable SD Card with Debian Step by step instructions how to make SD card image with above Kernel and U-boot
Setup and configure the installed debian image
There are several settings that can be made for a particular hardware configuration in the script file.
The following link explains the script file as well as wifi or ethernet setup and GPIO settings
Configuration of hardware in the debian image
Creating a program to run on the A13-OlinuXino board
Programming for A13 in debian Step by step instructions to make your first hello world program run on the A13 board running debian.
Software Links
Tools to hack A13-OLinuXino
Installing Xfce4 graphical interface on Debian How to install XFCE4 on A13-OLinuXino
Projects
ANDROID PROJECTS:
Interface MOD-IO board with I2C under Android
LINUX PROJECTS:
GPIOs
Instructions how to run MOD-BT with A13-OLinuXino
FAQ
Under construction