A20 bare metal programming developer resources

Started by KarlK, May 20, 2015, 08:46:29 AM

Previous topic - Next topic

KarlK

Hi,

I'm interested in running an own bare-metal application on an A20 board. Only thing that I found until now is the A20 (inofficial) TRM. So my question: are there some more resources available? Thingsl ike header files, example source codes showing how to use USB/UART/Ethernet/whatever, base code initialising the board and all peripherals?

Or does one have to do this from scratch?

Thanks!

jmyreen

Quote from: KarlK on May 20, 2015, 08:46:29 AM
So my question: are there some more resources available? Thingsl ike header files, example source codes showing how to use USB/UART/Ethernet/whatever, base code initialising the board and all peripherals?

Yes, the Linux kernel sources.

KarlK

Quote from: jmyreen on May 20, 2015, 09:08:22 AMYes, the Linux kernel sources.

When this is the only source for such information, then the answer must be "no".

Digging through hundreds ob MBytes Linxus sources that have hug cross dependencies to other subsystems is not what I would name "usable developer information".


JohnS

Did you look with google?  A quick search reports 27,100 items.

John

KarlK

Yes I did - but I could find only some discussions (most of them only use the term "bare metal" for some hints and without really dealking with this), no real developers resources like mentioned in my original question.

jmyreen

Quote from: KarlK on May 20, 2015, 09:32:01 AM
Quote from: jmyreen on May 20, 2015, 09:08:22 AMYes, the Linux kernel sources.

Digging through hundreds ob MBytes Linxus sources that have hug cross dependencies to other subsystems is not what I would name "usable developer information".

It's not that bad. Have you tried to look? The Linux kernel source tree is quite well organized, you definitely do not have to dig through hundreds of megabytes of source code. Also, we're talking about drivers here, and my opinion is that they tend to have relatively simple and understandable interfaces. You can also find documentation on these interfaces. For example, the book Linux Device Drivers (3rd ed) is freely available on the net (although it is a little outdated.)

It's not a small project you are embarking on here, rewriting drivers from scratch. Investing a little time to figure out how things fit together in the Linux kernel is definitely worth doing, IMO. It may give you some ideas how to structure your own code, because the drivers won't be living in isolation there either.

KarlK

OK, just to bring this Linux-source-discussion to an end: when talking about real "bare metal" programming, I think about a code size of less than 200 kBytes for the whole project (including TCP/IP stack, USB stack, FatFS, full access to all required hardware components like ETH-PHY, USB, SD-Card, UARTs, IRQs, GPIOs and own functionality).

When I have a look into the Linux USB-thingies only, the whole dependencies from top layer USB stack down to hardware drivers itself results in a code that is larger than these 200 kBytes. Stripping down this code to what is absolutely necessary and optimising it for this specific purpose and this speicifc platform would require the same efforts than writing it from scratch.

Linux sources are a nice piece of software, but the whole kernel is for a completely different target, it is not really suitable for an highly performant embedded software.

So that's why I'm asking for developers resources that are intended to be used for real bare metal programming. NXP provides such resources, TI does, many other manufacturers do that too - but I afraid these Chinese backyard-manufactorers like Allwinner are not able to provide such things. And that's the point why they are not used for industrial applications.

JohnS

It appears that you expect a lot (of support, software, etc) from the chip maker yet also want a very cheap high-volume chip.  That's not realistic.  BTW "backyard" is unjustifiable when you look at their market share!!

For what YOU want, go to one of the (much) more expensive chip makers.

It's all about choice, you've in effect chosen not to use AW.

John

KarlK

Providing developers information should be mandatory for all hardware vendors - how else should one create software for it? For the AllWinner controllers I only found one document, that is marked as preliminary and for "internal use only". Their support does not even respond on requests for information.

That all sounds like a really lousy backyard-company for me.

And yes, I know the guys adapting these CPUs for the Linux kernel have done a great job by probably reverse-engineering this controller, but that's nothing I have the time for. So when AllWinner is not interested in industrial usage of their microcontrollers, they are on a good path.

JohnS

I believe they provide support if you buy volume amounts (probably 50,000+ chips).

Your wishes really are not a fit with their market model.  You can change your wishes, change the chip volume or change chip maker.

John

gv

#10
KarlK,

You got more information or libraries to program the bare metal style?
I ask due to lack of available information on the Internet (think you also noticed).
I got just one example, but nothing functional.