A20 Android Building

Started by Gomler, May 19, 2014, 08:05:03 pm

Previous topic - Next topic

Gomler

Hi, I'm trying to build the android image for the A20 board with the 7"LCD display. I got it to build and load it but does not seam to boot up right. I have a few questions if someone could help me on I would be grateful.

1.Can someone share an image of the build for SD card with Power_Start=1 option.

2.Links to the source that was used to build the image. (to make sure I have the correct versions)

3.The sys_config.fex file that works for the 7" olimex touch screen.

4.How long should it take for the first boot to complete.

Any help would be appreciated.

Thanks

dave-at-axon

Trying to build from the Olimex source is not going to give you something that looks the same as the images they supply on the website. There is stuff missing and it's not the same source.

I have a custom build and you can get the last one I uploaded here. It has some custom GPIO in the init.rc but you will see this.

I'll be updating this in the next few days as I know have a working RIL that supports SMS, USSD and GPRS. The Olimex supplied RIL does not do SMS or USSD.

My source includes touch drivers for both CAPACITIVE and RESISTIVE screens. Both are 7" but other displays can be used with changes to the FEX files.

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

This also has the POWER_START=1 as without this the board won't power up with the battery connected and then apply external power.

Gomler

Thanks Dave for posting your source code. I will try and build it in the next couple of days. Where is the init.rc file located? Also do I have to have a battery connected to use the power_start option? How long did the first boot up take you, I don't want to shut it down before it is finished.

Again thanks very much for your time and efforts

dave-at-axon

Hi there, the initial boot takes a little longer due to Android formatting and expanding all of the APK files.

If you have a serial debug cable, you'll see the debug output. After it appears to stop, type in LOGCAT and hit return and you will then see all of the Android debug output so you can see what it is doing.

The init.sun7i.rc is the one. Sorry. It's located in the devices directory and look for the OlimexA20 drilled down inside that.

I'll be uploading the latest release at the weekend. It takes a few hours as the files are GB's.

dave-at-axon

Sorry forgot the bit about the battery. It will boot with or without it. With it plugged in the board will only power up if you press the POWER button. With it off and the battery plugged in, applying external power will cause the board to power up without the need to press the power button.


deskwizard

Hi Dave,

I just registered to thank you for the work you are putting into this.
I didn't have achance to get myself a board yet, but I am sure your hard work will come in handy when I do.
Looking forward to the new upload this weekend.

My first challenge will be getting a UART GPS to work on android, I found a couple interesting links which may help, but I'm lacking the memory, experience and money to get it done at the moment.
If I ever get it done, I will contact you with the changes I make so everyone can profit.

Thanks once more,
DW

dave-at-axon

Thanks DW,

I haven't tried but as I have no need for GPS with my design but it should integrate into the system with only a little work  as both the kernel and Android have support for it. A UART based device with NMEA output should work although I have seen some people use USB devices too.

If I get time, I'll dig into the code and see what's needed to support it.

Gomler

I have a couple more questions if you don't mind.

1. What other debug commands are there? eg. LOGCAT Or where i can find out.

2. Do I need to edit the init.sun7i.rc file for resistive touch screen? Such as uncomment the line
   insmod /system/vendor/modules/sunxi-ts.ko

3. How are the multiple USB ports accessed in a android application.

4. Where did you learn how to make android drivers and figure out all of this.

Any help at all is highly appreciated even if is just links to where I should be looking. By the way I loaded your image in my A20 and it works except for the touch screen, which I knew wouldn't work because I have a resistive TS. Again thanks for your help!!!

deskwizard

May 21, 2014, 11:44:59 pm #8 Last Edit: May 21, 2014, 11:50:59 pm by deskwizard
Quote from: dave-at-axon on May 21, 2014, 04:25:07 pm

A UART based device with NMEA output should work although I have seen some people use USB devices too.



Sounds about right with the bit of research I did, I played around this on another SoC a while back, but my memory sucks... As far as I know the USB GPS are just UART ones with a serial-usb bridge inside, PL2003 IIRC is the most common. I have both "on hand" (ie. somewhere around my place hehe), as well as a couple of USB WiFi adapters and bluetooth (separate devices) I need to look into.

Good news is I managed to compile the android sources from olimex, so at least my build environnement "seems" alright for once.

For the GPS as far as I know there is a prop to change to set the port and speed, and there were XML files for data if I am not mistaken, I will see if I still have the work I've done with the POS amlogic if I didn't get mad and deleted all of it.

Quote from: Gomler on May 21, 2014, 10:58:35 pm

3. How are the multiple USB ports accessed in a android application.


There is a Serial Port API demo in the play store, used it a couple times for testing
Or check out the tools from Olimex as a starting point :
https://www.olimex.com/forum/index.php?topic=1958.0

For the touchscreen, I recall there is some information regarding that in the same blog linked on the olimex wiki for android compilation, http://axonjakarta.wordpress.com/

dave-at-axon

Quote from: Gomler on May 21, 2014, 10:58:35 pm
I have a couple more questions if you don't mind.

1. What other debug commands are there? eg. LOGCAT Or where i can find out.


You'd be amazed at what Google can find  :P

http://developer.android.com/tools/help/logcat.html

Quote
2. Do I need to edit the init.sun7i.rc file for resistive touch screen? Such as uncomment the line
   insmod /system/vendor/modules/sunxi-ts.ko


Yes. I'll see if I can document what is need to change to RTP but remember to also change the setting in the FEX file. You can actually leave in the CTP as it will do a search on the I2C bus and fail and then your RTP will be the default.

Quote
3. How are the multiple USB ports accessed in a android application.


I suppose you mean USB-UART types? I've not used them as there is enough built in UART's to meet my needs and I can keep the USB free for GPRS and WiFi.

Quote
4. Where did you learn how to make android drivers and figure out all of this.


Just by reading existing source and looking around the internet. I also found a good book about Android OS Development that helped with some stuff but most of the work was done through searching and reading code.

Quote
Any help at all is highly appreciated even if is just links to where I should be looking. By the way I loaded your image in my A20 and it works except for the touch screen, which I knew wouldn't work because I have a resistive TS. Again thanks for your help!!!


Once you enable this in the FEX and in the init.sun7i.rc file it will work. I used the resistive panels when I first got my A20's. I've 2 of them now gathering dust :)


PS.. The latest source with the working Huawei Generic RIL (PPP actually now works) will be going up on Friday night so it should be ready for use over the weekend. Keep a note of the changes you make as you will have to do the same to the new source :)

deskwizard

Awesome for the sources Dave, looking forward to it !

Gomler:

For the USB serial ports, you will need a kernel with the required modules (or them built into the kernel).
I don't remember from the top of my head if they are or not with the default kernel config.

You can list the USB devices using the lsusb command.

IIRC (I'm going from memory) the USB uart will show up as /dev/ttyUSBx (x being a number)

dave-at-axon

New source going up starting tonight.

It's around 4GB so make take a good few hours until the new files appear.

I'll post on here once the update is done.

dave-at-axon

Upload is done.

Any issues post them here or on the blog.

https://axonjakarta.wordpress.com


deskwizard

Hi Dave,

Comments posted on your blog ;)

I cannot extract your archives for some reason, tar is giving me errors about file already existing in both archives.

If I can suggest something, perhaps running 'make clean' and removing your packaged image would help make a smaller upload file size.

dave-at-axon

Hi, I saw this and looking at the issue. Is this with both packages or just the Android one?

I did run MAKE CLEAN and then removed the OUT directory and all images. I'll try it again tonight.