Hi all,
I need to redefine the start-up procedure of my application and put it
at a specific address in my flash memory. However, I have problem
redefining it using the NAKED(_reset_vector__) function described in the
MSPGCC documentation. If I try to just duplicate the default function by
adding the following function, my device (msp430f1612) seems to crash.
Can someone help me, please?
 
Thanks,
Fred
 
NAKED(_reset_vector__){
  
  extern int _etext;
  extern int __data_start;
  extern int _edata;
  extern int __bss_start;
  extern int __bss_end;
  
  Byte1_t *b1Src;
  Byte1_t *b1Dst;
  
  // Stop watchdog timer
  WDTCTL = WDTPW + WDTHOLD;
 
  // Initialize the .data segment
  b1Src = (Byte1_t*)_etext;
  b1Dst = (Byte1_t*)__data_start;
  while(b1Dst != (Byte1_t*)_edata){
    *b1Dst = *b1Src++;
    *b1Dst++;
  }
 
  // Clear the .bss segment
  b1Dst = (Byte1_t*)__bss_start;
  while(b1Dst != (Byte1_t*)__bss_end){
    *b1Dst = 0;
    *b1Dst++;
  }
 
  // Jump to main
  __asm__ __volatile__("br #main"::);
  
}
 
-------------------------------
Frederic Beaulieu, M.Sc.
Research and Development
NewTrax Technologies Inc.
HYPERLINK "http://www.newtraxtech.com/"http://www.newtraxtech.com/
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.4 - Release Date: 3/27/2005
 

Reply via email to