URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [rtems-20020807/] [c/] [src/] [lib/] [libbsp/] [sh/] [gensh2/] [README.EVB7045F] - Rev 1765
Compare with Previous | Blame | View Log
## README.EVB7045F,v 1.2 2001/08/16 21:07:41 joel Exp## Author: Radzislaw Galler (rgaller@et.put.poznan.pl)#Getting started with EVB7045F and gensh2========================================This is a capture of success path to put a RTEMS sample'hello.exe' on the evaluation board EVB7045F.What you need---------------* Computer with two operating systems: Linux and Wndows 2000 (tm) -that was in my case (see section 'Variations')* Flash Development Toolkit (FDT) - available on HMSE homepage(http://www.hmse.com/products/fdt/support.htm)* 'gdbstubs' - available on SourceForge(http://sourceforge.net/projects/gdbstubs/)* working GNU C compiler for Hitach SH processors; do-it-yourself(on Linux) or download ready stuff for Windows'9x/NT/2k from(http://www.hitachi-eu.com/hel/ecg/) or from Hitach Databook 2001CD-ROM (if no luck try to search on the net for gnu99r1p1.zip)* GDB compiled for target sh-rtems - do-it-yourself or downloadfrom ftp://ftp.oarcorp.com:21/pub/rtems/snapshots/c_tools/* RTEMS (ofcourse) you probably already have if you are reading thisdocumentInstalation of 'gdbstubs'--------------------------Once you downladed and unzipped gdbstubs you have to compileit. First modify the Makefile to use the compiler installed on yourmachine. Then issue the command:$ makeThis should produce the default target sh2-7045edk.out. This is theS-record file which should be added to FDT project (renaming it to*.mot extension helps a bit).If you are lucky you will be able to put the file into the FLASHfollowing the instuctions in FDT and EVB manuals.Well I wasn't lucky so I had to bypass the Universal ProgrammingBoard (see EVB7045F User Manual) and manually put the processor intoBOOT mode. This can be done by shortening the capacitor C8 (or C108on schematics) which puts the UPB into permanent reset state, and byremoving jumper JP4 (or JP104 on schematics) and connecting itsmiddle pin to the ground. After pressing CRES button the processoris in BOOT mode. In FDT select "direct connection":Menu Project->Properties->Device->Select InterfaceAfter that there should be no problem in putting the program into theFLASH.Loading 'hello.exe' on board------------------------------I assume you are able to compile RTEMS with 'gensh2' BSP andnecessary tools. If not please refer to 'started.pdf' document whichdescribes the procedure (http://www.oarcorp.com/).At the time of writing this document 'gdbstubs' defaultcommunication port was SCI1. So it was the default port for/dev/console in RTEMS. To avoid problems I had check these settingsboth in 'gdbstubs' and $RTEMS_ROOT/c/src/lib/libbsp/sh/gensh2/include/bsp.hAfter changing the line#define BSP_CONSOLE_DEVNAME "/dev/sci1"to#define BSP_CONSOLE_DEVNAME "/dev/sci0"in 'bsp.h' and rebuilding RTEMS there should no problem in running'hello.exe' and other samples.For downloading connect a serial cable to computer and EVB. You willalso need a second cable and second serial port to see the effectsof your work.Assuming you are working in Linux and Xwindows fire up two terminalwindows. In the first one run sh-rtems-gdb, in the second run aserial port terminal (for example 'minicom'). Set up the serialterminal to a port connected to SCI0 and leave the window in avisible place on the desktop. The debugger should be invoked bestfrom the directory where 'hello.exe' is placed. Assuming that hereis a GDB session:--------start------$ sh-rtems-gdb hello.exeGNU gdb 5.0Copyright 2000 Free Software Foundation, Inc.GDB is free software, covered by the GNU General Public License, and you arewelcome to change it and/or distribute copies of it under certain conditions.Type "show copying" to see the conditions.There is absolutely no warranty for GDB. Type "show warranty" for details.This GDB was configured as "--host=i686-pc-linux-gnu --target=sh-rtems"...(gdb) set remotebaud 115200(gdb) target remote /dev/ttyS0Remote debugging using /dev/ttyS00x0 in ?? ()(gdb) loadLoading section .text, size 0x12d70 lma 0x444000Loading section .data, size 0xb80 lma 0x456df0Loading section .stack, size 0x10 lma 0xfffffec0Start address 0x444000 , load size 80128Transfer rate: 58274 bits/sec, 153 bytes/write.(gdb) continueContinuing.Program received signal 0, Signal 0.0x44ec36 in exit (code=0) at exit.c:7070 exit.c: No such file or directory.(gdb)--------end-------And here is a capture from the serial terminal window:*** HELLO WORLD TEST ***Hello World*** END OF HELLO WORLD TEST ***Beautiful, isn't it? That's all!Variations------------I'm sure that not every one can afford having two operating systemson one computer. I believe there will be a day that nobody will needan MS stuff anymore... ;)It is possible to repeat the success on MS Windows only. To do thesame on Linux only you need a tool to downlad 'gdbstubs' on theboard. This should be no problem to find it on the net but right nowI don't know about it.For your convenience there are several graphical interfaces for GDBavailable on the net. I just name two of them:DDD - stands for Data Display Debugger(http://www.gnu.org/software/ddd/)Insight - a Tcl/Tk interface available both for MS Windows andXwindows (http://sources.redhat.com/insight/)
