Leave a comment  →
' . get_the_title() . '

USB OTG port on Allwinner SoC based boards is a very useful tool. It can be used to flash an image to the flash memory or connect to a Host PC and making the board to act as a device.

Although there are many scenarios where USB OTG is useful, at times it is more useful to have an extra USB HOST on the board. All the settings of hardware configurations of allwinner SoCs are stored in a file named ` script.bin` that is compiled from a text file called fex file.We can learn more about the fex file from Sunxi Wiki in the Fex Guide.

A FEX file defines various aspects of how the SoC works. It configures the GPIO pins and sets up DRAM, Display, etc parameters.

Each line consists of a key = value pair combination under a [sectionheader]. All three, [sectionheader], key and value are case-sensitive. For comments a semi-colon (;) is used and everything following a semi-colon is ignored. The chip does not parse a textual version of a fex file, it gets cleaned and compiled by a fex-compiler. A reverse engineerd open source version exists in the sunxi-tools repository. Also a de-compiler which takes a binary script.bin and creates a textual script.fex. Usually, script.bin can be found on the nanda boot partition on A10 devices.

Changing script.bin file without removing the microSD card

The tools for script.bin changing are located in /opt/sunxi-tools directory:

  # cd /opt/sunxi-tools
  # ./chscr.sh

This will convert script.bin file from sdcard to script.fex file and the file will be opened using nano editor. Now you can change the board modules and parameters, save the changes (“CTRL”+”X”; confirm with “Y”) and exit (“CTRL”+”X” again) from nano editor.

  # ./wrscr.sh

this will convert script.fex to script.bin and the script.bin file will be written to sdcard.


Reboot the board and the new settings would be enabled.

Changing script.bin file by removing the microSD card

The biggest part of the board configuration might be edited, changed or improved in a file called script.bin

The script.bin file can usually be found in the main directory of a microSD card prepared with official Debian image. The folder containing the script can be inspected under both Windows, Linux or Mac.

You can’t directly edit binary file so you would need to convert it to text format (it is called fex in this case), then edit the parameters via a text editor and finally switch it back to binary format.


To convert back and forth the script.bin you might use different tools. You can find Windows tools here: SUNXI TOOLS FOR WINDOWS . For Linux convertors please check the sunxi tools here: SUNXI TOOLS

Editing Fex File for USB OTG

Now open the Fex file and locate the USB section.

;[usbc0]:  The configuration of controller 0 
;usb_used: Enable bit. If USB is enabled or not. 1: enable; 0: disable. 
;usb_port_type: Type of USB port. 0:device only;1:host only;2:OTG 
;usb_detect_type: Detect type. 0: Not detect; 1: detect vbus/id; 2: Detect id/dpdm

usb_used = 1 
usb_port_type = 0 
usb_detect_type = 0 
usb_id_gpio = port:PH04<0><1><default><default> 
usb_det_vbus_gpio = “axp_ctrl” 
usb_drv_vbus_gpio = port:PB09<1><0><default><0> 
;usb_restrict_gpio = port:PH00<1><0><default><0> 
usb_host_init_state = 0 
usb_restric_flag = 0 
usb_restric_voltage = 3550000 
usb_restric_capacity= 5

We just need to change usb_port_type from 0 to 1 to make it a USB host.

Converting fex to script.bin:

The following commands are executed at sunxi-tools directory:

$./fex2bin script.fex >script.bin
$sudo cp script.bin /boot/script.bin
$sudo umount /boot
Now restart the board and you can use USB OTG as USB host.

Leave a comment  →

The Allwinner A10 is a family of single-core SoC devices designed by Allwinner Technology from Zhuhai, China. Currently the family consists of the A10, A13, A10s and A12. The SoCs incorporate the ARM Cortex-A8 as their main processor and the Mali 400 as the GPU.

The Allwinner A10 is known for its ability to boot Linux distributions such as Debian, Ubuntu, Fedora, and other ARM architecture-capable distributions from an SD card, in addition to the Android OS usually installed on the flash memory of the device.

Here I am sharing the footprint for Allwinner A10 Soc chip taken from Olimex design.



   by Dost Muhammad Shah    3 Comments  →
' . get_the_title() . '

In this post I am writing how to send a GET request using GSM Module with AT commands. It should work with any module and has been tested to work with Sim800 series  (SIM800C-DS , SIM800ASIM800H, SIM800L, SIM800C, SIM800 etc) and Sim900 series (SIM900, SIM900A, SIM900D, SIM900B) of modules from simcom.

You have to bring up GPRS connection before this obviously , which is not covered here in this post.



Initiate the HTTP service

> OK

Set the HTTP session.

> OK

Set the HTPP URL


Start the session<

> OK

> +HTTPACTION:0,601,0

The above AT response code (601) for HTTP session start indicates that there is a network error. Then make sure that the PDP context is setup properly.

IF the HTTP session is successful, it should return code of ’200′,

> OK
> +HTTPACTION:0,200,4

Above HTTP GET request is sucessful and it returned 4 bytes.
To read the data of the HTTP server,

> test
> OK

To terminate the HTTP service,

> OK

Leave a comment  →
' . get_the_title() . '

This is awesome. The only thing I miss is the LAN interface but at $5 its still amazing. It has Broadcom BCM2835 processor and that also 40% faster than the pi 1 with 512 MB of Ram.

Today, I’m pleased to be able to announce the immediate availability of Raspberry Pi Zero, made in Wales and priced at just $5. Zero is a full-fledged member of the Raspberry Pi family, featuring:

  • A Broadcom BCM2835 application processor
    • 1GHz ARM11 core (40% faster than Raspberry Pi 1)
  • 512MB of LPDDR2 SDRAM
  • A micro-SD card slot
  • A mini-HDMI socket for 1080p60 video output
  • Micro-USB sockets for data and power
  • An unpopulated 40-pin GPIO header
    • Identical pinout to Model A+/B+/2B
  • An unpopulated composite video header
  • Our smallest ever form factor, at 65mm x 30mm x 5mm

Raspberry Pi Zero runs Raspbian and all your favourite applications, including Scratch, Minecraft and Sonic Pi.

RaspberryPi BLOG

DIY Bluetooth Speaker!

Leave a comment  →

After weeks of waiting, the parts I needed for a homemade Bluetooth speaker arrived. Pictured above are the PAM8403 amplifier board, Bluetooth module (USB powered with a 3.5mm audio jack), and a couple of 3-watt speakers. The power supply is a 5V 2A power supply I had laying around. All of the project materials amounts […]