Changes between Version 6 and Version 7 of Hardware/jCM/cCM2/bDev


Ignore:
Timestamp:
Oct 16, 2008, 6:33:10 PM (16 years ago)
Author:
Joseph F. Miklojcik III
Comment:

updated to reflect improvements in dev tools

Legend:

Unmodified
Added
Removed
Modified
  • Hardware/jCM/cCM2/bDev

    v6 v7  
    3434It 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.
    3535
     36You can develop on your private system and run {{{arm-elf-gdb}}} against openocd remotely.  sb3 does not expose an ssh port, but you can tunnel through {{{gw.orbit-lab.org}}} with a command like the following.
     37
     38{{{
     39  $ ssh gw.orbit-lab.org -L 3333:sb3.orbit-lab.org:3333
     40}}}
     41
    3642== Cross-compiler ==
    3743
    38 Software development environment is based on [http://www.codesourcery.com/gnu_toolchains/arm 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:
     44Software development environment is based on the latest version of gcc, binutils, and newlib.  There are two tricks to compiling these tools: one is to use separate build directories, the other is to bootstrap a C compiler against the newlib headers, compile newlib with that compiler, then compile another C compiler with newlib installed.  Interwork and Multilib support are necessary.
     45
    3946{{{
    40   arm-elf-gcc program.c -o program
     47  $ # unpack tarballs in $SRC_TOP
     48  $ mkdir $SRC_TOP/binutils-build
     49  $ cd $SRC_TOP/binutils-build
     50  $ ../binutils-$BINUTILS_VERSION/configure --target=arm-elf --enable-interwork --enable-multilib
     51  $ make && sudo make install
     52  $ mkdir $SRC_TOP/gcc-build
     53  $ cd $SRC_TOP/gcc-build
     54  $ ../gcc-$GCC_VERSION/configure --target=arm-elf --enable-interwork --enable-multilib --enable-languages=c --with-newlib --with-headers=../newlib-$NEWLIB_VERSION/newlib/libc/include
     55  $ make all-gcc && sudo make install-gcc
     56  $ mkdir $SRC_TOP/newlib-build
     57  $ cd $SRC_TOP/newlib-build
     58  $ ../newlib-$NEWLIB_VERSION/configure  --target=arm-elf --enable-interwork --enable-multilib
     59  $ make all && sudo make install
     60  $ cd $SRC_TOP/gcc-build
     61  $ make all && sudo make install
     62  $ mkdir $SRC_TOP/gdb-build
     63  $ cd $SRC_TOP/gdb-build
     64  $ ../gdb-$GDB_VERSION/configure --target=arm-elf
     65  $ make all && sudo make install
    4166}}}
    4267
    43 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}}}
     68CM2 build configuration is done by overriding variables from the first few hundred lines of the Makefile on the {{{make}}} command line.
    4469
    4570== Debugger ==
    4671
    47 Use [source:CM2/trunk/gdbinit gdb initialization file] to set it up to work with JTAG debugger:
     72Use [source:CM2/trunk/gdbinit-rom gdb initialization file] to properly interact with the JTAG debugger:
    4873
    4974{{{
    50   arm-elf-gdb -x gdbinit
     75  $ arm-elf-gdb --annotate=3 -x gdbinit-rom main.elf
    5176}}}
    5277
    53 Then, once you get the gdb prompt issue
    54 
    55 {{{
    56   load main.elf
    57 }}}
     78This will load and run the CM2 with a breakpoint set at {{{main()}}}.