Interrupt! CW for MPC5XX

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

Interrupt! CW for MPC5XX

2,433 Views
chuanchuan
Contributor I
I  built a new project , with my own link file and mem cfg, and now I want to add Interrupt to this project , I have got a ExceptionTable.asm and add it in , when I perform System Call interrupt " sc ", CW  give me a dialog box "powerpc exception:00x0C00 System Call interrupt "  and  didn`t call the ISR ,  what should I do ??     appreciate any reply !
Labels (1)
0 Kudos
4 Replies

412 Views
chuanchuan
Contributor I
hello, I have read the "read me " ,she said " Since there are no ISR's installed for this target, you will either get a system call message window from the debugger, or it will branch to the location of
the system call interrupt vector, depending on your debug protocol. "  but I do have a ISR ,maybe I should  like this initialize the Exception like this:
 
__init_user:

 /* init interrupts */
 /* --------------- */
 /* IVPR =0x00000000 - default reset value */
 /* IVOR0 - Critical input */
 lis  r5, 0x0000
 ori  r5, r5, 0x0A00
 mtspr 400, r5
 /* IVOR1 - machine check */
 lis  r5, 0x0000
 ori  r5, r5, 0x0200
 mtspr 401, r5
 /* IVOR2 - data storage (DSI) */
 lis  r5, 0x0000
 ori  r5, r5, 0x0300
 mtspr 402, r5
 /* IVOR3 - instruction storage (ISI) */
 lis  r5, 0x0000
 ori  r5, r5, 0x0400
 mtspr 403, r5
 /* IVOR4 - external input */
 lis  r5, 0x0000
 ori  r5, r5, 0x0500
 mtspr 404, r5
 /* IVOR5 - alignment */
 lis  r5, 0x0000
 ori  r5, r5, 0x0600
 mtspr 405, r5
 /* IVOR6 - program */
 lis  r5, 0x0000
 ori  r5, r5, 0x0700
 mtspr 406, r5
 /* IVOR8 - system call */
 lis  r5, 0x0000
 ori  r5, r5, 0x0c00
 mtspr 408, r5
 /* IVOR10 - decrementer */
 lis  r5, 0x0000
 ori  r5, r5, 0x0900
 mtspr 410, r5
 /* IVOR11 - fixed-interval timer interrupt */
 lis  r5, 0x0000
 ori  r5, r5, 0x0f00
 mtspr 411, r5
 /* IVOR12 - watchdog timer interrupt */
 lis  r5, 0x0000
 ori  r5, r5, 0x0b00
 mtspr 412, r5
 
 /* IVOR13 - data TLB errror */
 lis  r5, 0x0000
 ori  r5, r5, 0x1100
 mtspr 413, r5
 
 /* IVOR14 - instruction TLB error */
 lis  r5, 0x0000
 ori  r5, r5, 0x1000
 mtspr 414, r5
 
 /* IVOR15 - debug */
 lis  r5, 0x0000
 ori  r5, r5, 0x1500
 mtspr 415, r5
 
 /* IVOR32 - SPE-APU unavailable */
 lis  r5, 0x0000
 ori  r5, r5, 0x1600
 mtspr 528, r5
 
 /* IVOR33 - SPE-floating point data exception */
 lis  r5, 0x0000
 ori  r5, r5, 0x1700
 mtspr 529, r5
 
 /* IVOR34 - SPE-floating point round exception */
 lis  r5, 0x0000
 ori  r5, r5, 0x1800
 mtspr 530, r5
 
 /* IVOR35 - performance monitor */
 lis  r5, 0x0000
 ori  r5, r5, 0x1900
 mtspr 531, r5
blr 
 
 
and in the interrupt vector to call the ISR
##############################################################################
#
# 0x0900 Decrementer
#
##############################################################################
  .org base_add + 0x900

   IntPrologue    

  ba   DECIntr
 
   epilogue
 
##############################################################################
#
# 0x0C00 System Call  
#
##############################################################################
  .org base_add + 0xC00
  
IntPrologue

  ba XXXXX
 
epilogue
##############################################################################  
 
 
 
Am I right?   thanks for your help!!
 
 
 
0 Kudos

412 Views
Voxan
Contributor III
the dumy project created from the stationery wizard includes the interuption mechanism already... no need to add your asm file, all is there already...

1- switch from "debug version" to "rom version" the difference is that the interruption handling code is added to the build target. interrupt.c, eppc_exception.asm and <board_specific>_init.c

2- edit eppc_exception.asm, it is basically what you are adding to the project. it basically catching the interruption and determining the cause, then the cause is passed to an exception handler function (into interrupt.c) which will process the interruption. all you need to do is add your interruption traitment code here.  At the moment it is just printing a message on Output.

Hope this clarifies things...

Regards
0 Kudos

412 Views
chuanchuan
Contributor I
Thanks for your reply .
 
It works well now , with your help. thanks again!
0 Kudos

412 Views
Voxan
Contributor III
Hi there,

you are using CW 5xx v8.7 aren't you?

in this case, any project created from the stationery wizard should expose what you are looking for.
TIP, edit and read the readme.txt file included in the project.

Hope this helps...

Cheers
0 Kudos