If you are using a St-link v2, connect Swclk, swdio, gnd and 3.3 V to corresponding pin (do not connect USB of lora-e5 mini)
You then have to press the both boot and reset when clicking on the connect button on the stm32programmer software. Before you can the program it you need to change read out protection to AA and press apply.