Enable SATA and SD cards on A20-OLinuXino-MICRO-4GB with Android on NAND

Enable SATA and SD cards on A20-OLinuXino-MICRO-4GB with Android on NAND

Please read Liability Disclaimer and License Agreement CAREFULLY

After reading a lot of post on how to enable the SD cards on Android i have decided to write a small tutorial on how to enable the use of both SD (micro and full) cards and also of SATA on Android 4.2 for A20-OLinuXino-MICRO-4GB.

This is valid only if Android will be installed on nand - storage_type = 0 in sys_config.fex

All paths are copied from my setup, so you need to look in the folders according to your setup.

The steps are the following:

1. By default the microSD detection is set to pooling in /home/gvi/android/olimex-a20/lichee/tools/pack/chips/sun7i/configs/android/olinuxino-a20/sys_config.fex

[mmc0_para]

sdc_used = 1

sdc_detmode = 3

sdc_buswidth = 4

sdc_clk = port:PF02<2><1><2><default>

sdc_cmd = port:PF03<2><1><2><default>

sdc_d0 = port:PF01<2><1><2><default>

sdc_d1 = port:PF00<2><1><2><default>

sdc_d2 = port:PF05<2><1><2><default>

sdc_d3 = port:PF04<2><1><2><default>

sdc_det = port:PH01<0><1><default><default>

sdc_use_wp = 0

sdc_wp =

sdc_isio = 0

sdc_regulator = "none"

so if you want the microSD to be auto detected change sdc_detmode = 1

2. The full SD card is disable by default, so we need to enable it

[mmc3_para]

sdc_used = 1

sdc_detmode = 1

sdc_buswidth = 4

sdc_cmd = port:PI04<2><1><2><default>

sdc_clk = port:PI05<2><1><2><default>

sdc_d0 = port:PI06<2><1><2><default>

sdc_d1 = port:PI07<2><1><2><default>

sdc_d2 = port:PI08<2><1><2><default>

sdc_d3 = port:PI09<2><1><2><default>

sdc_det = port:PH11<0><1><default><default>

sdc_use_wp = 0

sdc_wp =

sdc_isio = 1

sdc_regulator = "none"

3. Enable SATA - since we are in the fex file check also if the SATA is enable

[sata_para]

sata_used = 1

sata_power_en = port:PB08<1><default><default><0>

4.  Add SATA drivers

Go in folder /home/gvi/android/olimex-a20/lichee/linux-3.4 and press CTRL+H and you will see .config file. 

We need to add SATA drivers to kernel and below is my configuration

# SCSI Transports

#

# CONFIG_SCSI_SPI_ATTRS is not set

# CONFIG_SCSI_FC_ATTRS is not set

# CONFIG_SCSI_ISCSI_ATTRS is not set

# CONFIG_SCSI_SAS_ATTRS is not set

# CONFIG_SCSI_SAS_LIBSAS is not set

# CONFIG_SCSI_SRP_ATTRS is not set

CONFIG_SCSI_LOWLEVEL=y

# CONFIG_ISCSI_TCP is not set

# CONFIG_ISCSI_BOOT_SYSFS is not set

# CONFIG_LIBFC is not set

# CONFIG_LIBFCOE is not set

# CONFIG_SCSI_DEBUG is not set

# CONFIG_SCSI_DH is not set

# CONFIG_SCSI_OSD_INITIATOR is not set

CONFIG_ATA=y

# CONFIG_ATA_NONSTANDARD is not set

CONFIG_ATA_VERBOSE_ERROR=y

CONFIG_SATA_PMP=y

#

# Controllers with non-SFF native interface

#

CONFIG_SATA_AHCI_PLATFORM=y

CONFIG_SW_SATA_AHCI_PLATFORM=y

CONFIG_ATA_SFF=y

#

# SFF controllers with custom DMA interface

#

CONFIG_ATA_BMDMA=y

#

# SATA SFF controllers with BMDMA

#

# CONFIG_SATA_MV is not set

#

# PATA SFF controllers with BMDMA

#

#

# PIO-only SFF controllers

