I just found that the nucleo-h743xi:pwm config did not fail, so I dug into that and found that 
compiler optimizations play a role in whether the build completes.  With the "No 
Optimization" setting selected, the build fails. Turning on "Full Optimization" 
allows the build to complete. I also tested all of the common custom optimzation levels

-O    --> works
-O2  --> works
-O3  --> works
-O0  --> fails
-Os  --> works

Okay that makes sense.  At -O0 inlining of functions is disabled.  Therefore, it is as though the inline qualifier were not there.  Then, everytime you include a header file that has static inline functions, you will will get warnings that those functions are not used:

LD: nuttx
nuttx/staging/libarch.a(stm32_allocateheap.o): In function `mpu_configure_region': nuttx/arch/arm/src/armv7-m/mpu.h:281: undefined reference to `mpu_allocregion' nuttx/arch/arm/src/armv7-m/mpu.h:296: undefined reference to `mpu_log2regionceil' nuttx/arch/arm/src/armv7-m/mpu.h:298: undefined reference to `mpu_log2regionceil' nuttx/arch/arm/src/armv7-m/mpu.h:315: undefined reference to `mpu_subregion'

You can try removing the static from the inline function definitions in the header file.  The code should then compile, however, you could also get multiply defined functions at link time... Or maybe the linker is smart enough to allow multiples???

Putting inline functions in header files introduces lots of problem (especially if you are using C89).  If they are to be used in header files, at least they should not be declared static.


Reply via email to