Changes between Version 6 and Version 7 of Hardware/jCM/cCM2/bDev
- Timestamp:
- Oct 16, 2008, 6:33:10 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Hardware/jCM/cCM2/bDev
v6 v7 34 34 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. 35 35 36 You 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 36 42 == Cross-compiler == 37 43 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: 44 Software 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 39 46 {{{ 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 41 66 }}} 42 67 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}}} 68 CM2 build configuration is done by overriding variables from the first few hundred lines of the Makefile on the {{{make}}} command line. 44 69 45 70 == Debugger == 46 71 47 Use [source:CM2/trunk/gdbinit gdb initialization file] to set it up to work withJTAG debugger:72 Use [source:CM2/trunk/gdbinit-rom gdb initialization file] to properly interact with the JTAG debugger: 48 73 49 74 {{{ 50 arm-elf-gdb -x gdbinit75 $ arm-elf-gdb --annotate=3 -x gdbinit-rom main.elf 51 76 }}} 52 77 53 Then, once you get the gdb prompt issue 54 55 {{{ 56 load main.elf 57 }}} 78 This will load and run the CM2 with a breakpoint set at {{{main()}}}.