Hi,
i have lpc54628 development board. i am developing code over it. So my problem is about optimization.
Using keil software to write code. But there are very big problem. Without optimization, the codes doesnt work. But when i opened optmization, on the debugger jumps another location that is not in my code sequence.
i attached my settings.
i am working firsty arm compiler 6. i dont know what can i do about this? any help please.
No, it is not header files. Most common reasons (but not the only possibilities) are
- not using the volatile keyword on a variable that is modified on mainline code and interrupt handler
- using a delay loop (e.g. for(int i=0; i<1000; i++)
> But when i opened optmization, on the debugger jumps another location that is not in my code sequence.
This is a common effect with optimized code. There is no one-to-one relation between C source lines and assembler instructions anymore, and lines or variables are removed (optimized out). Don't get confused with single-stepping your code.
First check if the code behaves correctly, i.e. according to your intended functionality.
If not, you might need to rework your code, as Converse suggested.
Most likely a problem in your code. See this FAQ and read the section on Optimised code fails to execute correctly (although written for gcc, the same advice applies).
https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Compiler-Optimization/m-p/468819