LPC8N04 PMU register errors

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

LPC8N04 PMU register errors

673 Views
kenchill
Contributor III

Hi All

This is not a question but an answer to an issue we were having where non-optimised code worked and optimised code didn't work when using PMU registers of the LPC8N04.

If you are having this issue the problem is caused by the PMU access loops in the API getting optimised out.

Solve by wrapping the 'POWER_ReadPmuReg()' and 'POWER_WritePmuReg()' functions with the following to stop optimisation:

#pragma GCC push_options
#pragma GCC optimize ("O0")

...

...

...

#pragma GCC pop_options

Hope this is helpful to someone and saves some frustration.

Ken...

Labels (1)
0 Kudos
1 Reply

620 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Ken,

Thank you for your kindness, I think it is helpful to the other engineers.

BR

XiangJun Rong

0 Kudos