Develop Navigation On Olinuxino A13

Started by chsy0823, March 07, 2013, 04:59:04 AM

Previous topic - Next topic

chsy0823

Hi i'm newbie android programmer in small company:DaeinTech and according to my company's upcoming project, i have to program into embedded devices.
I bought Olinuxino A13 WIFI board and I've tested the board following a documentation.
But i'm very new at embedded system and linux so i don't know what to do.

I have to make a program for upcoming product that 7 inch navigation which has radio, dmb, gps function.
First thing I have to do is constructing UI with android platform(with some buttons, images etc)
and i have to communicate with other IC and modules. But constructing UI is not a problem to me.
I'm pretty sure how to make the UI section but others not..
TO communicate with hardware devices or to change some system function, should I have to build the linux kernel? I don't know how...

Ex) i have to improve the booting speed and have to receive dmb data from dmb module and
when i made the UI application(ex UI.apk) with android, i should have to run UI.apk first of all when olinuxino a13 is booted.

Olinuxino A13 Wifi board has android OS which is loaded on Nand flash.
I can boot Debian Linux from SD card follow olinuxino wiki's instruction.(Debian only maybe)

Exclude UI function, how do i communicate Jave with other hardware devices?
I heard something that I have to build the kernel manually, linux porting, JNI,tcp/ip socket, kernel build SPI ...... but i don't know anything.
Please let me know first of all, what should i do?
I use Mac os , so my ubuntu linux is set on Parallels Desktop which is similar with virtual box.
And i already installed tool-chain, android sdk, adb eclipse.

Today, i tried to connect with board using ./adb shell but i failed.
But I realized that it is pointless to do anything before I know what to do, how to do.
Is it the first thing i should have to do? If not, what is first thing I have to do?
I want to step by step instruction or something specific explanation cuz I have little knowledge about linux and embedded system.
I'm state of a repose

I read every documentation on Olimex site but if there is anything for reference, plz tell me.
Help me guys!

JohnS

Almost everything you ask is not specific to this board.  There is a vast amount of info on the things you ask on the net, in books and so on so just go do some (well, a LOT of) studying and practice.

When you've done that you will see how to use this board and the already-posted threads here and elsewhere on the net are likely all you need.

But asking here before you learn the basic skills is not likely to get you far.

John

murerten

Hi,

The subject is huge so you have to solve one problem at a time. Just baby steps :)

I understand what you try to do. It is obviously not easy and you need patience. But here is some info:

What you want to do is very important? With that I mean what you need by software and hardware? You need a UI so android makes that happen. Also you can check android documents. You can look at the APIs if all you need is there. You can have an app start at boot for example and remove the unneeded apps that come with the standard olimex a13 android image. But if that is not enough you can build your android image(linux kernel + android system). You need a debian or ubuntu + 4 or 8 gb ram + 50gb storage to build it. These are explained on some subjects in this forum. You can search the forum by keywords from top right.

You said you want to communicate with a hardware device through android. What is the device? What interface does it have? Uart, ethernet, spi, i2c ? Does the device have linux driver? There are ways to make it happen. You can communicate with an ethernet or wifi device on android. There are APIs for that. But uart and spi or i2c needs java native interface (JNI). Or you can search for apps for doing that.

chsy0823

Quote from: JohnS on March 07, 2013, 09:40:52 AM
Almost everything you ask is not specific to this board.  There is a vast amount of info on the things you ask on the net, in books and so on so just go do some (well, a LOT of) studying and practice.

When you've done that you will see how to use this board and the already-posted threads here and elsewhere on the net are likely all you need.

But asking here before you learn the basic skills is not likely to get you far.

John

Yeah, I see. My question was not too specific. I didn't know what to do..
So  I'm looking for related books and data from net.
There are so helpful data , actually  not directly related to these subject but helpful to understand the entire system.
I should studying all of them and practice.
Thanks for your advice!

chsy0823

Quote from: murerten on March 07, 2013, 10:35:14 AM
Hi,

The subject is huge so you have to solve one problem at a time. Just baby steps :)

I understand what you try to do. It is obviously not easy and you need patience. But here is some info:

What you want to do is very important? With that I mean what you need by software and hardware? You need a UI so android makes that happen. Also you can check android documents. You can look at the APIs if all you need is there. You can have an app start at boot for example and remove the unneeded apps that come with the standard olimex a13 android image. But if that is not enough you can build your android image(linux kernel + android system). You need a debian or ubuntu + 4 or 8 gb ram + 50gb storage to build it. These are explained on some subjects in this forum. You can search the forum by keywords from top right.

You said you want to communicate with a hardware device through android. What is the device? What interface does it have? Uart, ethernet, spi, i2c ? Does the device have linux driver? There are ways to make it happen. You can communicate with an ethernet or wifi device on android. There are APIs for that. But uart and spi or i2c needs java native interface (JNI). Or you can search for apps for doing that.

Thank you for good info!
I know I should have to follow with step by step plan, but i didn't know what to do at first, so I've post questions anywhere to get some advices.

Right now, I'm trying to boot A13 using NFS with instruction. It is quite unfamiliar with me, but I like it and i want to accomplish it.
I found some information about JNI and Android NDK programming.
It seems not too easy but I'll make it done.  but Linux kernel .. I don't know.
Anyway, there are many good information about Linux kernel in this forum like you said and It seems you are expert at this! so..
if i stucked with kernel problem, i'll ask for it!

Can I ask one more question?
Q: You said I can communicate with devices or something using JNI.
With A13 board connected to computer, I wrote some code down in ECLIPSE and using jni, can I directly access to the A13's any modules?  Or should I edit some C/C++ code in A13's kernel too?

murerten

QuoteWith A13 board connected to computer, I wrote some code down in ECLIPSE and using jni, can I directly access to the A13's any modules?  Or should I edit some C/C++ code in A13's kernel too?

With java jni you can call your c or c++ code from java. You can think of this c code as a standard linux programming code. I mean you can do things that is possible with a standard linux. But there are restrictions. Android is a linux based os but it is designed to work on restricted hardware like phones or tablets. So you may not be able to find the c libraries you can find on Ubuntu for example. The libraries that are guarantied to be there is listed on android ndk document.

Besides libraries, you can communicate with the linux kernel, or hardware devices. For example UART or a USB RS-232 adapter. To communicate with uart in linux there is a standard api and the documentation is there, you do not have to change the linux kernel or write any driver. It's already there. But you have to write the c code to use it. For other devices you have to compile the linux driver (or module) if it is not already included on the standard image or copy the already compiled module file(.ko) and load it yourself. If it does not have a linux driver it may be hard to use it.

QuoteCan I directly access to the A13's any modules?

What do you mean by A13's modules exactly?

chsy0823

Quote from: murerten on March 07, 2013, 01:57:06 PM
With java jni you can call your c or c++ code from java. You can think of this c code as a standard linux programming code. I mean you can do things that is possible with a standard linux. But there are restrictions. Android is a linux based os but it is designed to work on restricted hardware like phones or tablets. So you may not be able to find the c libraries you can find on Ubuntu for example. The libraries that are guarantied to be there is listed on android ndk document.

Besides libraries, you can communicate with the linux kernel, or hardware devices. For example UART or a USB RS-232 adapter. To communicate with uart in linux there is a standard api and the documentation is there, you do not have to change the linux kernel or write any driver. It's already there. But you have to write the c code to use it. For other devices you have to compile the linux driver (or module) if it is not already included on the standard image or copy the already compiled module file(.ko) and load it yourself. If it does not have a linux driver it may be hard to use it.

Oh I see it. I  really feel relieved to heard that.
For the moment, I should not think about linux kernel.
First of all I should make UI interface and using jni and ndk, I should try to receive some data from GPS or DMB module etc.
But it seems to edit some kernel when I want to booting speed up or access android's system file(I don't know exactly just I think).

And you said I have to write C code to use it, but on this development, there is other C programmer who deals with MICOM(MCU).
He controls every input from touch screen, every modules.
Hardware expert will make another Olinuxino A13 board with MICOM(MCU) attached.

Principle is this : I(A13) just control the UI and send the command to the MICOM(SPI communication I think?) and MICOM control such modules and every data.

Ex) when device is booted, and UI appeared -> User click the Radio button -> A13 sends command to MICOM : "Radio button is pressed. Handle the Radio function" -> Then MICOM communicates with module and controls it. (This part I don't know exactly) ->
Data is scattered at display.

In this case, SPI communication will be needed I guess. To implement SPI, I must include the SPI device driver in the kernel and "make" the kernel image again.

But I'm curious how to use SPI on JAVA. Should I use JNI to use SPI?
That is my eventual purpose.

QuoteCan I directly access to the A13's any modules?

What do you mean by A13's modules exactly?
I mean, If DMB module is attached to A13, on JAVA platform using jni, ndk, can I receive the media data from DMB module and show  it on the display?

Sorry for too much question.. Too much to ask!
Cuz I'm not very good at English, some expression can be seemed to somewhat weird.
Plz, tell me If you cannot understand.
Always Thanks!

chsy0823

And I downloaded a13 SDK -a13.tar.gz(about 2GB) from WIKI, but I'm curious that where to use and how to use.

I was following some instructions about NFS booting and It required the board's kernel.

so I downloaded it but there is no zImage.

Is this file just example source code to apply to board?

I tried to find the documentation about, but I just found something strange text.


murerten

SPI interface driver for A13 cpu is already included in the standard olinuxino kernel. But I don't know how to use it. An example that may be helpful to you is here (Although it is for I2C interface):

http://olimex.wordpress.com/2012/10/24/a13-olinuxino-project-control-relays-and-read-adcs-and-ios-with-android/

And I don't know how to nfs boot, or is it even possible on android or this cpu :(