This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Found Error in link-script for R8C


> Hello to everyone,

Wrong list.  The R8C link scripts are part of newlib (libgloss), not
gcc.

>  RESETVEC (r) : ORIGIN = 0xfffc, LENGTH = 4
> 
> But this is wrong. The Resetvektor for  R8C is only 16Bit and not
> 32bit.

The REJ09B0169-0100 page 61 shows the reset vector as being "0FFFCh to
0FFFFh".  Addresses in R8C are 20 bits, not 16, and are normally
stored in a 3 or 4 byte location.  The R8C/2D, for example, is
available with 96K of flash.

> When you write 32Bit value to 0xfffc it writes a 0x00 in Adress
> 0xffff, but this is the Register OFS.  After this the watchdog is
> switched on and the controller is only working for short time.

My flash utility has a command line option for whether the watchdog
should be set or disabled.  It overrides this byte before programming.

Note that all the vectors in the interrupt and reset vector tables are
essentially three byte values, with the top byte used for other
purposes.

Hmmm... I thought there was a .3byte pseudo-op just for this case, but
I see now that there isn't.  With it, you could do this:

	.section ".resetvec"
	.3byte _start
	.byte 0xff

If you know your start address is in the first 64k, you can do this:

	.section ".resetvec"
	.short	_start
	.byte	0
	.byte	0xff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]