sh architecture, "hello" sample doesn't work

Ralf Corsepius ralf.corsepius at rtems.org
Fri Jun 25 10:06:19 UTC 2010


On 06/25/2010 10:03 AM, Steve Battazzo wrote:
> Hi,
>
> We have very slightly modified the gensh2 bsp such that the code should
> run on an SH7145 chip. The internal registers are mostly the same, so
> for now the only thing that probably needed to be changed was an extra
> write to disable individual module power down modes for SCI0 and SCI1
> which didn't exist in the 7045 that the bsp was intended for.
>
> In the gensh2 source folder there is a README which provides
> instructions on running hello.exe through gdb using gdbstubs.
>
> Using sh-elf-gcc and a gdbstub both provided by KPIT GNU tools, the code
> can be loaded into RAM just fine with sh-rtems4.9-gdb, but when I try to
> run it with the "continue" command, I get an Illegal Instruction signal
> at 0x00400000 (the first address of SRAM).
> I tried running objcopy to generate an s-record file, and loaded that
> through sh-elf-gdb instead of the rtems gdb, this time no SIGILL, but
> ran into a segfault a few hundred bytes into the code memory.
>
> I know the sh architecture probably has been untouched for quite a
> while,
Correct ... it's old and probably hasn't seen any real world testing for 
a long time (I am co-author of the original sh-port).

IMO, it's amongst the candidates to be considered for removal. discontinued.

> but does anybody happen to know what might be a cause of this?

2 potential candidates

a) memory layout/memory sizes
On sh1/sh2's memory layout is crucial and memory sizes are very tight. 
Check your hardware layout matches with the linker script and check if 
you're not running into memory restrictions.

b) Kpit's toolchain is unlikely to work.

Ralf



More information about the users mailing list