Except Vector Name: Address Error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Except Vector Name: Address Error

2,208 Views
c393
Contributor II

I have a project using the MCF52259 Eval baord I compile for internal flash when I execute the start up I get a "Exception Vector Name: Address Error" after lea __SP_AFTER_RESET,a7 execution. 

 

asm void _startup(void)
{
 /* disable interrupts */
    move.w        #0x2700,sr

 /* Pre-init SP, in case memory for stack is not valid it should be setup using
    MEMORY_INIT before __initialize_hardware is called
 */
 lea __SP_AFTER_RESET,a7    
 
    /* initialize memory */
    MEMORY_INIT

 /* initialize any hardware specific issues */
    jsr           __initialize_hardware  

Labels (1)
0 Kudos
Reply
2 Replies

1,038 Views
RichTestardi
Senior Contributor II

Hi,

 

Just to be sure, did you use the Flash Programmer to erase and program your flash before you executed the program?  CFV2 requires a manual flash programming step, as compared to CFV1, before you can execute.

 

Then, assuming you did that, can you look at your xMAP file in your bin directory and tell us what your SP_AFTER_RESET is?  It should look something like:

 

#>00001000          ___heap_size (linker command file)
#>00001000          ___stack_size (linker command file)
#>40000000          ___IPSBAR (linker command file)
#>20000000          ___RAMBAR (linker command file)
#>0000FFFF          ___RAMBAR_SIZE (linker command file)
#>00000000          ___FLASHBAR (linker command file)
#>00080000          ___FLASHBAR_SIZE (linker command file)
#>2000FFFB          ___SP_AFTER_RESET (linker command file)

 

-- Rich

0 Kudos
Reply

1,038 Views
RichTestardi
Senior Contributor II

> #>2000FFFB          ___SP_AFTER_RESET (linker command file)

 

Hey, that is actually a bit weird...

 

The default linker command file from the project wizard (where I got the previous xMap snippet from) seems to set up an unaligned SP...  I would have expected the SP value to be 2000FFFC (which is how my project runs)...

 

Does that mean by default we're running slow on every stack access, or are the low bits somehow ignored?  From the CFPRM, it seems the stack only self-aligns for exceptions, so we might in fact be running slow in the default context.

 

-- Rich

 

0 Kudos
Reply