First image is edit of image 2. Use this circuit to build unidirectional motor control using PWM.
Ignore 3v pin, MOSFET can be any mosfet having small threshold gate-source voltage eg, 30N06, Fairchild TO52-AA. These MOSFETS are very small, it will be not easy to connect it to bread board. Everything after the first image are questions.
I have taken help from previous posts to redraw the circuit, but the 6v motor is not driving at all. However, instead of connecting PD12 pin, if I connect 5v pin from STM board , motor rotates good without PWM. MOSFET Gate is connected to PWM signal, Drain is connected to motor and Source to Ground. Frequency used in STM board for the pin is 10kHZ.
Details of mosfet used is here.
Also, there is an onboard LED connected to pd12 pin in stm32f407 board, it blinks as written in the code, this shows that PWM signal is working fine.
What changes should be done so that motor can be controlled unidirectionally using only the software code written for board? what is wrong here. Is the signal of 10-20mA from microcontroller not enough for MOSFET to amplify it?