The following pages describe how to setup a programming enviroment for bare-metal programming of the STM32F401RE as well as explanations for the setup of the MCU’s peripherals for driving and reading the TCD1304.

The following is (supposed to be) a flowchart for the UART-firmware. It’s not super accurate, so if there are discrepancies with it and the descriptions in the links above, the descriptions should be your reference (or even better the source code):