#

#

# Generic fallback / legacy drivers

#

CONFIG_MD=y

You can also get the same result by using make ARCH=arm menuconfig in a terminal window when you are in the folder.

cd /home/gvi/android/olimex-a20/lichee/linux-3.4

make ARCH=arm menuconfig

5. After you have added the drivers you need to build the kernel

In the terminal window type cd ../ and you end up in /home/gvi/android/olimex-a20/lichee

Now type ./build.sh -psun7i_android and wait for the build to finish

6. Edit strings.xml  - this is how my strings are now

file location - /home/gvi/android/olimex-a20/android4.2/frameworks/base/core/res/res/values/strings.xml

<!-- Storage description for internal storage. [CHAR LIMIT=NONE] -->

<string name="storage_internal">Internal storage</string>

<!-- Storage description for the SD card. [CHAR LIMIT=NONE] -->

<string name="storage_sd_card">uSD card</string>

<!-- Storage description for the ful SD card. [CHAR LIMIT=NONE] -->

<string name="storage_normalcard">SD card</string>

<!-- Storage description for USB storage. [CHAR LIMIT=NONE] -->

<string name="storage_usb">USB storage</string>

<!-- Storage description for the SATA HDD. [CHAR LIMIT=NONE] -->

<string name="storage_sata">SATA HDD</string>

7. Change storage_list.xml file 

file location - /home/gvi/android/olimex-a20/android4.2/device/softwinner/olinuxino-a20/overlay/frameworks/base/core/res/res/xml

<StorageList xmlns:android="http://schemas.android.com/apk/res/android">

    <storage android:mountPoint="/mnt/sdcard"

             android:storageDescription="@string/storage_internal"

             android:primary="true"

             android:removable="false"

             android:emulated="false"  

             android:mtpReserve="100" 

             android:allowMassStorage="true"

             android:maxFileSize="0"/>

<storage android:mountPoint="/mnt/microsd"

             android:storageDescription="@string/storage_sd_card"

             android:primary="false"

             android:removable="true"

             android:emulated="false"  

             android:mtpReserve="0" 

             android:allowMassStorage="true"

             android:maxFileSize="0"/>

<storage android:mountPoint="/mnt/fullsd"

             android:storageDescription="@string/storage_normalcard"

             android:primary="false"

             android:removable="true"

             android:emulated="false"  

             android:mtpReserve="0" 

             android:allowMassStorage="true"

             android:maxFileSize="0"/>

    <storage android:mountPoint="/mnt/sata" 

             android:storageDescription="@string/storage_sata" 

             android:primary="false" 

             android:removable="true" 

             android:emulated="false" 

             android:mtpReserve="0" 

             android:maxFileSize="0" /> 

<storage android:mountPoint="/mnt/usbhost1"

             android:storageDescription="@string/storage_usb"

             android:primary="false"

             android:removable="true"

             android:emulated="false"  

             android:mtpReserve="0" 

             android:maxFileSize="0"/>

 

</StorageList>

8. Change init.sun7i.rc

file location - /home/gvi/android/olimex-a20/android4.2/device/softwinner/olinuxino-a20

on early-init

    export EXTERNAL_STORAGE /mnt/sdcard

    mkdir /mnt/sdcard 0000 system system

# for backwards compatibility

    symlink /mnt/sdcard /sdcard

 

    mkdir /mnt/microsd 0000 system system

    mkdir /mnt/fullsd 0000 system system

    mkdir /mnt/sata 0000 system system

    mkdir /mnt/usbhost1 0000 system system

#    mkdir /mnt/usbhost2 0000 system system

#    mkdir /mnt/extsd1 0000 system system

 

    mount debugfs debugfs /sys/kernel/debug

 

    mkdir /databk 0700 root  system

9. Change vold.fstab

file location - /home/gvi/android/olimex-a20/android4.2/device/softwinner/olinuxino-a20

dev_mount sdcard /mnt/sdcard auto /devices/virtual/block/nandk

dev_mount microsd /mnt/microsd auto /devices/platform/sunxi-mmc.0/mmc_host

