Just wanted to make a post with the issues I encountered while installing and the solutions I found for it:
First there was the extension cable which only had 3 instead of 4 leads (which I ordered from PSWPOWER).
I then went on by just directly connecting.
I cut off one end off of the ST-Link cable's plugs, and tried stripping the cables, but it only has 3 very thin strands in each wire, so it was pretty much impossible to strip.
So I just got some old wire (don't know from what, just some regular grey wire, with a core that looked like copper strands, not too thick but not too thin) from the shed, cut off 4 pieces, stripped the ends, and put a heat shrink on each end. Was a bit fiddly but it worked in the end.
I first got a build error (error 1), ''D:/Program' is not recognised as an internal or external command, operable program, or batch file', which was solved by reinstalling SDCC to 'D:/' instead of 'D:/Program Files'.
I also got some 'function decelerator with no prototype' warning when building, which was solved by installing SDCC 4.1.0 instead of 4.3.0.
After that it built it correctly, but I still couldn't flash. It said something about a wrong tool selection.
I tried fiddling around with the cables and put them in different configurations (3V/5V, with/without RST), but it didn't work.
Also tried the different configurations both with the screen on and off.
I suspected something was wrong with the ST-Link, so I downloaded the STM32 ST-Link Utility, but every time I tried to connect to target, it got an STLink USB communication error.
Going to target->settings I could see it was detecting it after connecting (did say 'Old ST-Link firmware/ST-Link already used' instead of the serial number) and if I was quick I could change one setting each time, but after I did or clicking refresh it loaded (seemingly froze) for a while and then grayed out the options. Until I reconnected it again.
This had the same behaviour with and without it connected to the speed sensor cable.
Tried with another laptop but had the exact same issue.
In the end I updated the firmware (should've known I had to when the utility said 'Old ST-Link firmware) with the STSW-LINK007 program. I'm not sure if it worked straight away, but I think I had to reconnect it again before it did. But to my surprise it actually went and updated, and after that in the utility it actually showed the serial number instead of 'Old ST-Link firmware', and it didn't freeze or gray out the options anymore.
After that it was just a matter of connecting it back to the sensor cable, and flashing the firmware.
I'm not sure if I did it with or without RST (IIRC without), and IIRC I did have to turn the screen on for it to work.
Seeing it flash so quickly made me wonder if it even really flashed anything, but going for a ride I could immediately feel the difference. It's a beast now! Finally not the slow, clumsy feeling, piece of crap it was.
I hope the modifications I did for cooling will be sufficient. Went extreme with cooling though so I should hopefully be fine. I did both the mod with a aluminium pieces around the motor core (smaller pieces between the studs, and a bigger piece around that), and I had my brother cut one of those heatsink plates out of copper for in between the motor core and housing. And of course plenty thermal compound between all the plates and the parts they're touching (used Arctic MX-4 as it has a pretty high thermal conductivity of 8.5 W/(mK)).
I set the maximum amount of Amps to 16 (at 48V), because I don't trust it above that without a temperature sensor even with the cooling mods, and it's plenty already. It gets up to 40kmh / 25mph easily with the settings I chose (if the speed is displayed correctly, which I still have to check. But it did feel like it).
No temperature sensor though so it'll just be a guess. It's not the most expensive kit tho, so not all too worried about burning it lol. And ambient temps don't get high here, we only get a few days a year where it gets above 30°C.
If it can keep it up like this it'll have been a better purchase than a BBS02 after all though. Just felt really crappy in comparison to that without the firmware mod.
It was this ShengYang ST-Link btw, bought from 'TZT 123 Official Store' on AliExpress (doesn't have an ST logo on the picture, but does in reality):
And bought the TSDZ2 (B version, so actually TSDZ2B), from 'pswpower Store' on AliExpress the 2nd of November 2022, for €235 at the time (IIRC I asked them to send from a European warehouse, while paying for it as if it was shipped to a Chinese warehouse, to avoid taxes. But I'm not 100% sure about that).