PPP now working with existing RIL and Huawei Generic RIL

I’ve finally gotten PPP to work. I had missed out the chat driver that handles the PPP connection. In fact, I had removed this thinking it was a chat type app like WhatsApp. Ooops.

Anyway, for those with the existing code from the download, here is the change you need to do.

Locate this file:

android4.2/device/softwinner/wing-common/ProductCommon.mk

And add the following line to the second PRODUCT_PACKES += entry.

chat \

This will make sure that chat is used.

It also works with the existing softwinnder RIL and the Huawei RIL.

I also got SMS to partially work. It seems to work sending the first time then nothing after this. Same with receive, so I am still working on this part. You need to locate the AT+CNMI line in the source or in the libsoftwinner-lib.so file with a hex editor and change this to 1,2,0,0,0 to get it working the same as I have. The existing setting is set not to pass through SMS to the module.

I’ll document later when I get SMS working and I will be updating the source code on the Google Drive with the fully working version soon.

By Dave McLaughlin

Source Code for Build is now available

I have put on Google Drive the source for the build. It has a few specials so you’ll need to do some little changes to meet your own needs but if you have a 7″ LCD then this will build and work straight off on the A20.

I’ll try to document what you need to do below any changes as I go along.

https://drive.google.com/folderview?id=0BwKBcHR31e97ZWtTV2p3SWhhMmM&usp=sharing

I have included a rather nice BootAnimation that is set for 800 x 480 display.

3G Library

The 3G library from Softwinner does not handle SMS for some reason. the CNMI command found in the binary file is set to now send any unsolicited SMS message and there is no CMGL command to request them so it appears that the library is for PPP only. It does send SMS.

I started to try and port the HuaweiGenericRil.lib to the platform but so far still no SMS receive. It’s a work in progress.

To enable and disable to 2 libraries, navigate to the android4.2/device/softwinner/olinuxino-a20 directory and in there you will find a system.prop file. Open this and edit the following lines but changing the comment marker to the library you don’t want to use.

rild.libpath=/system/lib/libhuaweigeneric-ril.so
#rild.libpath=/system/lib/libsoftwinner-ril.so

For example, I have it for the Huawei library as supplied.

Everything else should give you a working Android platform and if you have any feedback of questions, then please feel free to post a comment about it.

Reflashing the Image

When you reflash the image to the SD or NAND (I use SD for now until development is completed) choose the NO option in Phoenixsuit and then your exisitng configuration and data is untouched.

By Dave McLaughlin

Olimex A20 Android Building

(UPDATE) Feb 13th. Found out why it won’t run. See at the bottom for the fix.

Using this information you can have a trouble free build of the source but sadly, the built image does not run on my board so I have documented this here in the hopes that others can get the build to complete and then we are in a position to sort out why it does not run.

At the present time (12th Feb 2014) the build still does run but I am hoping that by posting this up someone will figure out why this does not work.

To get started, you will need a Linux Ubuntu (Google recommended) system to build the source. If you are already running Ubuntu, then you are ready to get started. I’ve built this using Ubuntu 12.04 but other versions should work too, they’ve just not been tested. Google has kindly documented the installation requirements for the build environment, so use this link to make sure your system is setup correctly.

Google Setup Instructions

Once you have done this, go and grab the source from Olimex here.

Android 4.2 and Linux 3.4

Create a directory on your system to extract the source to. I created an android directory and then inside that an olimex-a20 directory. From your home directory, do the following from a terminal window.

mkrdir android
cd android
mkdir olimex-a20

Copy the source files you downloaded into this directory and then use tar to extract them.

tar zxvf android4.2.tar.gz
tar zxvf lichee-v2.0.tar.gz

You should now have both the Linux kernel source and the Android source now on your machine. You are almost ready to build them but I included 1 more step and that was to setup the cross compiler that comes with the source. Assuming you used the same directory names I showed above, you now need to add the PATH to the cross compiler to your .bashrc file. Edit the file and add the following to it. These lines assume you used the directory names above.

PATH=$PATH:$HOME/android/olimex-a20/android4.2/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6/bin
PATH=$PATH:$HOME/android/olimex-a20/android4.2/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.6/

Now we are ready to build the kernel. This will take a little while depending on your computers speed so be patient.

cd lichee
./build.sh -psun7i_android

Once this completes, you will have the Linux kernel and now is time to build Android. If you build as per the Olimex instructions, the system will fail due to a setting for SATA. SATA is not currently supported in Android so I simply commented out the lines for this. Locate the following file and open it for editing.

android4.2/device/softwinner/olinuxino-a20/overlay/base/core/res/res/xml/storage_list.xml

And comment out or delete the SATA entry at the bottom. You can now build without errors.

<!-- 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" / -->

The extract-bsp lines copies the kernel image for when you run pack later. If after you run lunch and you don’t see the olinuxino-a20_eng option (should be option 15) then simply run the source build.envsetup.sh file again. I found that I needed to run this twice for it to appear.

cd ../android4.2
cd device/softwinner/
tar zxfv olinuxino-a20.tgz
cd ../../
source build/envsetup.sh
lunch      #select olinuxino-a20_eng
extract-bsp
make -j4

This will take quite a while and in my case about 5 hours so grab a coffee and relax for a bit. Once this is complete, you now need to pack the image. This is where the Olimex source build instructions will fail because the configuration directory and settings are missing and may explain why the final image fails to run on my system. So, to get this to work we need to create a directory called olinuxino-a20 in this location (Linux source directory)