dev_mount fullsd /mnt/fullsd auto /devices/platform/sunxi-mmc.3/mmc_host

dev_mount       sata    /mnt/sata       auto    /devices/platform/sw_ahci.0

 

dev_mount usbhost1 /mnt/usbhost1 auto /devices/platform/sw-ehci.1 /devices/platform/sw_hcd_host0 /devices/platform/sw-ohci.1 /devices/platform/sw-ehci.2

10. Compile Android

cd /home/gvi/android/olimex-a20/android4.2

source build/envsetup.sh

lunch

extract-bsp

make -j4

 

pack

11. Burn the image

 

and...voila

Internal storage part 1

 A20-OLinuXino-MICRO-4GB Internal storage

Internal storage part 2

A20-OLinuXino-MICRO-4GB Internal storage 1

Micro SD card

A20-OLinuXino-MICRO-4GB Micro SD Card mount

Full SD card

A20-OLinuXino-MICRO-4GB Full SD Card mount

SATA 32Gb SSD 

A20-OLinuXino-MICRO-4GB SATA SSD mount

For hardware pictures look in Android Remote Control for Digital camera

 

Download the image android_olinuxino-a20.img

Write comment (26 Comments)

Android Remote Control for Digital camera

Android Remote Control for Digital camera

Please read Liability Disclaimer and License Agreement CAREFULLY

When i started to implement the Star Traker function on the previous remote control (See link) i did not took in to consideration the speed limits related to 

more complex math that the ATMega 328 has, so the first step was to look in to affordable CPU with a math punch.

At this moment on the market there are many choices and i decided to go for the "less" known AllWinner A20 on a board made by Olimex (A20-OLinuXino-Micro-4Gb).

In the mean while i have been contacted by several sports reporters and  war corespondent to build for them remotes that are able to trigger the camera from a long distance.

Based on the considerations above i have decided that i will use the XBEE S2B Pro as base for wireless communication between the Android remote control for digital camera and the triggers, in the same time some of the triggers can act as self maintained remote control after they are power on and  they receive the function to execute from the Android remote control for digital camera.

Below are the main parts of this wireless trigger system for DSLR:

1. The Android remote control for digital camera main unit

1.1. The coordinator XBEE is connected to the Olimex A20 board and is controlled using Serial port 3

[uart_para3]

uart_used = 1

uart_port = 3

uart_type = 4

uart_tx = port:PG06<4><1><default><default>

uart_rx = port:PG07<4><1><default><default>

uart_rts = port:PG08<4><1><default><default>

 

uart_cts = port:PG09<4><1><default><default>

Wireless connection for remote trigger

1.2 Android remote control for digital camera main unit has incorporated in this buil a 64Gb HDD

This HDD is not used in Android at this point (Only works on Linux) but the functionality is on To Do list for Android

SSD HDD 64Gb

1.3 The ATMega 328 Control/Sensors board

This PCB contains the Pressure sensor MS5611, the Inertial Measurement Unit sensor MPU9150, the Real Time Clock DS1307 and the GPS MTK3329 that can be directly access by the main board using I2C and Serial communication protocols. These sensors are used for system positioning needed for Star Tracking.

The ATMega 328 it is used to control the cameras/devices and sensors connected directly to the Android remote control for digital camera main unit by SPI connection.

The communication protocols are listed below

;Sensors I2C

[twi2_para]

twi2_used = 1

twi2_scl = port:PB20<2><default><default><default>

 

twi2_sda = port:PB21<2><default><default><default>

 

;MTK3329 serial

[uart_para6]

uart_used = 1

uart_port = 6

uart_type = 2

uart_tx = port:PI12<3><1><default><default>

 

uart_rx = port:PI13<3><1><default><default>

 

;Use for ATMEGA

[spi2_para]

spi_used = 1

spi_cs_bitmap = 1

spi_cs0 = port:PC19<3><default><default><default>

;spi_cs1 = port:PI01<2><default><default><default>

spi_sclk = port:PC20<3><default><default><default>

spi_mosi = port:PC21<3><default><default><default>

