disabling IRQ for power profiles?

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

disabling IRQ for power profiles?

329 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by niels on Tue Oct 02 04:55:21 MST 2012
Hi there,

am running an LPC1313/01 here.
Trying to get all the performance out of it, so using power profiles.

Now I had a very strange bug, happening sometimes, causing a hard fault (exception 3).

Now: when I add __disable_irq() and __enable_irq() around all calls to set_power() and set_pll(), the problem is gone! :confused:

Question: am I doing the right thing? I don't see any of this in the user manual.

Some more info:
running LPC1313/01, with UART attached (IRQ based driver). Program changes to POWER_PROFILE_PERFORMANCE just after turning on UART, and back to POWER_PROFILE_DEFAULT before turning UART off. The 'hard fault' happens then, likely caused by a late arrival on the UART. Problem stack frame is set_power() -> IRQ (UART?) -> hard fault with funny PC

Any help appreciated..
0 Kudos
2 Replies

294 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by niels on Thu Oct 04 01:55:35 MST 2012
Hey, thanks for the reply.

Havn't seen the problem again after some heavy testing, so reassured.

Would be nice if the manual had some phrases on this..
0 Kudos

294 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by tha on Tue Oct 02 14:30:05 MST 2012
You are doing it right.  The interrupts should be disable before calling any power profiles calls.  For example, when calling the set_pll(), the pll needs time to lock.  If an interrupt occurs during this lock phase, the program would be running with an unknown clock.

So
-disable IRQ
-run power profile
-enable IRQ
0 Kudos