Via DFU Mode
STM32L151CCU6 had already included DFU Bootloader, it means just need a Micro USB cable, users can download .elf/.bin files into the board.
How to access DFU mode.
If the board is not connected to the computer —— press the “USER” button of the Lora node before inserting it into any USB port of the computer (press the “USER” key all the time before inserting, and release it after connecting to the USB port)
If the board had connected to the computer —— Keep the “USER” button pressed → Press the “RST” button → Release the “RST” button → Release the “USER” button.
If enter DFU mode successfully (with the driver is installed correctly), you can see the device named “STM32 BOOTLOADER” in the device manager. In the STM32CubeProg software, select USB and click “Connect” to read the chip information.
Open a .elf/.bin file and click the “Download” icon.
The advantage of using the DFU mode is that you can easily find a Micro USB cable. But the disadvantage is that there is no way to simulate online.