Closed
Description
Describe the bug
Execute bit is not set on the hid-flash
binary. This causes flash upload to fail when using HID bootloader.
The permission mode for this file is currently:
$ cd /home/brian/dev/arduino-1.8.16/portable/packages/STMicroelectronics/tools/STM32Tools/
$ ls -l 2.1.0/linux/hid-flash
-rw-r--r-- 1 brian brian 42728 Sep 28 15:00 2.1.0/linux/hid-flash
To Reproduce
- Install Arduino IDE 1.8.16 on Ubuntu 20.04.
- STM32duino 2.1.0 in Arduino IDE.
- Install HID Bootloader into STM32 blue pill (https://github.com/Serasidis/STM32_HID_Bootloader).
- Select "Upload Method: HID Bootloader 2.2" in IDE menu.
- Attempt to upload any sketch.
Result:
java.io.IOException: Cannot run program "/home/brian/dev/arduino-1.8.16/portable/packages/STMicroelectronics/tools/STM32Tools/2.1.0/linux/hid-flash": error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at java.lang.Runtime.exec(Runtime.java:485)
at processing.app.helpers.ProcessUtils.exec(ProcessUtils.java:11)
at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:129)
at cc.arduino.packages.uploaders.SerialUploader.runCommand(SerialUploader.java:383)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:197)
at cc.arduino.UploaderUtils.upload(UploaderUtils.java:77)
at processing.app.SketchController.upload(SketchController.java:732)
at processing.app.SketchController.exportApplet(SketchController.java:703)
at processing.app.Editor$UploadHandler.run(Editor.java:2075)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: error=13, Permission denied
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
at java.lang.ProcessImpl.start(ProcessImpl.java:134)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 11 more
An error occurred while uploading the sketch
Expected behavior
Compiled binary should upload properly.
Desktop (please complete the following information):
- OS: Ubuntu 20.04.3 LTS
- Arduino IDE version: 1.8.13, 1.8.16
- STM32 core version: 2.1.0
- Tools menu settings if not the default: [...]
- Upload method: HID Bootloader 2.2
Board (please complete the following information):
- Name: STM32F103CB "blue pill"
- Hardware Revision: [...]
- Extra hardware used if any: [...]
Additional context
The same binary in 2.0.0 has the execute bit set:
$ $ cd /home/brian/dev/arduino-1.8.13/portable/packages/STMicroelectronics/tools/STM32Tools/
$ ls -l 2.0.0/linux/hid-flash
-rwxrwxr-x 1 brian brian 42728 Apr 14 15:00 2.0.0/linux/hid-flash
The problem is fixed if I manually set the execute-bit:
$ chmod +x 2.1.0/linux/hid-flash