AnsweredAssumed Answered

Problem with code geting optimized out

Question asked by David Pfaltzgraff on Jul 5, 2015
Latest reply on Jul 6, 2015 by David Pfaltzgraff

I am trying to debug an SPI implementation and found that in the pin_mux_SPI() routine where the code is:


     /* PORTD_PCR4 */


     /* PORTD_PCR5 */


     /* PORTD_PCR6 */


     /* PORTD_PCR7 */



Only the first PORT_HAL_SetMuXMode insatance is executed. It appears that the remaining lines get optimized out. I tested this by setting the optimization level to None and all the lines get executed.


Is there a setting that would allow me to say "Don't optimize this section"?


More importantly, can the compiler be fixed?


My environment is for the FRDM-K22F board and KDS version 3.0.0 with KSDK version 1.2.0 running on Windows 7.