After quite lot of research through various online document and article and working with many different things, i have finally managed to get my first Linux capable ARM Cortex-A8 board up and running. making the board i hae faced many different kind of difficulties with different section. the board is Based to a ARM Cortex-A8 CPU running at 1Ghz which is really quite lot for homemade hand assembled stuff. i will take you with me on a journey how you can approach to come up with your custom linux board.
it is going to be some what descriptive tutorial with almost every aspect covered. so i have divided the whole things into parts. next part follows the previous.
Why you need Linux Board?
Requirement Definition, first of all you need to determine what are your requirement and is this possible to fulfil them with some high speed microcontroller with on chip RAM etc. or we need some high speed processor ? As going for very high speed processor may often lead to have a large amount of extra hardware like you may need many power rails , external RAM,external Flash/ROM etc. which ultimately goes with expensive development and expensive final product.
for this particular demo we will consider to develop a Digital Photoframe with cloud connectivity over wifi, so will need minimum a LCD screen and WiFi module , USB host , some user interface. everthing else on board is just to support these requirements.
to get LCD we need a processor/microcontroller with LCD driving capability, as it is digital photoframe application , we need a large lcd may be 7 -10 ich , LCD which falls in this size does not have much intelligence built in to them they need constant refresh by the controller , they don’t even have any memory. so you need a processor with LCD controller built in , trust me you don’t want to drive such large lcd on software, ofcourse you have dedicated controller IC which can do all the refresh and framebuffer memory stuff. but those chips them self has a some cost attached to them and there are few more disadvantages associated with our application we will cover them all in few minutes.
now the except LCD our processor should have some interface to handle WiFi, Wifi moudles are gernally connected to processor with one of these interfaces, SPI, SDIO(4bit SPI) , parallel , USB or UART. UART modules are most cheap and easy to handle but they have very very low bandwidth due to limitation of UART.
we can use SPI , SDIO or USB wifi module.
processor with USB host, we need to have USB host, sot that user can connect there USB drive or USB hard drive fill with image and videos to our product.
we want to provide touch screen interface to the system for ease of use. it can be achived with touch screen controller IC may resistive or capacitive , although it is little complicated to use capacitive touch screen controller , they may come with there own proprietary firmware and many other settings. but usually if you want to go capacitive touch you go with some third party controller solution. few processor may have resistive touch controller built in but not many.
we have got some picture of our required hardware but in choosing a processor , the most deciding factor is , what data you are going to process and at what rate? the speed of processor will be decided by the software we need to run , as we are dealing with multimedia , we need some power .
now comes the software which will talk to all of the hardware and the internet to download images from the cloud. one way is to go and write everything own your own, but lets see what u will need , LCD driver, wifi module driver , USB host dirver, Filesystem for USB, TCP/IP stack, and custom application to control all of this and user interface , trust me u will give it up after writing TCP /IP thing itself .
but we can get many module ready made from the opensource community , TCP/IP stack , filesystem , and may be somewhat working low level driver for reset of the hardware also . but ultimately you need to write you own application from the scratch to interact with internet , USB , LCD and userinterface,
you are going to need lots of code to decode many different format of the image and videos and render them to LCD . a lots of code to handle secure TCP/IP communication with the could , as most of them will have very sophisticated security , you need to make your application compatible to that which is itself a tedious task . again you need to write lots of code. and to handle user interface with touch or buttons and putting the correct info onto LCD will also need more work.
so solution to all the software needs is , to use as maximum as possible already available library of network , wifi ,LCD , Could connectivity and User interface.In opensource word most of library available are meant to be used to linux like system. we may need opt to use Linux only.
but running linux need really special hardware , which is somewhat costly. we can still try to port all of these library to our custom environment ,but it need lots of work just to save few bucks, trust me porting Linux thing into small processor is not a good idea.
Linux provide already written drivers, file system, networking support ,support of USB host and various library to handle everything including user interface.
I see Linux is the Way to go
Hardware to Support Linux
the first basic need to run linux is , some amount of RAM with MMU. it not a good idea to select a random processor and try to port linux on.
we need some already supported processor with decent latest version of Linux available. and some community support will also do.
the first issue you will face in choosing right processor is the package , almost all somewhat latest processor which support Linux comes in Large BGA (>200 balls)package. and doing BGA on low Cost at Homemade stuff is somewhat pain.
Large BGA require specific soldering equipment , you need some sort of oven for large BGA. hotair will not work very well for BGA larger than 200 balls .
and BGA witch pich less than 0.8mm require PCB with very fine pich.
common low cost PCB specs are like 5mil trace / 5mil clearance , 10mil drill 4 mil annular ring. if you are going more finer that this you may need to pay lots of amount of money.
to fanout large BGA we need to place via between the pads, for that we need as low as possible clearance , minimum drill , as low as possible annular ring. minimum 4 Layers are kind of must of small BGA , you really don’t want to do less that 4 layers, 6 Layers or more is recommended for large BGA .otherwise there will be lots of issue with fanout and power rails.
but i want to whole process at minimum cost and all at my Home.
so i need to leave BGA behind for the processor and consider some large TQFP or QFN package for processor,
but there are handful of modern processor available in TQFP package which run linux, so we have to chose from them ,
one very common choice is freescale iMX233, which available in TQFP128 Package ,ARM9 running at 400 Mhz , has LCD, audio, USB Host, everything we need.
or we can go for Allwinner A13 processor , it is in TQFP Package , ARM Cortex-A8 running 1Ghz, has LCD with Mali 400 GPU, has one USB device and USB host, support two SDcard or NAND flash, support upto 512MB DDR2 or DDR3 ram.
for some reason i am looking for faster processor with more of everything so i chose Allwinner A13 , as it is only learning project we really don’t care much about how the processor is available for sale etc. i have experimented with Allwinner A20 processor before ,i found them to be stable and easy to use, sunxi linux repo on github has very stable linux 3.4 branch , and underdevelopment linux 3.10 branch.
sunxi linux 3.4 brach support most of the stuff including GPU which is nice .
Getting hand on the CPU.
as allwinner deals mostly in consumer electronics stuff. they do not attend any individuals at all . so we need to source our processor some china some where may be ebay or aliexpress.
i have ordered 5PCs of the chip from aliexpress, arrive very fine packaging and completely unused new chip. everything is fine.
so now we have our processor , we need to repair a schematic of the board.
it is going to be large tutorial so i have distribute in parts . next part follows with name