Modifying PE's vector table

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

Modifying PE's vector table

Jump to solution
1,590 Views
crezyoz
Contributor IV

Hello

 

I am using PE's AS component as a starting base for a UART class that I am writing. Basically stripping out  code I don't need.  When I am done I will have a uart module that works specifically for the task. Eventually removing the original PE module completely.

 

But I don't quite know how to modify PE's vector table with my new interrupt vectors as it overwrites changes when it builds the table. How is this done?

 

thanks!!

 

 

Labels (1)
Tags (1)
0 Kudos
1 Solution
983 Views
vfilip
NXP Employee
NXP Employee

Hello,

please find the example project of the proposed workaround with Init_UART and "Call Init method" property set to "no". It will ensure that you should be able to have your UART initialization code and ISR in one file (MyUART.c). Just please note that the interrupt controller and routing for UART is still initialized in CPU.c in this case.

In case this is not sufficient for you, currently the only another option is to make the Vectors.c file as read-only.

However, in CW V10.3 there will published InterruptVector component for Kinetis and there will be no such limitation.

best regards

Vojtech Filip


View solution in original post

0 Kudos
8 Replies
980 Views
BlackNight
NXP Employee
NXP Employee

Hello,

there is a 'InterruptVector' component you can add and use it to point to your own interrupt vector entry:

 

Hope this helps,

BK

983 Views
crezyoz
Contributor IV

Hmmm.. yes.. So there is the problem. Codewarrior 10.2 tells me that component , the irq vector, is NOT implemented in this version.

 

So what does one use instead?

 

And wy isn't something so necessary and simple implemented at this point?

 

How do I get around that?

 

CW10.2 / K70

 

 

0 Kudos
983 Views
ProcessorExpert
Senior Contributor III

Hello,

 

could you please be more specific about your use-case? As far as I know that all interrupts are handled by components or in CPU component on Kinetis (except Reserved vectors), so commonly the InterruptVector component is not needed. You should use correspodning component to handle such vector.

 

As workaround you can use Init_UART to handle corresponding interrupt. In case you do not want to generate initializaation code by PEx, set Call Init method to no, however initialization code for interrupt controler and muxing will still be generated into PE_low_level_init.

 

InterruptVector component should published in CW V10.3 for Kinetis and CFV1+ families.

 

best regards
Vojtech Filip
Processor Expert Support Team

0 Kudos
983 Views
crezyoz
Contributor IV

Thank you.

 

Yes. I found the init_Uart and that is what I have been using but that's messy because it requires the init code to be in the PE generated file AND the ISR to be in events.c. I'd rather be able to work with my code in the files I want it to be in rather than being forced to split the functions for a UART, for example,  between three files. myUART.c, events.c and iniUart.c

 

There are quite a few necessary components that aren't enable in PE yet for Kinetis.

 

We need a way to override PE's control of the vector table. How soon till 10.3 is available for download?

0 Kudos
983 Views
ProcessorExpert
Senior Contributor III

Hello,

 

you can have the ISR in any file, the ISR need not be in Events.c, just set the Generate ISRs option to no to disable generation of ISRs into Events.c. Regarding CW V10.3, as far as I know that release of FINAL verison is scheduled in Q4.

 

best regards
Vojtech Filip

983 Views
crezyoz
Contributor IV

InitUart doesn't generate ISRs. It creates commented out skeleton ISRs that are in the .c file. In the comments is states that the ISRs must be in events.c or processorExpert.c. Otherwise.. I would hvae to add my .h files to vectors.c, which apparently I can not do. If I understood your comment correctly.

0 Kudos
984 Views
vfilip
NXP Employee
NXP Employee

Hello,

please find the example project of the proposed workaround with Init_UART and "Call Init method" property set to "no". It will ensure that you should be able to have your UART initialization code and ISR in one file (MyUART.c). Just please note that the interrupt controller and routing for UART is still initialized in CPU.c in this case.

In case this is not sufficient for you, currently the only another option is to make the Vectors.c file as read-only.

However, in CW V10.3 there will published InterruptVector component for Kinetis and there will be no such limitation.

best regards

Vojtech Filip


0 Kudos
983 Views
crezyoz
Contributor IV

Thank you.

I didn't see that. The component list filter was on for the K70. Which makes it a little more confusing as to what I can and can't use from the component list.

 

 

0 Kudos