Infineon / XMC-for-Arduino

Integration of Infineon's XMC microcontrollers into the Arduino IDE.
Other
107 stars 69 forks source link

incorrect way to open application with python #266

Closed ninjaboy667 closed 2 months ago

ninjaboy667 commented 10 months ago

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 commented 10 months ago

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

ederjc commented 10 months ago

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

github-actions[bot] commented 5 months ago

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.

per1234 commented 3 months ago

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.

LinjingZhang commented 3 months ago

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 commented 2 months ago

This was resolved in release 3.3.0, so close this issue