XMC-for-Arduino icon indicating copy to clipboard operation
XMC-for-Arduino copied to clipboard

incorrect way to open application with python

Open ninjaboy667 opened this issue 1 year ago • 3 comments

Description: PC is running on local admin.

Code was pulled straight from the XMC 1100 sleep example file:

https://github.com/Infineon/XMC-for-Arduino/tree/master/libraries/DeviceControlXMC/examples/SleepModeXMC1100

image

Steps to Reproduce:

  1. install Jlink, Arduino IDE, install XMC board manager 3.0.0 on arduino

  2. Copy example files, attempt to upload

Expected Result:

permission denied

Actual Result:

**Frequency (1/1)

Windows 10

Arduino IDE 2.2.1

ninjaboy667 avatar Jan 30 '24 18:01 ninjaboy667

Fixed Please add in the documentation that the Arduino IDE needs to Run as administrator in order to use the XMC-flasher.py. A prompt could probably be added, or there surely is some way to run this without admin privileges ? @boramonideep

ninjaboy667 avatar Jan 30 '24 22:01 ninjaboy667

Hi @ninjaboy667, Thanks for submitting & elaborating on this issue.

We will definitely look into this and improve the docs, or better - find a way to run this without admin privileges.

Best regards Julian

ederjc avatar Jan 31 '24 07:01 ederjc

This issue is stale because it has been open more than 6 weeks with no activity. Please comment on this issue if it's still relevant or it will be closed automatically after 1 week.

github-actions[bot] avatar Jun 17 '24 14:06 github-actions[bot]

The problem is this code:

https://github.com/Infineon/XMC-for-Arduino/blob/bed41f488aa76eeb292c2e4117e0478e4d2c3e6b/tools/xmc-flasher.py#L71-L74

Is creating the cmd.jlink file in the current working directory. That is whatever path Arduino IDE was started from. It is common to install Arduino IDE in a path like C:\Program Files\arduino-ide and Windows imposes special security restrictions on this path, which causes the creation of the file to fail with this "Permission denied" error.

The solution is to adjust the xmc-flasher.py code so that it sets an absolute path for the cmd.jlink file instead of dumping it into whatever happens to be the current working directory. An appropriate path should be used for this purpose. Since this is a temporary file, it should be created under the system temporary folder.

per1234 avatar Aug 06 '24 07:08 per1234

Hi @per1234

Thank you very much for this hint. Yes, the download path creates permission problems if the Arduino IDE is installed for all users of Windows. We will fix this in the next release. @ninjaboy667

BR, Linjing

LinjingZhang avatar Aug 12 '24 14:08 LinjingZhang

This was resolved in release 3.3.0, so close this issue

LinjingZhang avatar Sep 10 '24 09:09 LinjingZhang