This is a short video demonstrating how to use a Hall Effect sensor and a magnet to implement Periodic Error Correction (PEC).
To configure OnStep for the STM32, change your Config.STM32.h to have the following values:
#define PEC_SENSE_PULLUP #define PEC_SENSE_STATE LOW
An example test sketch is provided at the end of this page. It lights up an LED when a magnet is detected and is useful for testing magnet and sensor placement.
Download and extract the .zip file, and compile it with the Arduino IDE.