Why does my MCU work better when powered to Vcc and PA1=D2 instead of Vcc and GND?
Powering it via IO pin protection diode would make the GND to be a diode drop higher than the IO pin voltage. It might work better because of how different devices have different MIDI OUT buffers, not all MIDI OUT interfaces are alike, some are driven with push-pull output drivers, some are driven with open-drain outputs.



(Source: datasheet)