Thank you for your help. I think I have it working. Yes, the F7 was already defined as a fan and that stopped the fan. The servo did work on the endstop pin, but the fan stopped. What I did in the end was:
M950 S0 C"duex.pwm5" ; assign GPIO port 0 to pwm5 on expansion board, servo mode
and use:
M280 P0 S80 ; set 80deg servo position on GPIO port 0
to move the servo. This is all very new to me, thank you for your help.