Hi Frederic,
are you sure you really have rebuilt your object completely? I cannot imagine you are working with a derivate with about maybe 8.3Kb (0x2500-0x200 ?!?) of RAM. In fact this is an address in Flash where your _reset_vector__ ISR resides. For me it produces (without any -mmcu options I think F149 is the default) the code
     fc52:       31 40 80 02     mov     #640,   r1      ;#0x0280
is produced. I use the constraint "i" but "g" leads to the same result. I also tested to move my extern declaration from global to local scope (like yours) which still leads to the same result. Can you make sure that no previosly generated objects are linked to your project?
Good luck

Arnd-Hendrik

Frederic Beaulieu wrote:
Thanks Arnd-Hendrik,

using something like this:
--------------------------------------
NAKED(_reset_vector__){
  extern int __stack;
// Initialize the stack pointer
  // N.B. Don't forget to add the compiler option "-mno-stack-init"
  __asm__ __volatile__("mov %0, r1"::"g" (&__stack));
  ...
}
--------------------------------------

give me the correct assembler code:
--------------------------------------
00002500 <_reset_vector__>:
    2500:       31 40 00 25     mov     #9472,  r1      ;#0x2500
--------------------------------------

Do you think that it is correct to do something like this???
It seems to work for me!

Thanks,
Fred

-------------------------------

Frederic Beaulieu, M.Sc.

Research and Development

NewTrax Technologies Inc.

http://www.newtraxtech.com/

Reply via email to