B3 and JTAG
Introduction
Hardware
Subarctic
Sitara StarterWare
CrossWorks for ARM
Prepare to debug
Download
 

Introduction

What is a BeagleBone?

The BeagleBone is the low-cost, high-expansion focused BeagleBoard using a low cost Sitara AM335x Cortex A8 ARM processor. It is similar to the earlier BeagleBoards and can act as a USB or Ethernet connected expansion companion for your current BeagleBoard and BeagleBoard-xM or work stand-alone. The BeagleBone is small even by BeagleBoard standards and with the high-performance ARM capabilities you expect from a BeagleBoard, the BeagleBone brings full-featured Linux to places it has never gone before. (Source: circuitco)

The BeagleBone Black is the successor of the BeagleBone. In case you are searching for a solution for the BeagleBone instead of BeagleBone Black, please take a look here.

Personal I use the BeagleBone (Black) for Bare-Metal development and not for Linux. Here the JTAG is needed for debugging, and I would like to show the way to use it.

Hardware

This solution based on the "Optional JTAG Header" but without the Samtec connector. A direct connection is soldered to the bottom of the circuit board. It looks like:

Subarctic

If the bootloader is active on the BeagleBone, you will be asked for a SUBARCTIC driver by the Windows system. This is the case for example when the SD card is not used. It is annoying and I could not find any official driver. That is why I decided to create a dummy driver with libusb-win. You will find the dummy driver in the download section. The driver is for VID: 0451 and PID: 6141.

Sitara StarterWare

StarterWare provides C-based no-OS platform support for TI's ARM9™ and ARM® Cortex™ A8 based devices. StarterWare provides device abstraction layer libraries, peripheral programming examples such as Ethernet, graphics and USB, and board level example applications. StarterWare can be used stand-alone or with an RTOS (with appropriate changes to work in RTOS environment). (Source: Texas Instruments)

The Sitara StarterWare is used by CrossWorks for ARM too. Here some code will be used to create the "Bootloader" which is used by the debugger to init the CPU before. Unfortunately the StarterWare source cannot compile, because of some bugs in version v2.00.01.01. Here a patch is needed. which is available in the download section.

Extract the patch and copy the source over your existing StarterWare source.

CrossWorks for ARM

I like to work with CrossWorks for ARM. You don't know CrossWorks for ARM? Take a look here.

I am using CrossWorks for ARM v2.3.5 with the "Olimex ARM-USB-TINY-H" target. But it is very important to set the "JTAG Clock divider" to 2 in the target properties. Unfortunately it was not possible to use the J-Link JTAG adapter here.

A major advantage of the CrossWorks for ARM solution is that the CPU and SDRAM is being initialized before the actual start of the debugging session. Therefore it is possible to load the application into the external SDRAM. This is realized by load and execute of a Sitara StarterWare "Bootloader" before the application to debug.

If the BeagleBone is used, everything works fine. But in case of the BeagleBone Black, the full performance will not be achieved. The problem is the "Bootloader". As mentioned before, the Sitara StarterWare source is used. But unfortunately only for the BeagleBone, not for the Black version. In case of the BeagleBone Black the MPU is running with 500 MHz only, even though 1000 MHz will supported by the MPU too.

To solve this performance lack, a new "Bootloader" must be used for the Black version. Here a patch is available too. Extract the patch and copy the content of the folder over the existing "BeagleBone_Black" Board Support Package.


Attention: Not only the MPU frequency, even the MPU voltage will be changed by the patch.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Prepare to debug

A new BeagleBone Black will be delivered with an installed Linux in the eMMC device. To debug your Bare-Metal application you must first erase the U-Boot and Linux. This can be achieved by erasing the first sector of the eMMC device. The first sector can be erased by using the following commands from the U-Boot prompt:

U-Boot# mmc dev 1
mmc1(part 0) is current device
U-Boot# mmc erase 0 512

MMC erase: dev # 1, block # 0, count 1298 ...

Caution! Your devices Erase group is 0x400
The erase range would be change to 0x0~0x7ff

1298 blocks erase: OK
U-Boot#

Happy debugging...

Download

SUBARCTIC Dummy v20131013

StarterWare v2.00.01.01 patch v20151114

Beagle Bone Black patch 20161030 for CrossWorks for ARM, tested with v3.6.5

CW-B3Test CrossWorks for ARM example project