Component specific interrupt on K64 through KDS 3.0

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

Component specific interrupt on K64 through KDS 3.0

Jump to solution
774 Views
Kewal
Contributor IV

I am trying to get a component specific interrupt. While I have not added the interrupt manager. I wanted to know if I am in the right direction, but I am not able to get an interrupt on that component. To explain this better below are the screenshots.

 

 

I have done the pin configuration.

 

97793_97793.JPGPin settings.JPG

 

 

To get the interrupt on this particular compoent, I modified events

 

97794_97794.JPGSelect event code generate.JPG

 

 

 

Then install interrupt for that particular pin input.

 

97795_97795.JPGInterruptsettings.JPG

 

 

 

After I hit the generate code, I am able to see the events with a component specific IRQ

 

97796_97796.JPGComponentInterrupt.JPG

 

 

But the interrupt is not added in startup_MK64F12.s file where all the interrupts are located. so when the event is generated it falls to Default ISR.

 

 

Should we modify the MK64F12.h for the interrupt and then define it in the startup_MK64F12.h to get the interrupt? Is this the right way of doing or is there some setup through which those two files are modified for the installed interrupt through component settings.

 

 

Thanks,

Kewal

Labels (1)
0 Kudos
1 Solution
553 Views
Kewal
Contributor IV

Hi David,

I sort of ironed it out,...

Its because of the __ram_vector_table__ symbol which was not defined. so it was the offset and size were 0 so I was getting that error.

I did not show the entire file so that information was missing above.

Thanks anyways,

Kewal

View solution in original post

0 Kudos
6 Replies
553 Views
Kewal
Contributor IV

Also when i install the interrupt on that particular component, I am getting an error to check if the vector is present in RAM

VectorRam.JPG

on debug, I am landing at,..

Debug.JPG

So my ICF configuration looks like this where ofcourse, it says vector table to be copied to RAM, Am i missing something else???

ICF Configuration.JPG

0 Kudos
553 Views
DavidS
NXP Employee
NXP Employee

Hi Kewai,

It seems that you are making all the correct steps to get a GPIO interrupt.

Maybe you need to clean and rebuild?

Or maybe project is somehow corrupted so a new project might fix things.

Have you done updates?

Attached is my project that I tested using KDS_3.0.0 and KSDK_1.3.0 fo frdm-k64f Freedom board.

I setup the SW2 GPIO (PTC6) as my input gpio interrupt.  I had to enable pull-up for the gpio as the switch doesn't have a  pull-up populated.  So my interrupt is set for negative edge.

The project is using SRAM for the vector table.

In Cpu.c the gpio isr is being added to the SRAM vector table with following call:

  OSA_InstallIntHandler(PORTC_IRQn,  gpio1_PORTC_IRQHandler);

I can set a breakpoint in the Event.c handler:

void gpio1_PORTC_IRQHandler(void)

{

  /* Clear interrupt flag.*/

  PORT_HAL_ClearPortIntFlag(PORTC_BASE_PTR);

  /* Write your code here ... */

}

When i press SW2 I get the interrupt.

Hope this helps.

Regards,

David

0 Kudos
553 Views
Kewal
Contributor IV

David,

To give more details, I am using safeRTOS and the OSAL has been adapted for that, also to inform I am using IAR EWARM 7.4

I have tried all other stuffs,I am still hoping that something is missing because of which I am not able to solve this vector ram issue. if you have not able to see my previous reply as it requires to be approved by moderator.

ICF file looks like left hand side of the diff file, which is edited accordingly for safeRTOS. the processor expert ICF is the right hand side file in the diff attached. ICF.JPG

0 Kudos
553 Views
DavidS
NXP Employee
NXP Employee

Hi Kewal,

Guess you cannot post your project then.  Correct?

Here is a picture from a KSDK_1.3 IAR project that has define's added to the linker section.  Do you have them too?

ScreenHunter_212 Nov. 06 13.28.gif

The __ram_vector_table__=1 is used by the linker to help setup VTOR to be in SRAM.

What is your __VECTOR_RAM defined to in your linker file?  It should equate to 0x1fff0000 .

The ProcessorExpert.ld has:

  __VECTOR_RAM = ORIGIN(m_interrupts_ram);

Regards,

David

554 Views
Kewal
Contributor IV

Hi David,

I sort of ironed it out,...

Its because of the __ram_vector_table__ symbol which was not defined. so it was the offset and size were 0 so I was getting that error.

I did not show the entire file so that information was missing above.

Thanks anyways,

Kewal

0 Kudos
553 Views
Kewal
Contributor IV

Since I am using the safeRTOS, we have actually included the safeRTOS ICF file which is as shown on the right side of the diff of both the safeRTOS icf and generated ICF

ICF.JPG

0 Kudos