Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Unabe to upload via openocd to Adafruit Feather M4 (STM32F405) (Read 4344 times)
Marco S
Newbies
*
Offline


Posts: 5
Joined: Feb 8th, 2020
Unabe to upload via openocd to Adafruit Feather M4 (STM32F405)
Feb 8th, 2020 at 9:37am
Print Post  
Hallo,
I try to upload a simple program (blink) to a Adafruit Feather M4 (STM32F405)https://learn.adafruit.com/adafruit-stm32f405-feather-express using the upload method "STLink 2.1 + OpenOCD (vMicro)".

Uploading does not work and I got the output:
...
Info : device id = 0x10076413
Warn : Cannot identify target as a STM32 family.
Error: auto_probe failed
embedded:startup.tcl:476: Error: ** Programming Failed **


The Command line executed is:
C:\ProgramData\vmicro\tools\openocd-0.10.0.1\bin\openocd.exe -d2 -s "C:\ProgramData\vmicro\tools\openocd-0.10.0.1/share/openocd/scripts/" -f "interface/stlink-v2-1.cfg" -f "target/stm32f3x.cfg" -c "echo -n {****[vMicro]**** Uploading ELF :}" -c "reset_config; telnet_port disabled; program lf}} reset;reset_config;shutdown"

I think the problem comes from the wrong script because it is not a STM32F3x, it is a STM32F405. How can I change this ?

The selected board is "Generic STM32F4 series -> Adafruit Feather STM32F405".

Best regards,
Marco
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Unabe to upload via openocd to Adafruit Feather M4 (STM32F405)
Reply #1 - Feb 8th, 2020 at 1:19pm
Print Post  
Thanks for the report, and we will correct this in an upcoming release.

In the meantime if you add a Local Board.txt to the project and put the below entry in, it will override the upload script for the project. (Right Click Project in Solution Explorer > Add > Local Board.txt) 

Code
Select All
tools.openocd.upload.openocdscript=target/stm32f4x.cfg 

  
Back to top
 
IP Logged
 
Marco S
Newbies
*
Offline


Posts: 5
Joined: Feb 8th, 2020
Re: Unabe to upload via openocd to Adafruit Feather M4 (STM32F405)
Reply #2 - Feb 8th, 2020 at 4:30pm
Print Post  
Thank you. Cheesy It works now.
  
Back to top
 
IP Logged
 
Marco S
Newbies
*
Offline


Posts: 5
Joined: Feb 8th, 2020
Re: Unabe to upload via openocd to Adafruit Feather M4 (STM32F405)
Reply #3 - Feb 9th, 2020 at 6:50am
Print Post  
I tried the same fix with an other board: A ST Nucleo-144 STM32H743ZI (the older one with a ST-LINK 2.1)
https://os.mbed.com/platforms/ST-Nucleo-H743ZI/
.

The OpenOCD is invoked with -f "target/stm32f1x.cfg".
I changed the entry in board.txt to target/stm32h7x.cfg" but the file for the STM32H7 is missing:

embedded:startup.tcl:60: Error: Can't find target/stm32h7x.cfg

What should I do ?

Best regards
Marco
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Unabe to upload via openocd to Adafruit Feather M4 (STM32F405)
Reply #4 - Feb 9th, 2020 at 11:29am
Print Post  
Thanks for the information, we will double check these before the next major release.

It appears this config is not in the version of OpenOCD which is integrated with vMicro at present, but it seems others have authored this config in the meantime (an example at the below link).  If you download this and drop it into the "C:\ProgramData\VMicro\tools\openocd-0.10.0.1\scripts\target" folder on your PC, and then try it again.

https://github.com/ntfreak/openocd/blob/master/tcl/target/stm32h7x.cfg

We can integrate these in future builds, and if this works please let us know.
  
Back to top
 
IP Logged
 
Marco S
Newbies
*
Offline


Posts: 5
Joined: Feb 8th, 2020
Re: Unabe to upload via openocd to Adafruit Feather M4 (STM32F405)
Reply #5 - Feb 11th, 2020 at 4:54pm
Print Post  
This does not work for me. Maybe the most current stm32h7x.cfg file is not compatible with the openocd version from visual micro ?

The output is:

C:\ProgramData\vmicro\tools\openocd-0.10.0.1\bin\openocd.exe -d2 -s "C:\ProgramData\vmicro\tools\openocd-0.10.0.1/share/openocd/scripts/" -f "interface/stlink-v2-1.cfg" -f "target/stm32h7x.cfg" -c "echo -n {****[vMicro]**** Uploading ELF :}" -c "reset_config; telnet_port disabled; program }} reset;reset_config;shutdown"
Open On-Chip Debugger 0.10.0
The uploader process failed
Licensed under GNU GPL v2
For bug reports, read
     http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
:70: Error: invalid command name "dap"
in procedure 'script' 
at file "embedded:startup.tcl", line 60
at file g", line 70
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Unabe to upload via openocd to Adafruit Feather M4 (STM32F405)
Reply #6 - Feb 20th, 2020 at 1:17pm
Print Post  
I didn't see this relies on an update to OpenOCD as you say, and we have a new version which can be tried in advance of the release.  

1)  Download Updated OpenOCD ZIP and Extract to "C:\ProgramData\vmicro\tools\" (so you should have a new openocd-0.10.0.20200213 folder within tools)

2) Add the below to a local board.txt in the project for the STM32H7x board
Code
Select All
# Local Board.txt Configuration for STM32H7x and Updated OpenOCD Download
tools.openocd.upload.path=C:\ProgramData\vmicro\tools\openocd-0.10.0.20200213
tools.openocd.debug.build.openocdscript=target/stm32h7x.cfg
tools.openocd.upload.openocdscript=target/stm32h7x.cfg
tools.openocd.upload.openocddebugger=stlink.cfg
tools.openocd.upload.pattern="{upload.path}/{upload.cmd}" {upload.verbose} -s "{upload.path}/scripts/" -f "interface/{upload.openocddebugger}" -f "{upload.openocdscript}" -c "echo -n {{upload.elf.message}}" -c "reset_config; telnet_port disabled; program {{build.path}/{build.project_name}.elf} reset;reset_config;shutdown" 



3) Now the commands should run as expected for both upload and debug for this board

Let us know how it goes if you have time to try this out.
  
Back to top
 
IP Logged
 
Marco S
Newbies
*
Offline


Posts: 5
Joined: Feb 8th, 2020
Re: Unabe to upload via openocd to Adafruit Feather M4 (STM32F405)
Reply #7 - Feb 20th, 2020 at 8:13pm
Print Post  
Thank you again. Both boards are working now  Smiley
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2145
Joined: Feb 13th, 2019
Re: Unabe to upload via openocd to Adafruit Feather M4 (STM32F405)
Reply #8 - Feb 21st, 2020 at 12:14pm
Print Post  
No problem, and great to hear its all working on all boards now, thanks for the additional testing.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint