Have you read the “STM32Cube MCU” section of the Wiki?
Preparations
Software:
STM32CubeIDE: for compilation and debugging
STM32CubeProgrammer: for programming STM32 devicesHardware:
LoRaWAN® Gateway connected to LoRaWAN® Network Server (e.g. TTN)A USB Type-C cable and a ST-LINK. Connect the Type-C cable to the Type-C port of the board for power and serial communication. Connect the ST-LINK to the SWD pins as follows
I believe the usb port is only used to supply power to the board and for serial monitoring.