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 :
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.
Original Attachment has been moved to: PIT_0-blind-LED-and-PIN-interrupt.rar
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.
Thank you for your reply .I followed your tips ,but problems still exist:
The file "MPC57xx__Interrupt_Init" has statements like below :
INTC.BCR.R = 0; /* Software vector mode */
INTC.MCR.R &= ~(INTC_BCR_HVEN( coreId )); /* Software vector mode */
INTC.BCR.R &= ~(INTC_BCR_HVEN( coreId )); /* Software vector mode */
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 .
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 :
I have no idea where I was wrong , looking forward to your reply.
you have some error in your project, which causes IVOR1 exception. Please read IVOR1 description in e200z4 core reference manual (see link below).
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.
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.
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.
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.
after quick analysis of your code I do not like this line:
INTC_0.PSR.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.
Please try and let me know if it works.