Custom firmware not working

I assembled the firmware and uploaded it to the FC using Cube programmer, but when rebooting the controller lights up red and does not connect to the mission planner, I also installed the firmware via apj.
For the sake of the test, I restored the repository to its original state, removed all my changes, but the firmware still does not work