NOT Solved -MAPLE and STM32 not uploading, IDE2.03 EXCEPTION ACCESS VIOLATION

Post here first, or if you can't find a relevant section!
Post Reply
Gibsonmb
Posts: 4
Joined: Sun Jan 29, 2023 6:16 pm

NOT Solved -MAPLE and STM32 not uploading, IDE2.03 EXCEPTION ACCESS VIOLATION

Post by Gibsonmb »

I know there is a topic on this already but it is quite old and does not come to a conclusion. It seems to refer specifically to IDE 1.8.X which has Java installed by default. IDE 2.0.3 does not install or need Java so my issue must be something to do with the relationship between STMduino and the machine wide Java install.

Forgive this dumb question as I'm just trying to use this software to load build from the Arduino IDE V2.03 to my STM32F103. Should the maple_upload.bat file automatically run as part of the Ctrl-U compilation process within the IDE?
I ask because I have added the text "echo %path% > Ard-env.txt" into the file. If I run maple_upload.bat manually, it creates Ard-env.txt file. It does not create the Ard-env.txt file when I Ctrl-U and compile from within the IDE.

So why am I doing this anyway, because I'm getting the following when trying to compile and upload;

Sketch uses 12804 bytes (9%) of program storage space. Maximum is 131072 bytes.
Global variables use 2064 bytes (10%) of dynamic memory, leaving 18416 bytes for local variables. Maximum is 20480 bytes.
maple_loader v0.1
Resetting to bootloader via DTR pulse
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000007110b5db, pid=27268, tid=0x000000000000673c
#
# JRE version: Java(TM) SE Runtime Environment (8.0_361) (build 1.8.0_361-b09)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.361-b09 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [jSSC-2.8_x86_64.dll+0xb5db]
# An error report file with more information is saved as:
# C:\Users\Mike\AppData\Local\Arduino15\packages\stm32duino\tools\stm32tools\2022.9.26\win\hs_err_pid27268.log

Obviously I don't have a JAVA install with the IDE as 2.0 onwards does not use Java. I should be pointing to my Java install which I installed today to make sure I had an up to date version.

C:\Users\Mike>java -version
java version "1.8.0_361"
Java(TM) SE Runtime Environment (build 1.8.0_361-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.361-b09, mixed mode)

and is located here;
C:\Program Files\Java
C:\Program Files(x86)\Java

for the 32 and 64 bit versions

The Ard-env.txt produces the following if maple_upload.bat is run manually;

java\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Python38\Scripts\;C:\Python38\;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\QuickTime\QTSystem\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin\;C:\Program Files (x86)\IVI Foundation\VISA\WinNT\Bin;C:\Program Files\PuTTY\;C:\JTDX64\159-32A\bin;C:\WSJT\wsjtx\bin;C:\Users\Mike\AppData\Local\Microsoft\WindowsApps;C:\Users\Mike\AppData\Roaming\npm;C:\ProgramData\Mike\GitHubDesktop\bin;C:\Users\Mike\AppData\Local\GitHubDesktop\bin;C:\ProgramData\Mike\atom\bin;C:\Users\Mike\AppData\Local\Microsoft\WindowsApps

This is a plea for help, somebody must be able to help me fix the problem please.
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: NOT Solved -MAPLE and STM32 not uploading, IDE2.03 EXCEPTION ACCESS VIOLATION

Post by fpiSTM »

This method is a legacy one.
With new Arduino IDE 2.x as you stated there is no java.
To use it you can edit the script to add the full path of Arduino IDE 1.8.19 java binary.

I'm currently wondering if I will keep this upload method and try to implement new way to reset device on windows or simply remove it as it is very old and deprecated with new IDE. Same issue for Roger's core.
Gibsonmb
Posts: 4
Joined: Sun Jan 29, 2023 6:16 pm

Re: NOT Solved -MAPLE and STM32 not uploading, IDE2.03 EXCEPTION ACCESS VIOLATION

Post by Gibsonmb »

Thanks for your reply, can to tell me exactly which file to edit and what path to enter given I’ve never installed a previous version of the Arduino IDE to 2.03? I do of course have the latest version of Generic Java installed, 32 bit and 64 bit in their respective folders as above. Or, do I need to install an older version of the IDE just so I can point to it’s Java install?
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: NOT Solved -MAPLE and STM32 not uploading, IDE2.03 EXCEPTION ACCESS VIOLATION

Post by ag123 »

maple upload is based on dfu-util
https://dfu-util.sourceforge.net/
(a google search turns up others e.g.
https://dfu-programmer.github.io/
i've not tried it)

if you prefer to continue using 'rogers' bootloader, you would need a DFU utility that can do this upload.
Normally, this utility dfu-util is found in the tools folder of the distribution or somewhere there.

Manual upload:
To get your compiled binary, do a Sketch > export compiled binary. the *.bin file should be left in your sketch folder.

The upload command normally is
(press reset, you need to run this command in the 1st 5 seconds when the led blinks for the maple (roger's) bootloader.
there is no need to set boot0 for maple(roger's) bootloader)

Code: Select all

dfu-util -a 2 -RD sketch.bin
the alternatives are:
st-link v2
\https://www.adafruit.com/?q=ST-Link+STM ... =BestMatch
https://www.st.com/en/development-tools/st-link-v2.html
or even better st-link v3
https://www.st.com/en/development-tools ... minie.html

or
program it using a usb-uart dongle e.g.:
https://www.sgbotic.com/index.php?dispa ... page_id=48
for this you would need to set boot0 (and press reset) for the upload

note that for st-link v2 or uart uploads, you would need to select that from the menu in Arduino IDE.
this is because the sketch would be built for a different location i.e. 0x8000000 without offseting away from the custom bootloader.
and you can likely do that upload directly from within the Arduino IDE.
you need stm32-cube programmer for that
https://www.st.com/en/development-tools ... eprog.html
the benefit here is stm32-cube programmer is developed and supported by ST, so it'd likely work.
--
edit:
for that exception, i'd suggest you could try a different JDK
e.g.
https://www.oracle.com/java/technologie ... s/archive/
https://adoptopenjdk.net/index.html
first try version 8, then 11 etc, it may require strictly java 8 to work as newer java releases has api changes and actually reduced api that originally existed in java 8
Gibsonmb
Posts: 4
Joined: Sun Jan 29, 2023 6:16 pm

Re: NOT Solved -MAPLE and STM32 not uploading, IDE2.03 EXCEPTION ACCESS VIOLATION

Post by Gibsonmb »

many thanks, this give me lots of options to try.
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: NOT Solved -MAPLE and STM32 not uploading, IDE2.03 EXCEPTION ACCESS VIOLATION

Post by fpiSTM »

This issue will be solved soon.
I'm currently removing the java dependency.
See https://github.com/stm32duino/Arduino_Tools/pull/89
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: NOT Solved -MAPLE and STM32 not uploading, IDE2.03 EXCEPTION ACCESS VIOLATION

Post by fpiSTM »

The PR has been merged. A small binary is used to reset board in bootloader mode then dfu-utils is used to flash.
So all java stuff has been removed and can be used with IDE 2.0.
Post Reply

Return to “General discussion”