
The Adafruit Motor Shield is build to work at 5V because the ARDUINO work at 5V.
Instead, the STM32 NUCLEO board, work at 3,3V.
For the different supply voltages the two boards are not compatible, to make them compatible you must do the two steps that are explained here.