DC Motor driven by P-MOSFET stops after half turn
Later on I've put instruction in main loop of STM to constantly turn on the N-MOSFET and the motor started to work properly.

Then the hardware is obviously working, and you have a software problem.