Redirection Vector - MC9S08QE8

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

Redirection Vector - MC9S08QE8

1,393 Views
DavidoBG
Contributor II
I had a redirection vector like following code:
 
#ifndef UNASSIGNED_ISR
  #define UNASSIGNED_ISR 0xFFFF       
#endif
 
#define USER_VECTORTABLE_LOCATION  (0xF9CE)
void interrupt isr_rx(void);
void (* near const _vect[])() @USER_VECTORTABLE_LOCATION = {
   UNASSIGNED_ISR,               // 24. Vrtc (0xF9CE)
   UNASSIGNED_ISR,               // 23. VReserved23 (0xF9D0)
   UNASSIGNED_ISR,               // 22. VReserved22 (0xF9D2)
   UNASSIGNED_ISR,               // 21. VReserved21 (0xF9D4)
   UNASSIGNED_ISR,               // 20. Vacmpx (0xF9D6)
   UNASSIGNED_ISR,               // 19. Vadc (0xF9D8)
   UNASSIGNED_ISR,               // 18. Vkeyboard (0xF9DA)
   UNASSIGNED_ISR,               // 17. Viic (0xF9DC)
   UNASSIGNED_ISR,               // 16. Vscitx (0xF9DE)
   isr_rx,                       // 15. Vscirx (0xF9E0)
   UNASSIGNED_ISR,               // 14. Vscierr (0xF9E2)
   UNASSIGNED_ISR,               // 13. Vspi (0xF9E4)
   UNASSIGNED_ISR,               // 12. VReserved12 (0xF9E6)
   UNASSIGNED_ISR,               // 11. Vtpm2ovf (0xF9E8)
   UNASSIGNED_ISR,               // 10. Vtpm2ch2 (0xF9EA)
   UNASSIGNED_ISR,               //  9. Vtpm2ch1 (0xF9EC)
   UNASSIGNED_ISR,               //  8. Vtpm2ch0 (0xF9EE)
   UNASSIGNED_ISR,               //  7. Vtpm1ovf (0xF9F0)
   UNASSIGNED_ISR,               //  6. Vtpm1ch2 (0xF9F2)
   UNASSIGNED_ISR,               //  5. Vtpm1ch1 (0xF9F4)
   UNASSIGNED_ISR,               //  4. Vtpm1ch0 (0xF9F6)
   UNASSIGNED_ISR,               //  3. Vlvd (0xF9F8)
   UNASSIGNED_ISR,               //  2. Virq (0xF9FA)
   UNASSIGNED_ISR               //  1. Vswi (0xF9FC)
   //_Startup,               //  0. pseudo-Reset - Real reset vector is not relocated.
};
 
I declared an interrupt function in c code
void interrupt isr_rx(void)
{.......}
 
When i use True time Simulator and i send an RX car via SCI interrupt and an error message appears and say me :
Error: At location FFE0 -
Error: Attempt to use invalid or uninitialized memory
Error: Interrupt processing failed.
 
Normal i think, because at this adress (0xFFE0) i have 0xFF due to redirection vector. Why the interrupt try to call adress of oxffe0 and not 0xFAE0? At 0xFAE0, there is good contains not 0xFF.
 
I hope to be clear. Thanks for you help.
 
David


Message Edited by NLFSJ on 2008-12-01 11:13 AM
Labels (1)
0 Kudos
Reply
2 Replies

348 Views
DavidoBG
Contributor II
Following my .prm file
 
/* This is a linker parameter file for the mc9s08qe8 */
NAMES END /* CodeWarrior will pass all the needed files to the linker by command line. But here you may add your own files too. */
SEGMENTS /* Here all RAM/ROM areas of the device are listed. Used in PLACEMENT below. */
    Z_RAM                    =  READ_WRITE   0x0060 TO 0x00FF;
    RAM                        =  READ_WRITE   0x0100 TO 0x025F;
   CALIBZONE             =  READ_ONLY    0xE000 TO 0xE1FF;
    ROM                        =  READ_ONLY    0xE200 TO 0xF9BF;
    BOOTLOADER               =  READ_ONLY    0xFA00 TO 0xFDFF;
    ROM1                     =  READ_ONLY    0xFFC0 TO 0xFFCD;
    
    
    //INTVECTS               =  READ_ONLY    0xFFCE TO 0xFFEF; //Reserved for Interrupt Vectors
END
PLACEMENT /* Here all predefined and user segments are placed into the SEGMENTS defined above. */
    DEFAULT_RAM                         /* non-zero page variables */
                                        INTO  RAM;
    _PRESTART,                          /* startup code */
    STARTUP,                            /* startup data structures */
    ROM_VAR,                            /* constant variables */
    STRINGS,                            /* string literals */
    VIRTUAL_TABLE_SEGMENT,              /* C++ virtual table segment */
    DEFAULT_ROM,
    COPY                                /* copy down information: how to initialize variables */
                                        INTO  ROM; /* ,ROM1: To use "ROM1" as well, pass the option -OnB=b to the compiler */
                                       
   
    _DATA_ZEROPAGE                     INTO  Z_RAM;/* zero page variables */
    MY_ZEROPAGE                         INTO  Z_RAM;
   
    CALIBZONE_CODE                      INTO CALIBZONE;
    BOOTLOADER_CODE                     INTO BOOTLOADER;
    
    
   
END
STACKSIZE 0x50
VECTOR 0 _Startup /* Reset vector: this is the default entry point for an application. */
0 Kudos
Reply

348 Views
Lundin
Senior Contributor IV
//_Startup, // 0. pseudo-Reset - Real reset vector is not relocated.

To me it seems that the problem is the commented-out reset vector. Unless you do something in the .prm file, the reset vector will not be set to a valid address. Instead it will contain FFFFh.

What does your .prm file look like?
0 Kudos
Reply