compiler optimization

hi Team,

i am using  Microsoft Windows 10 Enterprise OS and segger 5.40.

i am using nrf52840 device in my project along with nrf5_SDK.

 i compiled pwm code with different optimization levels. and i observed flash memory size and executing speed is deceased then what about output acuracy. out accuracy is increases or decreses. if decreses what about critical devices when i connected. just now i checked with different optimization levels. but i did not find any difference. but i thought because it normal target board thats why we can't find difference. if it is critical target i think we can find difference.

Parents
  • Hi,

    Why would you expect the application optimization level to change the accuracy of the PWM? If PWM is implemented in SW, then I agree that its accuracy could be affected by optimization, but typically the PWM on nRF52xxx chips are handled by the HW PWM peripheral, or by the PWM library (implemented using HW TIMERs, PPI, and GPIOTE). If you are using the HW resources, optimization should only affect the speed of the application execution, so you might see faster interrupt handling when changing PWM parameters, etc. if you set a high optimization level.

    For simple applications, the CPU utilization might be low, reducing the need to do heavily optimize the application to make it run smoothly. Available memory might also be a good argument to perform optimizations. The cost of higher optimization levels are usually higher compile times. See this page for more details about Optimization levels.

    Best regards,
    Jørgen

Reply Children
No Data
Related