stlink-org / stlink

Open source STM32 MCU programming toolset
BSD 3-Clause "New" or "Revised" License
4.38k stars 1.24k forks source link

[feature] Added support for STLINK-V3PWR #1389

Closed Sazerac4 closed 5 months ago

Sazerac4 commented 5 months ago

I propose the integration of stlink-V3PWR. I'm not sure about the name : STLINK_USB_PID_STLINK_V3P

This PR is a follow-up to #1388

Nightwalker-87 commented 5 months ago

@florrant Is this version verified to be functional with the related device, or is this contribution yet incomplete? I am not able to test this without the respective hardware.

Sazerac4 commented 5 months ago

I got the "stlink-v3pwr" and this patch allow me to flash my programs:

2024-04-26T11:32:30 INFO flash_loader.c: Starting Flash write for F2/F4/F7/L4 2024-04-26T11:32:30 INFO flash_loader.c: Successfully loaded flash loader in sram 2024-04-26T11:32:30 INFO flash_loader.c: Clear DFSR 2024-04-26T11:32:31 INFO common_flash.c: Starting verification of write complete 2024-04-26T11:32:31 INFO common_flash.c: Flash written and verified! jolly good! 2024-04-26T11:32:31 INFO common.c: Go to Thumb mode

- `st-info --probe` show this too :

```bash
Found 1 stlink programmers
  version:    V4J5
  serial:     003A002A343251XXXXXXXXXX
  flash:      1048576 (pagesize: 2048)
  sram:       98304
  chipid:     0x415
  dev-type:   STM32L47x_L48x

It is work with a STM32U575 too :

st-flash 1.8.0-17-g1e41e0e
2024-04-26T11:42:59 INFO common.c: STM32U575_U585: 786 KiB SRAM, 1024 KiB flash in at least 8 KiB pages.
2024-04-26T11:42:59 INFO common_flash.c: Attempting to write 94128 (0x16fb0) bytes to stm32 address: 134217728 (0x8000000)
-> Flash page at 0x8000000 erased (size: 0x2000)
...
-> Flash page at 0x8012000 erased (size: 0x2000)
-> Flash page at 0x8014000 erased (size: 0x2000)
-> Flash page at 0x8016000 erased (size: 0x2000)

2024-04-26T11:42:59 INFO flash_loader.c: Starting Flash write for WB/G0/G4/L5/U5/H5/C0
  1/11  pages written
...
  8/11  pages written
  9/11  pages written
 10/11  pages written
 11/11  pages written

2024-04-26T11:43:03 INFO common_flash.c: Starting verification of write complete
2024-04-26T11:43:04 INFO common_flash.c: Flash written and verified! jolly good!

I don't plan to change anything else, unless you think I forgot something.