Alvin: 'stm32flash' is not recognized..

Alvin
Posts: 4
Joined: Fri Feb 09, 2018 1:29 am

Alvin: 'stm32flash' is not recognized..

Post by Alvin » Fri Feb 09, 2018 2:04 am

Hi my name is Alvin
and I'm working in STM32 quadcopter from
http://www.brokking.net/ymfc-32_main.html
I have a windows 10 and
I get this error message when trying to upload code to my Blue-Pill board.

'stm32flash' is not recognized as an internal or external command,
operable program or batch file.

I am running Arduino IDE 1.8.5 down loaded the GITHub file and placed in the Arduino/hardware folder.
My Blue-Pill board is connected via FTDI to A9,A10
Board - Generic STM32F103C series
Variant - STM32F103C8 - 20K / 64k flash
upload method - Serial
THANK YOU

User avatar
mrburnette
Posts: 2190
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: 'stm32flash' is not recognized..

Post by mrburnette » Fri Feb 09, 2018 2:29 am

Alvin,

Welcome.

The WiKi discusses upload procedures for various OS http://wiki.stm32duino.com/index.php?title=Installation
With Windows, please note a batch file is provided to work some under-the-hood magic.

FOR SERIAL UPLOADING...
.

Ensure that the serial adapter is using 3.3 Volt (or else, that the Tx/Tx pins of the target device are 5 Volt tolerant).
Make sure you have installed a working driver for the serial adapter.
Connect power, ground, and Tx/Rx pins of the serial adapter to your STM32. Adapter Tx goes to STM32 USART1 Rx (PA10), Rx goes to STM32 Tx (PA9).
Plug in the serial adapter to USB. Take not of the serial port it's using.
In Arduino IDE, select Tools -> Upload method -> Serial and set Tools -> Port -> [your serial port].
Place your STM32 in 'native bootloader' mode by changing the BOOT0 pin value and resetting the board.
Upload the sketch in Arduino IDE: Sketch -> Upload.
Beware! When uploading in this way, the sketch may be uploaded to the start of the STM32's flash memory. If an STM32duino bootloader is installed there, this may get overwritten.
Please read this post too.viewtopic.php?f=2&t=3111

Alvin
Posts: 4
Joined: Fri Feb 09, 2018 1:29 am

Re: Alvin: 'stm32flash' is not recognized..

Post by Alvin » Sat Feb 10, 2018 1:03 am

Thank you Mr. mrbumette
It is very nice get help when we need.
I'm a very beginner programmer and take me a time for follow all your instructions and make sure I had done all steps.
thank you very much, I learn a lot.
That been sad, do you think my mistake is somewhere on installation of Arduino_STM32 files and I may should start all over.
Forgive me, I am a novice
Thank you

User avatar
mrburnette
Posts: 2190
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Alvin: 'stm32flash' is not recognized..

Post by mrburnette » Sat Feb 10, 2018 2:35 am

Alvin wrote:
Fri Feb 09, 2018 2:04 am
I have a windows 10 and
I get this error message when trying to upload code to my Blue-Pill board.

'stm32flash' is not recognized as an internal or external command,
operable program or batch file.


I am running Arduino IDE 1.8.5 down loaded the GITHub file and placed in the Arduino/hardware folder.
My Blue-Pill board is connected via FTDI to A9,A10
Board - Generic STM32F103C series
Variant - STM32F103C8 - 20K / 64k flash
upload method - Serial
I screwed-up. When I first read your post, I did not recognize this as a Windows message:
'stm32flash' is not recognized as an internal or external command,
operable program or batch file.
The file stm32flash.exercise is located here: https://github.com/rogerclarkmelbourne/ ... /tools/win
and should be installed in your Arduino\hardware\stm32_master\tree\master\tools\win
.. Therefore your installation is not picking up the path correctly.

