ArmbianHowTo

(Difference between revisions)
(Updating image)
(Updating image)
Line 163: Line 163:
 
You can update the the board using apt.
 
You can update the the board using apt.
  
   #apt update
+
   apt update
   #apt upgrade
+
   apt upgrade
  
 
= Building u-boot =
 
= Building u-boot =

Revision as of 04:21, 19 February 2019


Contents

Where to get the Armbian images

All official Armbian-based images are available at this FTP location, refer to the README.txt file inside if you are not sure what to download:

ftp://staging.olimex.com/Allwinner_Images/A20-OLinuXino/


You can download these images either directly from the FTP or from the torrents available in the FTP. Sometimes the torrents inside are faster way to get the images.

How to use Armbian images

The great Armbian documentation is available here and should always be considered:

https://docs.armbian.com


Yet, consider that there might be some minor differences in our images.

Ways to access the board

There are at least five ways to access the board's console but the serial-USB converter is always recommended since it is the most resilient to software misconfiguration.

The first two access methods should always work by default. Also consider that you can interrupt boot process only if using one of these two:

1. serial-USB converter cable + personal computer

2. HDMI monitor

Method that would work out-of-the-box only with newer hardware:

3. LCD display

Methods that require some knowledge and experience and might require additional configuration. Furthermore, you can't interrupt boot process since the processes get started during kernel:

4. USB-OTG + personal computer

5. Ethernet SSH + personal computer

Console login

Default login is:

   login: root
   password: 1234

After login you'll be prompt for new password.

If you don't reach console login prompt, ensure that your external power supply is good enough (A20 boards shouldn't be powered via USB, neither via GPIO headers); ensure that your card is properly working and properly written with a well-known tool; consider that your board and/or image might require manual configuration (refer to Manual board configuration)


You could use the USB_OTG connector as serial port. Connect the board to a host computer via USB-mini cable. Wait some time for the board to boot. In the system log you should see something like:

   dmesg
   
   usb 3-2: new high-speed USB device number 5 using xhci_hcd
   usb 3-2: New USB device found, idVendor=0525, idProduct=a4a7
   usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
   usb 3-2: Product: Gadget Serial v2.4
   usb 3-2: Manufacturer: Linux 4.19.5-sunxi with musb-hdrc
   cdc_acm 3-2:2.0: ttyACM0: USB ACM device

Then use picocom, minicom, etc to login:

   picocom -b 115200 /dev/ttyACM0
   
   18.04.1 LTS olinuxino ttyGS0
   olinuxino login:

Manual board configuration

By default A20 boards manufactured after 01.01.2018 have board IDs stored in the EEPROM memories with automatic detection in mind and these would not require manual board configuration. These "newer" boards get identified and recognized by the information stored on their EEPROMs and proper Linux configuration gets automatically loaded.

