I pulled up a pin level and set a idle loop(1200 times) and then pull down the pin level. The pin level is measured by a scope. I found a problem of code running time which might be relevant to S32 optimation options.
Here are the code:
SIU.GPDO.R=1; //pull up the pin 73
} //idle loop for 1200 times
SIU.GPDO.R=0; //pull down the pin 73
The system clock was set to 120MHz, so I thought the high level should be longer than 10us. However, when the optimization was chosed to None(-o0) the high level time of pin73 is about 330us! And when the optimization was chosed to Optimize(-o1) the high level time of pin73 is about 36us which I think is rational. And when the optimization was chosed to Optimize most(-o3) the high level time of pin73 is about 50ns which I think the idle is totally ignored by the compiler.
Question: The same code was also tested by CodeWarrior and the result is OK. So I think it might be relevant to the S32 compiler.