This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

GCC using app_pwm with -O0 -g3 (debug mode) cause unknown function

Using and GCC with compilation options without optimization -O0 and with debug -g3 throw error during compiling for an unknown function pwm_calculate_timer_frequency.

Removing inline statement permits to compile, but I don't know if there is some side effects.

//app_pwm.c, line 520

inline nrf_timer_frequency_t pwm_calculate_timer_frequency(uint32_t period_us)

to

nrf_timer_frequency_t pwm_calculate_timer_frequency(uint32_t period_us)

Is there someone to explain why?

Parents
  • I faced same problem some weeks ago. My program does not work if I turn on optimization (still have to debug that), so I found that if you use optimization level "-Og", it will optimize very little, making you able to debug as normal AND to compile inline functions.

    Conclusion: for debugging use -Og and once ready for production use -O3 (and make sure it works fine) .

Reply
  • I faced same problem some weeks ago. My program does not work if I turn on optimization (still have to debug that), so I found that if you use optimization level "-Og", it will optimize very little, making you able to debug as normal AND to compile inline functions.

    Conclusion: for debugging use -Og and once ready for production use -O3 (and make sure it works fine) .

Children
No Data
Related