Link

Build flags

SimpleFOClibrary supports a few compiler options which might be interesting to advanced users. They are described below.

Available build flags

Build flags control the way the compiler generates the code for SimpleFOClibrary. Some are supported on all architectures, while some are MCU-architecture dependent.

FlagArchitectureDescription
SIMPLEFOC_DISABLE_DEBUGAllset this to disable the entire debugging code
SIMPLEFOC_STM32_DEBUGSTM32set to enable extra debug output for STM32 MCUs.
SIMPLEFOC_STM32_MAX_PINTIMERSUSEDSTM32maximum number of PWM pins configurable, default is 12 (up to 2x 6PWM, normally that’s plenty)
SIMPLEFOC_SAMD_DEBUGSAMD21 / SAMD51set to enable extra debug output for SAMD MCUs.
SIMPLEFOC_SAMD_MAX_TCC_PINCONFIGURATIONSSAMD21 / SAMD51maximum number of PWM pins configurable, default is 24 (for up to 4x6PWM, that should be enough ;-) )
SIMPLEFOC_SAMD51_DPLL_FREQSAMD21 / SAMD51expected frequency on DPLL, since we don’t configure it ourselves. Typically this is the CPU frequency. For custom boards or overclockers you can override it using this define. Default is 120000000
SIMPLEFOC_DEBUG_RP2040RP2040set to enable extra debug output on Raspberry Pico.
SIMPLEFOC_ESP32_USELEDCESP32force use of the LEDC PWM driver even on ESP32s that support MCPWM. Mainly useful for testing purposes, normally you would prefer MCPWM if it is available.