-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix and Extend STLinkV2.1 support. Compiling on Windows and Linux. #1
base: stlinkv21
Are you sure you want to change the base?
Conversation
* show ST-Link dongle information * can show and modify device configuration (show is only for ST-Link V2.1) * can modify STLink type and reported firmware version * can add "Anti-Clone" Tag and "Firmware Flashed/EOF" Tag (to make flashed firmware bootable without needing to exit DFU on V2.1) * can decrypt and flash firmwares taken from `STLinkUpgrade.jar`
13c3351
to
8ef48fc
Compare
Can you review with the new checkins |
I tried running the code from this branch to flash a Nucleo-F446RE, but it failed, and apparently bricked the STLink to the point where not even the official STLink updater can restore it? It no longer appears as a USB device and no lights turn on.
|
@DagAgren The bootloader should still be intact. Try connecting it to your PC and short SB11 on the back of the board (it is connected to the RST pin on the stlink chip), then try the STLink updater or the program again. |
Power the device and reset it. Look for SB11 on the bottom and short it. That should get you back to the bootloader. |
@GabyPCgeeK: I compiled your branch and get the same result: Current Device Configuration: Bootloader PID: 3748 STLink ID: 066EFF535452775187162947 Loaded firmware : /home/bon/devel/blackmagic/src/blackmagic.bin, size : 105224 bytes Unexpected DFU status : 3ne. 1.9% So there seems to be a problem with your code or some option is needed not well documented. |
Running my branch gets the device flashed again. BMP starts after flashing, but it does not start after replug ! ST programmer can load the stlink firmware and starts after replug. Any ideas? |
Can you try this version stlink-tool-dev.zip. The not starting after replug problem is fixed by writing |
Somehow it ended up being easier to find out that SB6 and SB10 can be used to connect another programmer directly, so I rewrote the bootloader which I guess reset the chip so the restoration worked. Wasn't entirely a waste of time figuring that out since I could then use it to write BMP directly. I tested it again now, and the programming failed the exact same way, but shorting SB11 did bring it back so I could run the restoration. There definitely seems to be a bug there. |
stlink-tool-dev.zip seems to work, though! Successfully wrote and accessed BMP with that. |
And I can confirm that after using -f it seems to start automatically. |
|
Compile on linux also warns: "src/stlink.c:1134:7: error: ‘hash_list’ may be used uninitialized in this function [-Werror=maybe-uninitialized] |
It seem Type D from Nucleo144 boards is missed:
|
@DagAgren: Any reason why you wnat to use GabyPCgeeK:stlinkv21 and not UweBonnes:stlinkv21? |
@UweBonnes You branch didn't find the board at all. @GabyPCgeeK's managed to put it in DFU mode and found it. |
@DagAgren: The problem was with a Nucleo-f446 with original ST firmware? Any output from running UweBonnes:stlinkv21 that could give me a hint what failed for you? |
Yeah, it worked fine with some v2 clones I had sitting around, but I think it just said it couldn't find any device at all when I ran it with the stock 446 with v2-1. |
UweBonnes:stlinkv21 needs
between line 144 and 145 in main.c. It opens the usb device but never claims the interface so it can't put STLink v2-1 into DFU mode. |
Managed to scroll back far enough to find the actual output I got when I was trying, which was simply this:
Replugging did not help, and just got the same error. |
@DagAgren: Can you please try with the changes I just pushed to UweBonnes:stlinkv21 and report back? Thanks! |
@UweBonnes I'm away from home for a few days but I'll try it when I get back! |
STLinkUpgrade.jar