Problems with the m32c target and M16C6N cpu

Frank von Zeppelin fvzeppelin@yahoo.de
Thu Oct 6 16:00:00 GMT 2005


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



More information about the Gcc mailing list