K60FN1M0VLQ SysTick Generation Question

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

K60FN1M0VLQ SysTick Generation Question

351 Views
henrynguyen
Contributor IV

Hello,

I can generate the vector mapping for NMI, supervisor call, INT pending interrupt in Vector.c from PE by checking on the appropriate interrupt tab, and then the Event.c has the hook for user to fill in the required function.  This works quite nice from PE.

e.g.

Vector.c file

__attribute__ ((section (".vectortable"))) const tVectorTable __vect_table = { /* Interrupt vector table */

/* ISR name No. Address Pri Name Description */
&__SP_INIT, /* 0x00 0x00000000 - ivINT_Initial_Stack_Pointer used by PE */
{
(tIsrFunc)&__thumb_startup, /* 0x01 0x00000004 - ivINT_Initial_Program_Counter used by PE */
(tIsrFunc)&Cpu_INT_NMIInterrupt, /* 0x02 0x00000008 -2 ivINT_NMI used by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x03 0x0000000C -1 ivINT_Hard_Fault unused by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x04 0x00000010 - ivINT_Mem_Manage_Fault unused by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x05 0x00000014 - ivINT_Bus_Fault unused by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x06 0x00000018 - ivINT_Usage_Fault unused by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x07 0x0000001C - ivINT_Reserved7 unused by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x08 0x00000020 - ivINT_Reserved8 unused by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x09 0x00000024 - ivINT_Reserved9 unused by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x0A 0x00000028 - ivINT_Reserved10 unused by PE */
(tIsrFunc)&Cpu_INT_SVCallInterrupt, /* 0x0B 0x0000002C 0 ivINT_SVCall used by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x0C 0x00000030 - ivINT_DebugMonitor unused by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x0D 0x00000034 - ivINT_Reserved13 unused by PE */
(tIsrFunc)&Cpu_INT_PendableSrvReqInterrupt, /* 0x0E 0x00000038 0 ivINT_PendableSrvReq used by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x0F 0x0000003C - ivINT_SysTick unused by PE */
(tIsrFunc)&Cpu_Interrupt, /* 0x10 0x00000040 - ivINT_DMA0_DMA16 unused by PE */

...

Event.c file.

void Cpu_OnNMIINT(void)
{
/* Write your code here ... */
}

void Cpu_OnSupervisorCall(void)
{
/* Write your code here ... */
}

void Cpu_OnPendableService(void)
{
/* Write your code here ... */
}

Now, i have a interrupt function to service the SysTick but i can not generate the appropriate vector table for SysTick even though the Vector.c has the hook for it:

(tIsrFunc)&Cpu_Interrupt, /* 0x0F 0x0000003C - ivINT_SysTick unused by PE */

Can you please help me on how to get PE to generate a vector table mapping in Vector.c and the call function in Event.c like the NMI, SV call, Int Pending?  

i hate to go back to Vector.c to modify every time we happen to generate new code just in case we change some CPU setting.

Attachment is the screen shot on PE of CPU component where i can not find the option for systick. Should i invoke a HWTimer in order to have SysTick vector configured?

Thanks,

Henry

0 Kudos
1 Reply

235 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Henry Nguyen,

   I have a K60 KDS PE project for Systick interrupt, please check the attachment.

   If you want to enable the systick interrupt, you need to add the according component, set the ISR Name and generate the code.

pastedImage_1.png

   If you don't want to change the vector.c at each time.

   You can modify the Vectors. __vect_table, all the interrupt you can write the name in the comment by yourself, then when you use the according interrupt, just named the according component ISR as the same name in the __vect_table. Because the module interrupt named is controlled by the according PE module, then if you want to give the name to all the interrupt, you need to modify the vector.c by yourself, then lock it.

   The ISR function can call it like this:

PE_ISR(sysINT)  // or other interrupt name in the __vect_table.
{
    // insert you own name.
}

Wish it helps you!

If you still have question, please contact me!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos