wiki:Hardware/jCM/cCM2/bDev

Version 5 (modified by seskar, 16 years ago) ( diff )

Development Environment

SB3 is used for CM2 firware code development. In addition to all the necessary software, SB3 console has USB based JTAG programmer attached. Sanbox 3 node with CM2 board

Firmware Programming

JTAG Programmer Hardware

We are using Olimex ARM-USB-OCD USB based JTAG debugger that is attached to the JTAG port on the CM2 board (JXX).

JTAG programnmer attached to CM2 board

JTAG Programmer Software

Software used for debugging and internal flash programming is OpenOCD (standard Debian package - apt-get isntall openocd ).

The file openocd.cfg, included in the source repository, has an appropriate configuration for programming the CM2 hardware, although you can experiment with different scripts to automate erasing the flash, verifying the image, and so forth.

The daemon is started with:

  openocd -f openocd.cfg

It is listening for gdb connections on default port 3333. Note that openocd daemon is started automatically and should be up and running at all times.

Cross-compiler

Software development environment is based on GNU Toolchain for ARM Processor. Downloaded tarball is installed in /usr/{bin,lib,libexec}. The toolcahin was compiled with the arm-elf prefix so that (for example) compiler can be invoked with:

  arm-elf-gcc program.c -o program

You can also get the latest version of gcc, binutils, and newlib, and compile these as configure --target=arm-elf. Both the Makefile and the loader know (at least in theory) how to deal with ELF format CM2 images. In this case tools are prefixed with "arm-elf", so for example an appropriate value for CC in the Makefile would be CC=/usr/local/arm-elf-gcc

Debugger

Use gdb initialization file to set it up to work with JTAG debugger:

  arm-elf-gdb -x gdbinit

Then, once you get the gdb prompt issue

  load main.elf

Attachments (2)

  • SB3.jpg (92.6 KB ) - added by seskar 16 years ago. Sanbox 3 node with CM2 board
  • JTAG.jpg (108.3 KB ) - added by seskar 16 years ago. JTAG programnmer attached to CM2 board

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.