spi_miso = port:PC22<3><default><default><default>

 

[gpio_para]

gpio_used = 1

gpio_num = 7

;pin_name = port:XXYY<0 is as input, mux 1 as output>

;<pullup/down>

;<drive capability> defines the output drive in mA, values are 0-3 corresponding to 10mA, 20mA, 30mA and 40mA.>

gpio_en_gps = port:PB03<1><1><0><0>

gpio_en_mega = port:PB04<1><1><0><0>

gpio_en_xbee = port:PG03<1><1><0><0>

gpio_reset_xbee = port:PG04<1><1><0><0>

gpio_dtr_xbee = port:PG05<1><1><0><0>

;interrupts

gpio_int_imu = port:PH00<6><default><default><default>

gpio_int_mega = port:PH07<6><default><default><default>

 

Sensors Board

 

MPU9150 and MS5611

 1.4 Android remote control for digital camera main unit assembly

The assembled parts in the 3D printed case

Inside Android remote control for digital camera main

Android remote control for digital camera Assembly 1

Android remote control for digital camera Assembly 2

 

The LCD below is not provided by Olimex, itwas bought from a different supplier. The LCD adapter was bought from Olimex, actually 2 but one of them was

fried since it was received (judging by the looks of it...it is a warranty sent back or a refurbished one - i need to find out time to fix it as i have an extra LCD available).

Android remote control for digital camera LCD

The white connector in the image below is connected to ATMega 328 interrupt pins and it is used to control the Valves sensor and the Projectile sensor.

2 of the 3.5mm jacks are used to coonect camera/flash (Dev1 & Dev2) to the Android remote control for digital camera main unit, the other 2 are used for sensor connections (Sen1 & Sen2).

 

Android remote control for digital camera main unit connections

 

2. Remote Units

2.1 Sound sensor

This sensors was build to act as an independent resource or as as slave for the Main unit.

The amplifier gain is controlled by a digital pot with 2X10bit resolution pots (1024 steps).

The ATMega328 present on this sensors can control the Valve and projectile sensors, it can receive input from a sensor attached to it and can control up to 2 devices (Camera/Flash)

 

Remote Sound Sensor

2.2 Light sensor

Same as the sound sensor

Remote Light Sensor

 

 Light Sensor

2.3 Projectile sensor

This is basically a 2 photo gates sensor used to measure the speed of an object that goes through the gates.

Projectile Sensor

 

2.4 Valves sensor

It has an adapter board for higher voltage and purge command for the valves

Valves sensor adapter board

Valve 1

Valve 2

 

3. The software

3.1 Android app to control the device

This App for Android remote control for digital camera is under development at this point but below you can see a screen shot of the Star Tracker function - almost

2000 night sky objects in data base at this point

Android remote control for digital camera App

 

3.2 Sensors drivers for Linux Kernel 3.4.90

Under investigation/Development -To Do

3.4 Move to Linux Kernel 4.x

Under investigation/Development -To Do

 

Write comment (0 Comments)

DSLR Camera Remote Control sensors

DSLR Camera Remote Control sensors

Please read Liability Disclaimer and License Agreement CAREFULLY

For GVI DSR Camera Remote Control I have made three sensors: light, sound and projectile.

They can trigger the camera automatically when events like lightning, loud sounds are detected.

Each sensor is connected to the camera remote control using a stereo cable - male-male jack of 3.5 mm.

Each sensor receives his power (4.5 -5V) through the tip terminal and sends signal to the camera remote control through the ring terminal.

Sensor Connection

5.1. Sound Sensor

This sensor offers a gain (amplification) of 10000x, 100x on each of the two stages of amplification.

The DSLR camera remote control can be programmed to trigger the camera or other devices connected to it when the sound level goes above or below a preset value.

Sensor electronic scheme

Wired Remote Control for Digital Camera Sound Sensor Schematic

Sensor assembled in a standard plastic case.

Wired Remote Control for Digital Camera Sound Sensor Front View

Wired Remote Control for Digital Camera Sensor Top View

5.2. Light Sensor

