Hello,
3 years later I have exactly the same problem (like the poste above) when using the GPIO on K40.
Software:
=============
The pin is set to GPIO-mode, open drain is enabled and the pull-up/down is disabled.
Hardware:
=============
The pin is connected with serial resistor to 5V.
By setting the pin to output and set to low, I get 33 mV on this pin.
By setting the pin to output and set to high, I get 3,66 V on this pin.
So the Open Drain settings are not working. Is this a hardware bug?
Only when I set the GPIO to input I will get my desired 5V on this pin.
Does anyone can say how I could use the open drain mode?