Project of SmartPendant for grblHAL
To build SmartPendant STM32CubeIDE is used To load firmware via USB STM32CubeProg is used
Full assembled custom board is be available there(US only): https://devtronic.square.site/
To make this project yourself, you will need three essential parts:
This handwheel also works from 3.3V. STM321F411 pins handwheel is connected to is 5V tolerant, so it can be powered from 5V.
Schematic vesion 1.3(and later versions, only layout slightly changed):

Latest firmware HEX file can be found in Release folder: SmartPendant.hex
To load new firmware STM32CubeProgrammer is used:
- If your device programmed with version 0.027.0 or later, hold top edge(MPG) button. Otherwise(not programmed, update failure, older version) hold BOOT0 button on the back instead.
- Connect SmartPendant to PC using USB-C cable(it should be powered only from the USB!) or hit reset button on the back if it already connected and powered.
- Couple seconds later release MPG or BOOT0 button.
- Open STM32CubeProgrammer. In top right corner choose "USB" from drop down list.
- If field "Port" in "USB Configuration" show "No DFU detected" click update button near it.
- Click "Connect" button - STM32CubeProgrammer should establish connection and show current device memory content.
- Click "Open File" in left to corner, select firmware HEX file, then click "Download" button in top left corner.
- When flashing is done, close STM32CubeProgrammer and power cycle the device or short press NRST button on the device to restart it.
Note: If during update you get and error, you may try to use different cable, anothger PC, connect device to the PC via USB hub(that is usually help by some reason) or slightly heatup STM32F411 MCU with hair dryer. This error appears because STM32 bootloader uses internal RC oscillator to measure crystal osillator frequency. According Application Note AN2606 external crystal oscillator can be in range 4...26 MHz with 1 MHz step. However higher frequencies has lower error margin which in some cases can cause incorrect frequency detection and errors during bootload process.
Starting from version 0.027.0 if firmware detects that top edge(MPG or KEY on BlackPill) button is pressed, it calibrates internal RC oscillator and makes jump to bootloader, which should mitigate problem described above.
Not relevant anymore: if flashing is successful, but firmware isn't work, check STM32CubeProgrammer log. If it says "sector 0000 does not exist" erasing operation wasn't successful and new firmware "merged"(write operation can only flip bits from 1 to 0) with old one. To fix this issue, press "eraser" button in bottom right corner and click "Ok" button in pop up window. After erasing is finished "Device memory" should show only FFFFFFFF. Flash new firmware after that.
Many thanks to Terje who made this project possible by adding another datastream to grblHAL.
