2017-04-05 11:27 AM
Hello,
I'm trying to connect to an STM32F072R8 discovery board using an ST-LINK/V2. I am using the ST-LINK utility to do so. The utility tells me I have an 'Internal command error' whenever I try to do this. Interestingly, I am able to program easily and successfully through the on-board USB programmer. I have ensured the following:
1) All appropriate connections are made - V_sense on VDDIO2, NRST is conencted
2) Target is externally powered
3) Flash erased (using on-board USB programmer)
4) Connect under reset mode
5) Attempted many different SWD frequencies (4 MHz to 5 kHz)
6) Updated the ST-LINK firmware.
I have attached a photo of my connections to between the ST-LINK and dev board. I have also attached the trace log output file when I try to connect with an SWD frequency of 100 kHz. I have also attached a screenshot of my settings.
I have searched the internet for other potential fixes, but I can't find anything. I greatly appreciate any help in debugging this issue! Thank you.
#stm32f072 #internal-command-error #swd2017-04-06 04:38 AM
Hello,
Is there a reason why you are not using the STLink embedded on the discovery board?
This seem easier to me, no wire necessary.
If you really want to use an external STLink, I recommend to:
- disconnect the on board STLink (remove the 2 'discovery' jumpers to be in STLink position) as it may be conflicting with the external one the application.
- provide some external supply. The external STLink may not be able to power your board (while the on-board STLink can...)
regards,
Max
2017-04-06 08:50 AM
Hopefully also a ground there too.
The DISCO's aren't designed to be used this way, there may be interference at the NRST and SWO pins, you'd want to make sure they are disconnected from the on-board ST-LINK, perhaps via solder-bridges, etc.
2017-04-06 11:23 AM
Hello,
Thank you for your replies. I wasn't using the on-board programmer because I was trying to verify my STLINK-V2s programming capabilities as it gave me the same error when I was trying to program a custom board I made. It turns out that the STLINK-V2 was in fact faulty. I was easily able to program my board with the same procedure using a different STLINK-V2.
One key indication for the fault was that it was falsely detecting a voltage of 1.6V even though the actual voltage was 2.9V and everything was wired correctly. If anyone else has this exact problem, it is also notable that it is possible to use the ST-LINK on the discovery board to program an external application, and this should be attempted. The process for this is outlined in the user manual (UM1690 for STM32F072RB) in section 4.1.2.
Thank you.