Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect way to open application with python #266

Closed
ninjaboy667 opened this issue Jan 30, 2024 · 6 comments
Closed

incorrect way to open application with python #266

ninjaboy667 opened this issue Jan 30, 2024 · 6 comments
Assignees
Labels

Comments

@ninjaboy667
Copy link

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
Copy link
Author

ninjaboy667 commented Jan 30, 2024

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
Copy link
Member

ederjc commented Jan 31, 2024

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

Copy link

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 github-actions bot added the Stale label Jun 17, 2024
@ederjc ederjc self-assigned this Jun 24, 2024
@per1234
Copy link

per1234 commented Aug 6, 2024

The problem is this code:

def create_jlink_erase_command_file():
cmd_jlink = 'cmd.jlink'
with open(cmd_jlink,'w') as f:
f.writelines(['r\n', 'h\n', 'erase\n', 'exit\n'])

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
Copy link
Collaborator

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
Copy link
Collaborator

This was resolved in release 3.3.0, so close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants