cancel
Showing results for 
Search instead for 
Did you mean: 

Can't flash STM32L151VE using STM32Cubeprogrammer via USB

SOUNDARYAR
Visitor

Hi, I have been flashing STM32L151VE by using DFUSe tool for a while. But I could find some difficulty after the OS upgrade to windows 11. Also, I found that the DFUSe tool may not support new ST Boards as per official STM website, so I started using STM32Cubeprogrammer tool, with which I am unable to flash.

When I select the erase option while flashing, it fails.

When I skip the erase option while flashing, file download works, verification fails and it works inconsistently.

Starting address for application part is 0x8008000.

I tried integrating the DLLs and API provided in the installed tool's folder. 

By using methods: massErase() and sectorErase() as per the API, response is successful but when I manually check the memory, they are not erased and even the downloadfile() method fails.

I tried doing the same with ST Link debugger interface and it works fine, but the issue still remains the same with USB DFU interface.

So, can you please let me know on how to use these APIs to erase and also help me in resolving the flashing issue with USB using STM32Cubeprogrammer tool?

1 REPLY 1
Anna18
Visitor
 

Hi @SOUNDARYAR — this is likely a DFU/driver issue on Windows 11. Try these quick fixes:

  1. Reinstall the STM32 Bootloader (DFU) driver from CubeProgrammer’s Drivers/DFU_Driver folder.

  2. Run CubeProgrammer as Administrator.

  3. Ensure memory mapping starts at 0x08000000, not 0x08008000.

  4. Disable Flash read-out protection in Option Bytes.

  5. Test an older CubeProgrammer version (e.g., v2.15).

  6. For the API, use this sequence:

     
    connect(port='USB1', mode='USB') erase(memoryArea='Flash', eraseMode='Mass') downloadFile('app.hex', address=0x08000000) verifyFile('app.hex', address=0x08000000)

If ST-Link works, hardware’s fine — the fault is with DFU communication under Windows 11.