Warning, /bsps/sh/gensh2/README.md is written in an unsupported language. File is not indexed.
0001 gensh2
0002 ======
0003
0004 Author: Ralf Corsepius (corsepiu@faw.uni-ulm.de)
0005 Adapted by: John Mills (jmills@tga.com)
0006 Corrections: Radzislaw Galler (rgaller@et.put.poznan.pl)
0007
0008
0009 ```
0010 BSP NAME: generic SH2 (gensh2)
0011 BOARD: EVB7045F (note 2)
0012 BUS: n/a
0013 CPU FAMILY: Hitachi SH
0014 CPU: SH 7045F
0015 COPROCESSORS: none
0016 MODE: n/a
0017
0018 DEBUG MONITOR: gdb
0019 ```
0020
0021 PERIPHERALS
0022 -----------
0023 ```
0024 TIMERS: on-chip
0025 RESOLUTION: cf. Hitachi SH 704X Hardware Manual (Phi/16)
0026 SERIAL PORTS: on-chip (with 2 ports)
0027 REAL-TIME CLOCK: none
0028 DMA: not used
0029 VIDEO: none
0030 SCSI: none
0031 NETWORKING: none
0032 ```
0033
0034 DRIVER INFORMATION
0035 ------------------
0036 ```
0037 CLOCK DRIVER: on-chip timer
0038 IOSUPP DRIVER: default
0039 SHMSUPP: default
0040 TIMER DRIVER: on-chip timer
0041 TTY DRIVER: /dev/console
0042 ```
0043
0044 STDIO
0045 -----
0046 ```
0047 PORT: /dev/sci0
0048 ELECTRICAL: SCI0
0049 BAUD: 9600
0050 BITS PER CHARACTER: 8
0051 PARITY: NONE
0052 STOP BITS: 1
0053 ```
0054
0055 NOTES
0056 -----
0057 (1) The present 'hw_init.c' file provides 'early_hw_init'(void) which
0058 is normally called from 'start.S' to provide such minimal HW setup
0059 as is conveniently written in 'C' and can make use of global
0060 symbols for 7045F processor elements. It also provides
0061 'void bsp_hw_init (void)' normally called from 'bspstart.c', shortly
0062 before RTEMS itself is started.
0063
0064 These are both minimal functions intended to support the RTEMS test
0065 suites.
0066
0067 (2) See README.EVB7045F
0068
0069
0070
0071 Getting started with EVB7045F and gensh2
0072 ----------------------------------------
0073 Author: Radzislaw Galler (rgaller@et.put.poznan.pl)
0074
0075 This is a capture of success path to put a RTEMS sample
0076 'hello.exe' on the evaluation board EVB7045F.
0077
0078
0079 What you need
0080 -------------
0081 * Computer with two operating systems: Linux and Wndows 2000 (tm) -
0082 that was in my case (see section 'Variations')
0083
0084 * Flash Development Toolkit (FDT) - available on HMSE homepage
0085 (http://www.hmse.com/products/fdt/support.htm)
0086
0087 * 'gdbstubs' - available on SourceForge
0088 (http://sourceforge.net/projects/gdbstubs/)
0089
0090 * working GNU C compiler for Hitach SH processors; do-it-yourself
0091 (on Linux) or download ready stuff for Windows'9x/NT/2k from
0092 (http://www.hitachi-eu.com/hel/ecg/) or from Hitach Databook 2001
0093 CD-ROM (if no luck try to search on the net for gnu99r1p1.zip)
0094
0095 * GDB compiled for target sh-rtems - do-it-yourself or download
0096 from ftp://ftp.oarcorp.com:21/pub/rtems/snapshots/c_tools/
0097
0098 * RTEMS (ofcourse) you probably already have if you are reading this
0099 document
0100
0101 Instalation of 'gdbstubs'
0102 -------------------------
0103 Once you downladed and unzipped gdbstubs you have to compile
0104 it. First modify the Makefile to use the compiler installed on your
0105 machine. Then issue the command:
0106
0107 $ make
0108
0109 This should produce the default target sh2-7045edk.out. This is the
0110 S-record file which should be added to FDT project (renaming it to
0111 *.mot extension helps a bit).
0112 If you are lucky you will be able to put the file into the FLASH
0113 following the instuctions in FDT and EVB manuals.
0114
0115 Well I wasn't lucky so I had to bypass the Universal Programming
0116 Board (see EVB7045F User Manual) and manually put the processor into
0117 BOOT mode. This can be done by shortening the capacitor C8 (or C108
0118 on schematics) which puts the UPB into permanent reset state, and by
0119 removing jumper JP4 (or JP104 on schematics) and connecting its
0120 middle pin to the ground. After pressing CRES button the processor
0121 is in BOOT mode. In FDT select "direct connection":
0122
0123 Menu Project->Properties->Device->Select Interface
0124
0125 After that there should be no problem in putting the program into the
0126 FLASH.
0127
0128 Loading 'hello.exe' on board
0129 ----------------------------
0130 I assume you are able to compile RTEMS with 'gensh2' BSP and
0131 necessary tools. If not please refer to 'started.pdf' document which
0132 describes the procedure (http://www.oarcorp.com/).
0133
0134 At the time of writing this document 'gdbstubs' default
0135 communication port was SCI1. So it was the default port for
0136 /dev/console in RTEMS. To avoid problems I had check these settings
0137 both in 'gdbstubs' and $RTEMS_ROOT/c/src/lib/libbsp/sh/gensh2/include/bsp.h
0138
0139 After changing the line
0140
0141 ```c
0142 #define BSP_CONSOLE_DEVNAME "/dev/sci1"
0143 ```
0144
0145 to
0146
0147 ```c
0148 #define BSP_CONSOLE_DEVNAME "/dev/sci0"
0149 ```
0150 in 'bsp.h' and rebuilding RTEMS there should no problem in running
0151 'hello.exe' and other samples.
0152
0153 For downloading connect a serial cable to computer and EVB. You will
0154 also need a second cable and second serial port to see the effects
0155 of your work.
0156
0157 Assuming you are working in Linux and Xwindows fire up two terminal
0158 windows. In the first one run sh-rtems-gdb, in the second run a
0159 serial port terminal (for example 'minicom'). Set up the serial
0160 terminal to a port connected to SCI0 and leave the window in a
0161 visible place on the desktop. The debugger should be invoked best
0162 from the directory where 'hello.exe' is placed. Assuming that here
0163 is a GDB session:
0164
0165 --------start------
0166
0167 ```shell
0168 $ sh-rtems-gdb hello.exe
0169 GNU gdb 5.0
0170 Copyright 2000 Free Software Foundation, Inc.
0171 GDB is free software, covered by the GNU General Public License, and you are
0172 welcome to change it and/or distribute copies of it under certain conditions.
0173 Type "show copying" to see the conditions.
0174 There is absolutely no warranty for GDB. Type "show warranty" for details.
0175 This GDB was configured as "--host=i686-pc-linux-gnu --target=sh-rtems"...
0176 (gdb) set remotebaud 115200
0177 (gdb) target remote /dev/ttyS0
0178 Remote debugging using /dev/ttyS0
0179 0x0 in ?? ()
0180 (gdb) load
0181 Loading section .text, size 0x12d70 lma 0x444000
0182 Loading section .data, size 0xb80 lma 0x456df0
0183 Loading section .stack, size 0x10 lma 0xfffffec0
0184 Start address 0x444000 , load size 80128
0185 Transfer rate: 58274 bits/sec, 153 bytes/write.
0186 (gdb) continue
0187 Continuing.
0188
0189 Program received signal 0, Signal 0.
0190 0x44ec36 in exit (code=0) at exit.c:70
0191 70 exit.c: No such file or directory.
0192 (gdb)
0193 --------end-------
0194 ```
0195 And here is a capture from the serial terminal window:
0196
0197 ```shell
0198 *** HELLO WORLD TEST ***
0199 Hello World
0200 *** END OF HELLO WORLD TEST ***
0201
0202 Beautiful, isn't it? That's all!
0203 ```
0204
0205
0206 Variations
0207 ----------
0208 I'm sure that not every one can afford having two operating systems
0209 on one computer. I believe there will be a day that nobody will need
0210 an MS stuff anymore... ;)
0211
0212 It is possible to repeat the success on MS Windows only. To do the
0213 same on Linux only you need a tool to downlad 'gdbstubs' on the
0214 board. This should be no problem to find it on the net but right now
0215 I don't know about it.
0216
0217 For your convenience there are several graphical interfaces for GDB
0218 available on the net. I just name two of them:
0219
0220 DDD - stands for Data Display Debugger
0221 (http://www.gnu.org/software/ddd/)
0222
0223 Insight - a Tcl/Tk interface available both for MS Windows and
0224 Xwindows (http://sources.redhat.com/insight/)