Problems of PIT Interrupt

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems of PIT Interrupt

589 Views
bruceye
Contributor II

Hi ,

I debugged the .elf from example "MPC5744P-HardwareVectoreMode-S32DS" using S32DS 1.1 ,then it runs well and achieve the ideal output. However ,when building a new project and coping  all the source code of MPC5744P-HardwareVectoreMode-S32DS.c file ,adding " exceptions.s"、、"HW_Vector.c" and replacing “Vector.c”、"MPC57xx__Interrupt_Init.c" to this new project , errors occurred :

when pit0 generate an interrupt , it will jump into the page like below : 

 

 

180096_180096.pngpastedImage_1.png
Do you know  if it is because I lost some file which is necessary or I miss to configure something ? My project is upload below.  Please give me some advise.

 

 

Thanks 

Sincerely

 

Bruce

Original Attachment has been moved to: PIT_0-blind-LED-and-PIN-interrupt.rar

10 Replies

99 Views
martin_kovar
NXP Employee
NXP Employee

Hello,

at first, I was not able to compile your project because S32DS v1.1 uses different linker files. Also your project generates IVOR6 exception from some kind of reason.

If you want to create project in S32DS v1.1, create new project and and add exceptions.s, handlers_vle.s and HW_vector.c.

About files, which must be modified, please do not remove these files from new project, but change the content of the files (some files does not exist in new project - mem.ld and sections.ld are replaced by 57xx_flash.ld).

Exclude intc_sw_handlers.S and intc_SW_mode_isr_vectors_MPC5744P.c from compilation and linking.

Regards,

Martin

0 Kudos

99 Views
bruceye
Contributor II

Dear Martin,

Thank you for your reply .I followed your tips ,but problems still exist:

The file "MPC57xx__Interrupt_Init"  has statements like below :

#if defined(MPC574xP)
INTC.BCR.R = 0; /* Software vector mode */
#elif defined(MPC5777C)
INTC.MCR.R &= ~(INTC_BCR_HVEN( coreId )); /* Software vector mode */
#else
INTC.BCR.R &= ~(INTC_BCR_HVEN( coreId )); /* Software vector mode */
#endif

If I run the project ,it will cause the error that "intc_sw_handlers.S" and "intc_SW_mode_isr_vectors_MPC5744P.c" files were not found .However ,if I change the 0 to 1 in the sentense "INTC.BCR.R = 0" , error still accur ,showing that .elf file can not be found .

Please give me some hints .

Thank you again .

Yours,
Bruce

0 Kudos

99 Views
martin_kovar
NXP Employee
NXP Employee

Hello Bruce,

I ported my example for S32DS version 1.1.

Please see the attachment in this post and let me know, if it works on your side.

Regards,

Martin

0 Kudos

99 Views
bruceye
Contributor II

Hi Martin, 

Thank you for your reply. Your project is worked if opened directly.

However , when building a new project of my own ,adding "handlers_vle.s","HW_Vector.c","exceptions.s" from your project and replacing the file "MPC57xx__Interrupt_Init.c,Vector.c" , it will get in the circuit when running :

pastedImage_1.png

I have no idea where I was wrong , looking forward to your reply.

Thank you,

Bruce

0 Kudos

99 Views
martin_kovar
NXP Employee
NXP Employee

Hello Bruce,

you have some error in your project, which causes IVOR1 exception. Please read IVOR1 description in e200z4 core reference manual (see link below).

http://cache.nxp.com/assets/documents/data/en/reference-manuals/e200z4RM.pdf?fsrch=1&sr=1&pageNum=1 

Also you can check the difference between the project I sent you and the project you have created. It is out of my time possibilities to check every line of your code. Please focus your attention to linker file. It looks like some misalignment of interrupt vector table.

Regards,

Martin

99 Views
bruceye
Contributor II

Hi Martin ,

Now I have another problem: I tried to configure another interrupt but failed ,the new interrupt can not work together with the former previous one.

Could you please tell me how to configure multiple interrupt or give me some materials to learn ?

Thank you sincerely.

Bruce

0 Kudos

99 Views
martin_kovar
NXP Employee
NXP Employee

Hello Brice,

which interrupt did you try to implement? Have you correctly add interrupt handler in handlers_vle.s file? Have you installed the handler into vector interrupt table in HW_Vector.c file?

Last please check, if you have configured appropriate INTC PSR register.

Regards,

Martin

99 Views
bruceye
Contributor II

Hi Martin,

I followed your advice, adding a  PIT interrupt to the former program, then the program run as expect.
In the next move ,however,I tried to adding a SPI's Transfer Complete interrupt ,aiming to use this interrupt to flicker an LED diode ,the interrupt did not occur after TCF bit was set .
Following is my file ,I will be really appreciate if you could give me some advice again.

Thank you sincerely.
Bruce

0 Kudos

99 Views
martin_kovar
NXP Employee
NXP Employee

Hello Bruce,

after quick analysis of your code I do not like this line:

INTC_0.PSR[260].R = 0x8001;

According to MPC5744P Reference manual rev.6 vector 260 enables interrupt for DSPI_SR[EOQF], but you want to enable interrupt for DSPI_SR[TCF] and it has vector 262.

pastedImage_1.png

Please try and let me know if it works.

Regards,

Martin

0 Kudos

99 Views
bruceye
Contributor II

Dear Martin,

Thank you  for your advice, after such a long time ,I finally solved the problem following your tips .

Thank you again.

Bruce

0 Kudos