If not, you may have to manually reset the board to get it to connect. Are the SWD pins connected to any other hardware in addition to SWD? What’s the power concept when programming the board - do you power it fully or is there a way to only power the logic side for programming?
And is the chip a genuine STM32 part? If not, the STLinks may refuse it.
Yes, but such drivers will have shoot-through protection, so won’t result in the board just exploding…
It’s more the rarer cases (like maybe some hoverboard drivers!) which use discrete drivers per FET and therefore have no shoot-through protection. Or mini-drivers where the MCU is directly driving half-bridges made of P and N channel FETs. Weird things like that.
Thanks for all the suggestions regarding my ST-link problem.
I soldered a wire to the NRST pin and connected it via 1k resistor with the RST pin of my “genuine V2 ST-link”. Also fed the driver board from 3.3V of the ST-Link.
Still the same error.
Then tried the “hotswap” option and voilá it connected and gave me the expected “can’t read memory” error.
I changed the option bits to read protection level 0 and erased the whole chip.
Now there’s no way back: sFOC or bricked are the options
I have a new problem with ArduinoIDE. It doesn’t connect to the ST-Link.
Asked me to install Stm32Cube, which I did. But the Cube SW doesn’t like my ST-Link.
It shows a wrong serial number and doesn’t connect.
I had a deja vú like when the FTDI guys came up with a new driver and all the clones didn’t work anymore…
I hate this $hit…I’m constantly fighting with compiler/environment issues instead of tackling the actual project.
[// rant end]
I thought, I could fork the simpeFOC github page and create a .bin file. Like I did with the EFeru-github.
But that didn’t work out as I hoped. It compiled 15 different files, 5 of them for STM32-MCUs, but not for the STM32F030.
I guess, some platformio-directives are missing?
I don’t know exactly what did the trick, reinstall StmCube or switch back to the former ST-Link driver.
But suddenly I could flash the chip via ArduinoIDE.
Although it still shows not connected
I guess, it shows that message, because the external ST-Links don’t work as serial monitor.
There seems to be a hack to make it work like a V2.1. But I’m too worn out to try that today.
For several reasons it’s a good idea to figure out the real RX0/TX0 pins and use an FTDI adapter for monitoring instead
The STLINK serial port is just a pass-through - you need to be connected to the UART tx/rx on whatever board you’re looking at - it does not do serial terminal via the swd pins.
Given the price of a STLink V3 Mini I really don’t know why one would mess around with clones
The VCP connection on the STLink is very practical, especially if the board happens to have the right header to match the STLink. But of course any other serial to usb converter on any serial pins can do the same job… it’s just another piece of hardware to worry about though…
I agree, except for when the target does not have ARM-14 header… I have not found a good flying probe set for the v3-mini (with 0.1" sockets). Maybe the black magic probes is a good one to use.
The Atmel ICE comes with a cable like that, which you can repurpose for your STLink but IIRC the pin1 is annoyingly on the other side… so you have to watch out.
Is the Black Magic specifically for STM32?
I avoid these issues by just putting the right header on my boards. But for an existing board you obviously have to make do with whatever headers they provided…
It’s really not… at $40 it’s a bit more than the mini or the clones, but it’s still a very cheap programmer/debugger.
If you look at what they want to charge you for a J-Link (which has the worst software you can imagine) or an Atmel ICE, or any of the FPGA programmers… $150 or more is normal… compared to the competition ST-Links are a bargain!
Back to topic.
I figured out, I can only use UART2 on my board.
TX2 is routed to SWCLK, which would be good enough for receiving data on the Serial Monitor.
But I don’t see anything with an FTDI adapter. Even the logicAnalyzer only sees a high on TX.
I suspect it’s the powerOn logic of the board? I tried a jumper on the On-button with a 40V PSU and later used the Charger on the charge-port. Both seem to work, as I could measure 5V for the hall-sensors, but no messages.