cd ~/android/lichee/tools/pack/chips/sun7i/configs/android
mkdir olinuxin-a20

Once you do this, download the following files and extract them into this directory.

System Configuration Files

I’ve built these files based on what I could find on a number of Google Searches and comparing the converted script.bin file in the original Olimex image. If anyone sees and error in these or have the correct files, please post a comment about it.

There is a couple of lines in the sys_config.fex file you might want to change depending on your needs. Another user on the Olimex forum and I have identified that to get the unit to boot on applying power, you need to change the following line in the [target] settings. Setting this value to 0 causes the unit to power up and go to standby mode if you have a battery connected. You then need to press the power button to get it to start. If you set this to 1, the system will boot up on applying DC power even if the battery is connected and the unit was powered down through the power switch or via software.

power_start = 1

The other change is to tell Phoenixsuit where to write the image to. This is 0 for NAND and 1 for SDCARD. I use SDCARD for testing images and once I get a working image, I change this to 0 and run pack again. No need to rebuild the source.

storage_type = 1

Now just run pack and it should generate the output image. It will be shown in RED the location of this file. Now use Phoenixsuit to load this to your board.

Hopefully this will get you building the source code and at this present time, I am unable to get it past the following error. If you have the serial debug you will most likely see a number of untracked PID exits in the output if the system has the same failure as myself. If you type LOGCAT into the debug you will get more detailed debugging information but start a capture before you do this as the output generates a lot of information. Below is a partial dumb of the information I am seeing.

I/SurfaceFlinger( 1944): GraphicBufferAlloc::createGraphicBuffer 
W/SurfaceFlinger( 1944): hw_get display module Failed!
D/SurfaceFlinger( 1944): display dispatcher enabled
W/SurfaceFlinger( 1944): wifidisplay dispatcher disable
I/SurfaceFlinger( 1944): GraphicBufferAlloc::createGraphicBuffer 
I/SurfaceFlinger( 1944): EGL informations:
I/SurfaceFlinger( 1944): vendor : Android
I/SurfaceFlinger( 1944): version : 1.4 Android META-EGL
I/SurfaceFlinger( 1944): extensions: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_EXT_create_context_robustness EGL_ANDROID_image_native_buffer 
I/SurfaceFlinger( 1944): Client API: OpenGL_ES
I/SurfaceFlinger( 1944): EGLSurface: 8-8-8-8, config=0x60000014
I/SurfaceFlinger( 1944): OpenGL ES informations:
I/SurfaceFlinger( 1944): vendor : ARM
I/SurfaceFlinger( 1944): renderer : Mali-400 MP
I/SurfaceFlinger( 1944): version : OpenGL ES-CM 1.1
I/SurfaceFlinger( 1944): extensions: GL_EXT_debug_marker GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_size_array GL_OES_point_sprite GL_OES_texture_npot GL_OES_query_matrix GL_OES_matrix_palette GL_OES_extended_matrix_palette GL_OES_compressed_ETC1_RGB8_texture GL_OES_EGL_image GL_OES_draw_texture GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_OES_framebuffer_object GL_OES_stencil8 GL_OES_depth24 GL_ARM_rgba8 GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_OES_texture_cube_map GL_EXT_discard_framebuffer GL_EXT_robustness GL_OES_depth_texture_cube_map 
I/SurfaceFlinger( 1944): GL_MAX_TEXTURE_SIZE = 4096
I/SurfaceFlinger( 1944): GL_MAX_VIEWPORT_DIMS = 4096 x 4096
D/SurfaceFlinger( 1944): Screen acquired, type=0 flinger=0x411eb370
D/SurfaceComposerClient( 1468): ComposerService reconnected
F/libc ( 1468): Fatal signal 11 (SIGSEGV) at 0x00000010 (code=1), thread 1954 (BootAnimation)
I/AwesomePlayer( 1147): setDataSource_l(URL suppressed)
I/ServiceManager( 1147): Waiting for service window...
F/libc ( 1944): Fatal signal 11 (SIGSEGV) at 0x00000084 (code=1), thread 1945 (SurfaceFlinger)
I/DEBUG ( 1142): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 1142): Build fingerprint: 'softwinners/olinuxino_a20/olinuxino-a20:4.2.2/JDQ39/20140211:eng/test-keys'
I/DEBUG ( 1142): Revision: '0'
I/DEBUG ( 1142): pid: 1468, tid: 1954, name: BootAnimation >>> /system/bin/bootanimation <<<
I/DEBUG ( 1142): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000010

If you have success, please post a comment.

(UPDATE Feb 13th 2014) 
I have found out why it won’t run. The display.sun7i.so file is missing and not included. It seems to be a conditional flag issue and I have gotten around this by removing the check.

Locate this file

/android4.2/device/softwinner/wing_common/Android.mk

and edit the 2 lines below to add the # to them (comment out the lines)

#ifneq ($(filter wing%,$(TARGET_DEVICE)),)
include $(call all-makefiles-under,$(LOCAL_PATH))
#endif

Save the file and now run make-j4 and pack to create the image for NAND or SD as above. It should now work albiet in Chinese and on my unit, the LCD keeps going on and off.

Somehow this is not the actual build configuration that Olimex claims it to be for the images on their website but at least we now have a partially working system to start creating customs builds with. I’ll update the blog entry and I find out more.