The Armbian-based image is universal for all Olimex A20 boards and in order to load proper configuration some additional board configuration might be required. In order to use this image with boards manufactured or purchased before 01.01.2018 a one-time configuration might be required. This procedure is also helpful if you erased or used the EEPROM for other purposes (thus overwritten the information about the board's ID).

The manual configuration requires interrupting the boot and loading the proper configuration for your board. You would also need either HDMI or serial-USB connection to the board (Ethernet SSH and USB-OTG connection to the board are configured in the kernel and you can't interrupt the boot soon enough to enter the u-boot configurator). If your board has EEPROM (all boards except for old revisions of A20-SOM should have EEPROM), this configuration can be stored for subsequent boots.

  • Stop in the u-boot when you see:
   Autoboot in 1 seconds, press <Space> to stop
   =>
  • List all supported boards and variants:
   olinuxino config list

Remember the ID number of the board that you have from the list.

  • Set configuration, for example if you have A20-OLinuXino-LIME2-e16Gs16M, hardware revision K you would have to type:
   olinuxino config 9604 k

After the hardware revision "k" you can also add custom serial number or custom MAC address. That data would be stored to the EEPROM of the board.

  • Save the changes permanently with:
   saveenv
  • Check what is the current configuration and if not happy repeat the configuration process:
   olinuxino config info 
  • Reboot the board and you're ready:
   reset

Selecting video output

On most boards you can select between HDMI and LCD output

  • A20-OLinuXino
    • HDMI
    • LCD
  • A33-OLinuXino
    • LCD


HDMI output always has the highest priority. This means that if you plug an HDMI cable, the output always will be on the HDMI monitor, regardless of other settings.

If HDMI is not present, then LCD output will be used. By default the image tries to use auto-detect method for the LCD. The auto-detection will only work on panels and boards . You can manually override this in the u-boot console as follows.

  • Stop in the u-boot
   Autoboot in 1 seconds, press <Space> to stop
   =>
  • List all supported LCD panels:
   olinuxino monitor list
   
   Supported video outputs:
   ----------------------------------------
   LCD-OLinuXino                  - Video outout to the LCD connector with AUTO detect function
   LCD-OLinuXino-4.3TS            - Video output to LCD-OLinuXino-4.3TS
   LCD-OLinuXino-7                - Video output to LCD-OLinuXino-7
   LCD-OLinuXino-5                - Video output to LCD-OLinuXino-5
   LCD-OLinuXino-10               - Video output to LCD-OLinuXino-10
  • Set configuration, for example LCD-OLinuXino-7
   olinuxino monitor set LCD-OLinuXino-7
  • You can make changes permanent with:
   saveenv
  • Reboot the board and you're ready:
   reset

Selecting bootlog console

You can select the bootlog to be displayed on HDMI/LCD or on the debug serial port. This is done via armbianEnv.txt file.

Open the file:

   nano /boot/armbianEnv.txt

For bootlog on the serial port use:

   console=serial

For bootlog on HDMI/LCD console:

   console=both

Save the file and reboot the board.

Updating image

You can update the the board using apt.

 apt update
 apt upgrade

Building u-boot

Get the latest sources:

 git clone https://github.com/OLIMEX/u-boot.git
 cd u-boot

Build it:

 make A20-OLinuXino_defconfig
 make CROSS_COMPILE=arm-linux-gnueabihf-


Updating via USB

You can write the new u-boot to MMC, eMMC, SPI Flash or NAND (not fully supported) using DFU protocol.

Boot the board and stop at u-boot console. Connect USB-mini cable to a host PC.


Update SPI flash

Check the available partitions with:

   => mtd
   
   device nor0 <flash.0>, # parts = 4
    #: name		size		offset		mask_flags
    0: SPI.u-boot          0x00200000	0x00000000	0
    1: SPI.u-boot-env      0x00020000	0x00200000	0
    2: SPI.u-boot-env.backup0x00020000	0x00220000	0
    3: SPI.user            0x00dc0000	0x00240000	0
   
   active partition: nor0,0 - (SPI.u-boot) 0x00200000 @ 0x00000000
   
   defaults:
   mtdids  : nand0=nand.0,nor0=nor.0
   mtdparts: mtdparts=nand.0:4m(NAND.SPL),4m(NAND.SPL.backup),4m(NAND.u-boot),4m(NAND.u-boot.backup),4m(NAND.u-boot-env),4m(NAND.u-boot-env.backup),4m(NAND.dtb),16m(NAND.kernel),-(NAND.rootfs);nor.0:2m(SPI.u-boot),128k(SPI.u-boot-env),128k(SPI.u-boot-env.backup),-(SPI.user)
   

Activate DFU protocol with:

   => dfu 0 sf "0:0:25000000:0"
   interface: sf, devstr: 0:0:25000000:0

Next, on the host PC run:

   dfu-util -l
   
   dfu-util 0.9
   
   Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
   Copyright 2010-2016 Tormod Volden and Stefan Schmidt
   This program is Free Software and has ABSOLUTELY NO WARRANTY
   Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
   
   Found DFU: [15ba:0041] ver=0215, devnum=6, cfg=1, intf=0, path="3-2", alt=2, name="SPI.u-boot-env.backup", serial="ffffffff"
   Found DFU: [15ba:0041] ver=0215, devnum=6, cfg=1, intf=0, path="3-2", alt=1, name="SPI.u-boot-env", serial="ffffffff"
   Found DFU: [15ba:0041] ver=0215, devnum=6, cfg=1, intf=0, path="3-2", alt=0, name="SPI.u-boot", serial="ffffffff"

Update u-boot binary with:

   dfu-util -D spl/u-boot-spl.bin -a SPI.u-boot

Update SD/eMMC card

Stop loading in the u-boot. To check available MMC devices run:

   mmc list

If the board is booted from SD card and you also have eMMC, the output will be:

   mmc@01c0f000: 0 (SD)
   mmc@01c11000: 1 (eMMC)

Connect USB-mini cable enter:

   ums 0 mmc 0

or:

   ums 0 mmc 1

New mass storage device will show-up on the host computer. To write u-boot use:

   sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdX seek=16 conv=sync

where /dev/sdX should be replaced with the new device, /dev/sdb, /dev/sdc, etc.

Building image

Make sure to take a look at the official Armbian documentation here: https://docs.armbian.com

  • Clone repository
 git clone --branch olimex https://github.com/olimex/build
  • Run build script
   cd build
   ./compile

Building requires root access. System preparation can take long, depending on system, internet connection, etc. After everything is ready a prompt will appear:

   Select what to build:
       -> U-boot and kernel packages 
       -> Full OS image for flashing

The first option will build only u-boot and kernel packages. This is suitable for updating image. The second option will make ready to use image with u-boot, kernel and rootfs.

   Select the kernel configuration:
       -> Do not change the kernel configuration
       -> Show a kernel configuration menu before compilation

Here you can modify kernel configuration, before build. After that target must be selected. Olimex's images are not officially supported by Armbian team, so you must select Show CSC/WIP/EOS option.

   Select the target board. Displaying:
       -  (CSC)  -  Community Supported Configuration
       -  (WIP)  -  Work In Progress
       -  (ESO)  -  End Of Support


Here select either:

   olinuxino-a20  - Common configuration file for All A20-OLinuXino boards

or

   olinuxino-a33  - A33 quad core 1Gb Soc


Next kernel variant must be selected. Here select next branch:

   Select the target kernel branch
   Exact kernel versions depend on selected board
       -> default  Vendor provided / legacy (3.4.x - 4.4.x)
       -> next     Mainline (@kernel.org)   (4.x)
       -> dev      Development version      (4.x)


Next select distribution:

   Select the target OS release
       -> jessie   Debian 8 Jessie / unsupported
       -> stretch  Debian 9 Stretch
       -> xenial   Ubuntu Xenial 16.04 LTS
       -> bionic   Ununtu Bionic 18.04 LTS


Finally select building desktop environment or not:

   Select the target image type
       -> Image with console interface (server)
       -> Image with desktop environment


After some time the image / packages will be available in the output directory. For example:

   tree output
   |-- debs
   |   |-- armbian-config_5.65_all.deb
   |   |-- armbian-firmware_5.65_all.deb
   |   |-- armbian-firmware-full_5.65_all.deb
   |   |-- armbian-tools-bionic_5.65_armhf.deb
   |   |-- bionic
   |   |   |-- armbian-bionic-desktop_5.65_all.deb
   |   |   |-- linux-bionic-root-next-olinuxino-a20_5.65_armhf.deb
   |   |-- linux-dtb-next-sunxi_5.65_armhf.deb
   |   |-- linux-headers-next-sunxi_5.65_armhf.deb
   |   |-- linux-image-next-sunxi_5.65_armhf.deb
   |   |-- linux-source-next-sunxi_5.65_all.deb
   |   |-- linux-u-boot-next-olinuxino-a20_5.65_armhf.deb
   |--images
   |   |-- Armbian_5.65_Olinuxino-a20_Ubuntu_bionic_next_4.19.5_desktop.img
  • Flashing image

Put sdcard in the host PC. New device should appear, e.g. /dev/sdc. Flash the image using the following command:

 # dd if=/path/to/Armbian_5.65_Olinuxino-a20_Ubuntu_bionic_next_4.19.5_desktop.img.img of=/dev/sdx bs=10M

Replace /dev/sdx with your device. You must use /dev/sdx, not /dev/sdx1!