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...
Hi, Ken,
Thank you for your kindness, I think it is helpful to the other engineers.
BR
XiangJun Rong