This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with the m32c target and M16C6N cpu
- From: Frank von Zeppelin <fvzeppelin at yahoo dot de>
- To: dj at redhat dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 06 Oct 2005 17:43:44 +0200
- Subject: Re: Problems with the m32c target and M16C6N cpu
Hi DJ,
finally, I could try your proposal with the reset.S file. It works fine
in the KD30 debugger, but unfortunately, the program doesn't run when I
flash the srec directly.
Do you have an idea on what's going wrong?
Frank
References:
http://gcc.gnu.org/ml/gcc/2005-09/msg00067.html
http://gcc.gnu.org/ml/gcc/2005-09/msg00070.html
DJ Delorie wrote on Sat, 3 Sep 2005:
The most likely problem is that you're not providing a reset vector
that points at your program, so the board doesn't know the starting
location (neither kd30 nor the flash program honor the "start address"
s-record). I should probably have the tools do that automatically.
With the tools you have, create a reset.S file that looks like this:
.section ".resetvec","a"
.word _start
.text
and add that to your compile line.
I just checked in a fix yesterday that lets you do this:
typedef void (*ifunc)() __attribute__((mode(SI)));
extern void start();
const ifunc __attribute__((section(".resetvec"))) reset_vector = start;
Anyway, you can also use "objdump -f" on the ELF executable to find
out where it wants its start address, then flash the chip, then verify
that the program was loaded there. Then you can double-click on $pc
in the register window to force it to start in the right place.
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de