InterruptVector component and MQX Lite

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

InterruptVector component and MQX Lite

Jump to solution
1,930 Views
YS
Contributor IV

I'm using ProcessorExpert 10.2.0 for Kinetis TWR-KL25.

I tried to use LLWU interrupt, but there is no LLWU component in PEx.

So I tried to initialize LLW interrupt by using InterruptVector component from "CPU Internal Peripherals" -> "Peripheral Initialization" -> "Interrupt Vector".

When the project DOES NOT include MQX Lite, I could configure InterruptVector component with vector=INT_LLW, and generate code.

However when MQX Lite is included in the project, it fails to generate code as error message below.

Generator: FAILURE: at line 248: Unexpected status, please contact Freescale support. (file: Drivers\sw\RTOSAdaptor\Common_RTOSAdaptor.prg)

The same error happens when I tried different interrupt vector, such as UART2.

I attached screenshot of PEx just for reference.

pex.jpg

0 Kudos
Reply
1 Solution
1,053 Views
Petr_H
NXP Employee
NXP Employee

Hi,

It seems to be a  bug, I'll check that.  However, it's not necessary to do it this way. LLWU is handled directly by the CPU component.

Please switch to the Expert view mode by clicking on the 'Expert'  button in the inspector. This way all possible settings are visible.

The LLWU is configures in the CPU component property group Low power mode settings / LLWU settings. Enable this group and you can enable the wakeup sources and enable the interrupt request.

lowpower1.png

There is an event which is generated when the LL modes and the interrupt are enabled:

lowpower2.png

In Processor Expert, all the low leakage stop modes are handled by STOP operation mode. You need to define in the CPU component which stop mode is to be used.

For example:

lowpower3.png

Then in your code, you call the Cpu_SetOperationMode method to go into sleep, for example:

...

Cpu_SetOperationMode(DOM_STOP, NULL, NULL);  

...

In this place your code freezes and after waking up the CPU goes into the OnLLSWakeuINT event.

In that event routine, you should as soon as possible switch back to RUN operation mode and then do what you want:

...

Cpu_SetOperationMode(DOM_RUN, NULL, NULL);  

...

best regards

Petr Hradsky

Processor Expert Support Team

View solution in original post

0 Kudos
Reply
2 Replies
1,054 Views
Petr_H
NXP Employee
NXP Employee

Hi,

It seems to be a  bug, I'll check that.  However, it's not necessary to do it this way. LLWU is handled directly by the CPU component.

Please switch to the Expert view mode by clicking on the 'Expert'  button in the inspector. This way all possible settings are visible.

The LLWU is configures in the CPU component property group Low power mode settings / LLWU settings. Enable this group and you can enable the wakeup sources and enable the interrupt request.

lowpower1.png

There is an event which is generated when the LL modes and the interrupt are enabled:

lowpower2.png

In Processor Expert, all the low leakage stop modes are handled by STOP operation mode. You need to define in the CPU component which stop mode is to be used.

For example:

lowpower3.png

Then in your code, you call the Cpu_SetOperationMode method to go into sleep, for example:

...

Cpu_SetOperationMode(DOM_STOP, NULL, NULL);  

...

In this place your code freezes and after waking up the CPU goes into the OnLLSWakeuINT event.

In that event routine, you should as soon as possible switch back to RUN operation mode and then do what you want:

...

Cpu_SetOperationMode(DOM_RUN, NULL, NULL);  

...

best regards

Petr Hradsky

Processor Expert Support Team

0 Kudos
Reply
1,053 Views
YS
Contributor IV

Thank you. I've just figured out PEx has LLWU/LLS settings in CPU properties and confirmed KL25 can be wake up from LLS state by SW4.

0 Kudos
Reply