The pdDuino3 from Linksprite is an “Open Source” arm developer board. Open source here being used lightly. The linux system is open of course as per its license. So is its u-boot code. The end goal is to get the NuttX RTOS ported to the pcDuino3. The first step of course is to get the system booting without any form of an operating system. The first step is to get it booting in what is known as a bare metal system.
The first step in this system is to get u-boot working. This was quite simple. I followed the linux-sunxi directions and made a bootable SD card. The old or the mainline u-boot works just fine.
Bare metal code
Alright, so we have a working u-boot booting. A bunch of research finally led me to the olimex bare metal programming of the A13 tutorial page. But there’s a problem, I’m not using the A13! Luckily, the Allwinner chips use the same memory map. So the GPIO code at the end can be run without issue. I am using Fedora instead of Ubuntu. Here is my Makefile.
Working with peripherals
In the olimex article it mentions that GPIO only works when printf is used. Using compiler directives I was able to get this working without the need for printf being used. What this code does is walk LEDs down a line. You can check the pinout of the pcDuino for the correct pin bank and pin number.
Getting higher level peripherals working
So getting GPIOs working was pretty easy! In the next section I’ll discuss the woes on getting higher level peripherals running.