Smoking Motor Drive parts
simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. Redrawing in the conventional schematic layout (positive rail on top, ground on bottom with current generally flowing from top to bottom) aids comprehension.



Figure 2. Extract from the FQP27P06 datasheet.

Note that this device will turn on when the gate is about 3 V below the drain voltage. With a max of only 5 V available on the drain (from the GPIO) the transistor can never turn off. When M3 turns on you get "shoot-through" from the 12 V supply to ground and the high currents are destroying your MOSFETs.

Notice how much more easy it is to visualise the voltages and shoot-through when the circuit is drawn correctly.