... I will do a windows installation (I use Linux) and edit this post .....
UPDATE...
I took a new Windows 10 installation on a dual-core Intel notebook.
I installed the Arduino 1.8.5 IDE via the ZIP method
I downloaded the most recent STM32duino ZIP
I opened the Arduino IDE (this builds the path C:\Users\Ray\Documents\Arduino
I created the hardware directory under Arduino ... C:\Users\Ray\Documents\Arduino\hardware
I extracted the STM32duino ZIP into the hardware directory C:\Users\Ray\Documents\Arduino\hardware\Arduino_STM32-master
Using the IDE boards manager, I installed support for Due
I closed the ArduinoIDE
I opened the ArduinoIDE
I selected Generic STM32F103C series
Upload method: Serial
Port: 3
I compiled and uploaded (I have no board connected)
Build options changed, rebuilding all
Sketch uses 6972 bytes (10%) of program storage space. Maximum is 65536 bytes.
Global variables use 1984 bytes (9%) of dynamic memory, leaving 18496 bytes for local variables. Maximum is 20480 bytes.
stm32flash 0.4
Failed to init device.

http://stm32flash.googlecode.com/

Using Parser : Raw BINARY
Interface serial_w32: 115200 8E1
So, as you can see, the C:\Users\Ray\Documents\Arduino\hardware\Arduino_STM32-master\tools\win path is being set in the environment correctly (because the stm32flash.exe is returning the version number.)

At this point, I would suggest a complete uninstall/reinstall of the ArduinoIDE and the STM32duino.

Beyond that, I have no other suggestions at this time... something flaky is going on in your installation/environment.

Ray

User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Alvin: 'stm32flash' is not recognized..

Post by RogerClark » Sat Feb 10, 2018 4:51 am

Looks like the bat file can't find the path to stm32flash.exe

You could try modifying the bat file and put in a hard coded full path and see if that fixes it.

User avatar
mrburnette
Posts: 2190
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Alvin: 'stm32flash' is not recognized..

Post by mrburnette » Sat Feb 10, 2018 1:35 pm

RogerClark wrote:
Sat Feb 10, 2018 4:51 am
Looks like the bat file can't find the path to stm32flash.exe

You could try modifying the bat file and put in a hard coded full path and see if that fixes it.

... something is "broken" in the Op's computing environment.

I did a fresh install on a new Win10 box and all of the Arduino.cc procedures and all of our WiKi installation instructions came together and the notebook worked perfectly. So, our installation procedures for Windows work.

As the Op has not been able to upload, I cannot be certain that other issues do not exist beyond just the path issue. As simple as a Windows install is to do, it is difficult to imagine something having a hiccup, hey ... it is Windows and weird does happen there.

My thinking at this point is not to patch but to correct. Environmental issues always come back to bite and that would be another instance for forum support. With new users coming in daily, procedures must be black & while and simply work.

Ray

Alvin
Posts: 4
Joined: Fri Feb 09, 2018 1:29 am

Re: Alvin: 'stm32flash' is not recognized..

Post by Alvin » Sun Feb 11, 2018 5:28 pm

Solved!!
I follow Mr mrbumette in all his steps and I found the problem.
Inside of Arduino\hardware\stm32_master\tree\master\tools\win there was no stm32flash.exe.
When I tried to re-install my antivirus (Norton)
remove the file stm32flash.exe . So I went to settings and fix it.
Thank you very much.
:D

User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Alvin: 'stm32flash' is not recognized..

Post by RogerClark » Sun Feb 11, 2018 8:34 pm

:lol:

I wonder why your antivirus blocked that exe.. did it block all exes

Alvin
Posts: 4
Joined: Fri Feb 09, 2018 1:29 am

Re: Alvin: 'stm32flash' is not recognized..

Post by Alvin » Mon Feb 12, 2018 4:37 am

Nope
It say " There are many indications that this file is untrustworthy"
But it also say that "Thousands of users in Norton community have used this file"
:lol:

User avatar
RogerClark
Posts: 7680
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Alvin: 'stm32flash' is not recognized..

Post by RogerClark » Mon Feb 12, 2018 4:40 am

Perhaps they keep a list of common files and if its not something they have seen before they tag it is suspicious

I can't remember if I compiled it, or whether I got it precompiled. I have a feeling I needed to recompile it because I had to make some changes to fix bugs.

Post Reply