GSOC 2015: Porting MicroMonitor to the Beaglebone Black

Ed Sutter ed.sutter at alcatel-lucent.com
Thu Mar 26 18:21:33 UTC 2015


Right...
I'm catching up on this CPU, I've done a bit more of this on the iMX6, 
but it appears
to be quite similar...

Referring to the schematic here:
https://github.com/CircuitCo/BeagleBone-Black/blob/master/BBB_SCH.pdf?raw=true

When the CPU first starts out of a cold reset, it will execute code that 
is internal
to the Sitara chip, totally independent of what memory devices are tied 
to it.
It will initially look at some of its GPIO pins (configured via pullups 
on pg 6) to
determine how it is supposed to attempt to access external devices to 
pull in the initial
image you're referring to.

Note that the boot-mode button (pg 6) simply allows the user to select 
either eMMC
or uSD; however there are other modes by which the CPU can boot. Based 
on the
table on pg 6, apparently this device (as is typical) can boot from 
UART, USB or SPI flash
as well as the eMMC/uSD it is currently configured for.

For example, a few years ago I worked on a Blackfin based board that 
only had SPI
flash and DRAM.  We had a jumper on the board (similar to the button on 
pg 6) that
we could set so that upon reset, the boot mode was Boot-from-UART.
Then I was able to simply use a terminal emulator to push down an 
initial set of images
(in an expected format documented for the Blackfin) that eventually 
loaded a real boot
image into the SPI flash.  Its very likely that this will be the same 
case, just using eMMC
and uSD as the boot sources instead.

The important thing to realize here is that the CPU is booting up 
initially with built-in
code, and then it looks at some pins to figure out how the actual 
hardware design
is configured to boot the next stage.

Good stuff!
Ed

> It looks like the internal ROM-based bootloader looks for a secondary
> program loader (SPL) that initializes the necessary devices to
> continue the boot process and pass control to a third-stage
> bootloader.  So now I believe it's a matter of finding whether there
> are existing code implementations of this SPL, or last-case scenario
> this would have to be implemented.  Time for more investigating. :)
>
> On Thu, Mar 26, 2015 at 9:27 AM, Jarielle Catbagan
> <jcatbagan93 at gmail.com> wrote:
>> To put things into context in regards to the conversation that I was
>> having with Ed, Dr. Joel, and Gedare:
>>
>> I am currently in the process of looking into porting MicroMonitor to
>> the Beaglebone Black.  As indicated by Ed, "[t]he difficulty of the
>> port will depend on how much existing CPU-initialization
>> (clocks, cache, etc..) code we can reuse."
>>
>> Ed has also indicated to me that there might be an internal bootloader
>> stored in a ROM-based memory that might look for an image in a
>> specific format.  I will definitely be investigating more into this.
>> I did manage to briefly browse through the Beaglebone Black System
>> Reference Manual Rev C.1 [1], and I have found that the boot
>> configuration/process is briefly elaborated in section 6.7.  For
>> convenience, since it's a short section I will post it here:
>>
>> "The design supports two groups of boot options on the board. The user
>> can switch between these modes via the Boot button. The primary boot
>> source is the onboard eMMC device. By holding the Boot button, the
>> user can force the board to boot from the microSD slot. This enables
>> the eMMC to be overwritten when needed or to just boot an alternate
>> image...
>>
>> [T]the processor-external boot code is composed of two stages. After
>> the primary boot code in the processor ROM passes control, a secondary
>> stage (secondary program loader -- "SPL" or "MLO") takes over. The SPL
>> stage initializes only the required devices to continue the boot
>> process, and then control is transferred to the third stage "U-boot".
>> Based on the settings of the boot pins, the ROM knows where to go and
>> get the SPL and UBoot code. In the case of the BeagleBone Black, that
>> is either eMMC or microSD based on the position of the boot switch."
>>
>> I was kindly guided to look into programming a uSD card as it might be
>> more efficient to run MicroMonitor off of the uSD for quick testing
>> after every build.  If all goes well, either an application image will
>> be located and booted off of the same SD card or via a network boot.
>> For serial debugging I have an FTDI 3.3V USB-to-Serial cable that I
>> have been previously using to access the U-boot monitor on the
>> Beaglebone Black.
>>
>>
>> [1] https://github.com/CircuitCo/BeagleBone-Black/blob/master/BBB_SRM.pdf?raw=true
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel


-- 
Ed Sutter
Alcatel-Lucent Technologies -- Bell Laboratories
Phone: 908-582-2351
Email: ed.sutter at alcatel-lucent.com



More information about the devel mailing list