Can I supply the motor with a 3.3V voltage for simplicity
Well, you can but you'll lose torque and maximum speed.
... or do I need two separate buck converters: a 4V for the motor and a 3.3V for the STM32?
If 3.3V is needed for only the MCU then you can use a single DC-DC converter for 4V, and use an LDO (low dropout) regulator to get 3.3V from 4V. There are many options available with a dropout voltage of as low as 400 mV.
simulate this circuit– Schematic created using CircuitLab