maple upload via cmd

Post here first, or if you can't find a relevant section!
Post Reply
hyur
Posts: 36
Joined: Fri May 27, 2022 7:42 am
Answers: 2

maple upload via cmd

Post by hyur »

I want to implement maple upload in a custom GUI.

I searched for this and that, and found that the following was output in the Arduino terminal.

C:\Users\NEO_IOS_107\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2022.9.26/win/maple_upload.bat COM8 2 1EAF:0003 C:\Users\NEO_IOS_107\AppData\Local\Temp\arduino_build_338499/ Blink.ino.bin C:\Program Files (x86)\Arduino

So I gave the same command in cmd run as administrator,
I expected the software upload to be successful.
But in cmd it outputs something like this:
'java' is not recognized as an internal or external command, operable program or batch file

is this the right way?
I want to upload compiled Arduino source (.bin) file to STM32 through my GUI.

Any advice is appreciated.

thank you
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: maple upload via cmd

Post by ag123 »

Preferably, start with the STM core
https://github.com/stm32duino/Arduino_Core_STM32
https://github.com/stm32duino/wiki/wiki
which has support of many more boards / and chips

For 'Roger's core' (libmaple)
there is also a bunch of wiki to read up on, especially the 'installation' part
https://github.com/rogerclarkmelbourne/ ... STM32/wiki

and you need to install java and use Arduino ide 1.8.x for that
hyur
Posts: 36
Joined: Fri May 27, 2022 7:42 am
Answers: 2

Re: maple upload via cmd

Post by hyur »

@ag123

I already made my own firmware via STM32F103RDT6.

I confirmed that uploading the STM32duino Bootloader through the Arduino IDE is working.

Now I want to upload via QTCreator rather than Arduino IDE.

While looking for a possible way, I found the Maple_upload.bat file, and it seems that I can upload the source in QTCreator as well as in Arduino IDE.

Arduino IDE is version 1.8.x and Java JDK 8 is installed.

Can stm32duino bootloader upload be used as it is through cmd?

after installing java
'java' is not recognized as an internal or external command, operable program or batch file
The error is gone.

However, the following error is output.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=5244, tid=0x00000000000070b8
#
# JRE version: Java(TM) SE Runtime Environment (8.0_351-b10) (build 1.8.0_351-b10)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.351-b10 mixed mode windows-amd64 compressed oops)
# Problematic frames:
# C [jSSC-2.8_x86_64.dll+0xb5db]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: maple upload via cmd

Post by ag123 »

if you used 'roger's' bootloader
https://github.com/rogerclarkmelbourne/ ... bootloader

in the old 'maple' traditions, after you press reset
https://www.youtube.com/watch?v=rvNIeKuXsxM
it blinks the led fast for a couple of time, if you press user (pb8) button during this time it drops into 'perpetual' mode.
(i think roger did an enhancement so that if you set boot1 it drops into 'perpetual mode', as well)
http://static.leaflabs.com/pub/leaflabs ... oader-mode
so that it waits for you to run dfu-util to upload the sketch.

if you don't have all that contraption, you need to upload your sketch after you press reset within the next 3-5 secs once you press reset.
(this works well enough for me, type the command and have it ready, press reset and hit enter, that upload the sketch)
preferably, you have the led that matches the maple mini or blue pill so that it blnks.
you need to upload your sketch when it blinks

Code: Select all

dfu-util -a 2 -RD sketch.bin
broodgalaxy
Posts: 1
Joined: Thu Jan 05, 2023 2:45 pm

Re: maple upload via cmd

Post by broodgalaxy »

It has been demonstrated and verified that the STM32duino Bootloader can be successfully uploaded using the Arduino IDE.

At this time, I plan to upload using QTCreator rather than the Arduino IDE.

While I was looking for a potential solution, I came across the file Maple upload.bat, and it appears that I am able to upload the source code using both QTCreator and Arduino IDE.
ozcar
Posts: 143
Joined: Wed Apr 29, 2020 9:07 pm
Answers: 5

Re: maple upload via cmd

Post by ozcar »

hyur wrote: Wed Dec 07, 2022 11:44 am ,,,

after installing java
'java' is not recognized as an internal or external command, operable program or batch file
The error is gone.

However, the following error is output.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=5244, tid=0x00000000000070b8
#
# JRE version: Java(TM) SE Runtime Environment (8.0_351-b10) (build 1.8.0_351-b10)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.351-b10 mixed mode windows-amd64 compressed oops)
# Problematic frames:
# C [jSSC-2.8_x86_64.dll+0xb5db]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
What I know about Java could be written on the back of a postage stamp (if you are old enough to know what a postage stamp is). However I think your current problem is that you now have multiple versions of Java installed, and you are using "the wrong one".

The Arduino IDE itself uses Java, so you must have already had at least one version installed. Now you have installed another version which it likely different to whatever other one(s) you already had, and the version you are getting when you run that batch file outside of the Arduino IDE is not compatible with whatever that batch file is trying to run.

Here is something you can try:

You obviously know where the maple_upload.bat file is. Open it with Notepad or your favourite editor, and insert a line with command "where java" (without the quotes) immediately before the line "java -jar maple_loader.jar ...". Save that and then upload something in the Arduino IDE. Now you will get some extra lines telling you all the places that it can find java.exe (it will use the first one). For me it finds it where the Arduino IDE is installed in <specific to my system>\arduino-1.8.18\java\bin\java.exe .

I see the upload batch file already has something to set the PATH before it tries to run the maple_loader.jar. Either use that or find some other way to get it to use the correct java.exe, and I think you will make some progress.
Post Reply

Return to “General discussion”