disabling IRQ for power profiles?

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
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..