Hello, I have a problem with the signals. The image is distorted in some horizontal lines.

I confirm that the problem is in the Sync signals, because shorting any color signal with the horizontal Sync signal, the image is also distorted.

I tried other sketches and libraries, and they worked correctly, I tried to program the microcontroller with both cores, changing the bootloaders, trying another Blue Pill, but I couldn't get it to work.
For some reason, the problem is slightly greater when there are more colors displayed on the screen.
Any help is appreciated.
Hello, I have a problem with the signals. The image is distorted in some horizontal lines.
I confirm that the problem is in the Sync signals, because shorting any color signal with the horizontal Sync signal, the image is also distorted.
I tried other sketches and libraries, and they worked correctly, I tried to program the microcontroller with both cores, changing the bootloaders, trying another Blue Pill, but I couldn't get it to work.
For some reason, the problem is slightly greater when there are more colors displayed on the screen.
Any help is appreciated.