This sensor offers a gain (amplification) of 10000x, 100x on each of the two stages of amplification.

The DSLR camera remote control can be programmed to trigger the camera or other devices connected to it when the light level goes above or below a preset value.

In Lighting mode if a spike appears it will trigger the camera tanking the average light level as reference for measurement.

Sensor electronic scheme

Wired Remote Control for Digital Camera Light Sensor Schematic

Sensor assembled in a small plastic case.

Wired Remote Control for Digital Camera Light Sensor Front View

5.3. Projectile Sensor

 This sensor detect when a fast ans small object passes between the two photo gates. Because the distance between the photo gates is known, the

DSLR Camera Remote Control when the object will reach a preset distance. Can be used also for free falling objects.

Sensor electronic scheme

Wired Remote Control for Digital Camera Projectile Base

Wired Remote Control for Digital Camera Projectile Detector

Wired Remote Control for Digital Camera Projectile Emitter

Assemble projectile sensor 1

Assemble projectile sensor 2

I also make hotshoe adaptor to connect a flash to the remote (see picture below).

hot shoe is a mounting point on the top of a camera to attach a flash unit.

Flash Connector with HotShoe

5.4 Dripper

 

With the Dripper device used in Drops Menu you can obtain results like those in the following links Water drops collision or Milk Crowns. The DSLR camera Remote Control

has full control of the valves, flash and will trigger the camera at the right time to take a great picture.

Wired Remote Control for Digital Camera Dripping Circuit

 

Water Drops Controller

Write comment (0 Comments)

DIY Star Tracker

DIY Star Tracker

Please read Liability Disclaimer and License Agreement CAREFULLY

One of the new features of the new version of GVI DSR Camera Remote Control is the ability to track stars in the night sky, we need to know the Right Ascension and Declination of the star we want to track.

In order to do this in algorithm behind this feature is based on Sidereal Time Calculator (so the inputs are Julian Dates), to ease the ATMega 328 i have made some math before and i came up with values for Greenwich Apparent Sidereal Time (see GPS MT3329 page).

In order to store data like name, RA and DEC of the stars i added to this controller a 1Mbit 25LC1024 SPI memory from Microchip and the Arduino sketch to upload data is Load Stars To Memory.

This board will also be responsible for control of the mechanism and the AS5048A Rotary Sensor and will communicate directly with DSLR Camera Remote Control with Touch Shield Slide via Serial link.

DSLR Camera is connected using 3.5mm jack and is electrical isolated from the GVI Star Tracker by optocouplers.

The ATMega 328P is clocked at 24 MHz using ATMega328P - Burning bootloader

GVI Star tracket PCB Top View

GVI Star tracket PCB Bottom View

Write comment (0 Comments)

DSLR Ring Flash

DIY Ring Flash/Lamp for DSLR cameras

Please read Liability Disclaimer and License Agreement CAREFULLY

This is a DIY project of a ring flash/lamp to be used on DSLR cameras. It is powered by a 9V battery or

by a 9V external power supply. It is mounted on the lens using one adapter ring on 67mm (0.75mm pitch)

thread an the controller was inserted in to AGFA flash in order to be used in my camera hot shoe. I uses a 5V

regulator to be compatible with EOS 450D, so be aware of this if you want to build one for yourself.

I've attached the Ring Flash Schematic and Controller Ring Flash Schematic Revision 2.

As a side note i intend to get more magnification and in order to do it i will try the "Reverse Lens Mount"

with 67mm thread lens on body (70-200 f4 L IS and 100 f2.8 L IS) with 58mm thread (18-55 IS) and 52mm thread (50mm f1.8).

The adapter rings are Reverse Macro Ring Converter Ring 67 to 58 and Reverse Macro Ring Converter Ring 67 to 52.

PS: Here is the drawing for the Adapter Ring. Thread parameters are: D=67mm Pitch =0.75mm

The 3DXML file (download 3DXML Player)

{3DXML_Player|GVI_Ring_Flash.3dxml}

 

 LED Ring Flash + support

LED Ring Flash + Controller

Write comment (0 Comments)