On Saturday, October 19, 2013 7:59:24 AM UTC-6, Satz Klauer wrote:
>
> Hi,
>
> I plan to do some bare-metal programming with the BBB (mainly for personal 
> reasons and to play with hard realtime environments, so please do not try 
> to soften me up to use Linux ;-)
>
> As a first task and to get a feeling for the hardware I'd try to access 
> the LEDs (configure the GPIOs they are connected with as digital output and 
> write 0/1 to them).
>
> My question: is there a getting-started-guide for this?
>
> Or to go more in detail:
>
> - I already found the CPU manual at TI's pages
> - I found a compiler arm-none-eabi-gcc - is it the correct one?
> - I still need header files where register addresses for the CPU are 
> predefined
> - I still need a description how to download my created binaries to the 
> board so that they are started immediately (instead of the Linux-Distro)
>
> Any Ideas where I can find these things?
>
> Thanks!
>

I won't try to talk you into using Linux for this adventure, but I will try 
to talk you into using a simpler ARM platform.  You should try something 
like a TI Launchpad with a Cortex-M class processor; not only will the TRM 
for the platform be much more reasonably-sized, but the M architecture is 
actually much nicer for bare-metal programming, especially if you are using 
C!  It's also a much better platform for real-time work; sometimes the 
pipelining and other tricks that the A-series CPUs use to increase 
throughput comes at a cost of non-deterministic execution times, which are 
the enemy of real-time programming with hard deadlines.

In either case, from TI you'll want the platform's Technical Reference 
Manual and Datasheet.  The TRM generally has in-depth descriptions of the 
registers and programming models of all the peripherals that users are 
expected to use, while the Datasheet will generally have an overview of the 
functionality provided, the memory mapping of the register banks for the 
peripherals, and pin-out information for interfacing with the chip.  On top 
of that, you'll want several manuals from ARM.  You'll want the ARMv7 
Architecture Reference Manual (there's one version for A and R series, and 
another for M series-- BBB has an A series core) as well as the more 
specific Cortex A Series Programming Guide (or the M Programming Guide if 
you go with an M-class CPU instead of the BBB) and the Cortex A8 (or Cortex 
M3/M4) Technical Reference Manual, which together tell you everything you 
might want to know about the CPU itself, at least outside of the minor 
modifications and implementation choices TI made when putting it in the 
BBB's SoC.  There are various other useful documents in ARM's library; a 
handy one for low-level stuff is "Procedure Call Standard for the ARM 
Architecture" which shows you what assembly instructions constitute a 
procedure call that can be used to call into compiled libraries.

For a look at what bare metal programming on an M-series (such as the $14 
Tiva C Launchpad from TI) board looks like, here are some slides from a 
guy's tutorial presentation along with a handout pdf that's very 
informative: http://www.bravegnu.org/blog/gnu-eprog-slides.html

I was able to get that toolchain working and run a couple of basic programs 
in an emulated (via qemu) ARM M3 platform.  Really, a microcontroller is 
the biggest thing you'd *really* want to write all the code for as a 
hobbyist.  Digging through TRM details and RAM datasheets to figure out the 
correct timing parameters to program into your SDRAM controller is really 
not a lot of fun, and you'll never have the time to get a fraction of the 
BBB's peripherals up and running without taking advantage of a LOT of 
pre-written code.  Microcontrollers, on the other hand, are all about 
bare-metal code and just the functionality you need for the job you're 
doing.  A Tiva Launchpad would be a great board to experiment with bare 
metal programming, basic motor control and sensor reading, etc.  It'd make 
a nice little robot brain, or even just a nice little platform to 
experiment with developing a bare-bones RTOS.  If you skim through the 
A-series and M-series references, I think you'll agree you'd much rather be 
doing bare-metal programming on the latter. 
 

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to