Go Down

Topic: Unable to change avr core files (Read 2039 times) previous topic - next topic

JOHI

Hello

I would like to experiment with arduino interrupt handlers.

The reason is because i need real time RS485 communication.

The lag in the main loop is too long, i would like to modify the interrupt handlers and, in the long term, build an extension library (software profibus DP).

My main problem is that i am unable to save modified files to the avr/cores/arduino directory.

Does somebody know how to change the rights on this automatically installed directory so i can change these files. (OS=Windows 7)


Best Regards
Johi.

Robin2

Sounds like a problem for a Windows forum.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Delta_G

Get linux, then all you need is chmod.
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

Robin2

Get linux, then all you need is chmod.
+1

But there is probably definitely a Windows equivalent.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

westfw

Get a new copy of the Arduino, as a zip file for un-priviledged user install.
unzip it, and then (BEFORE YOU RUN ANYTHING) create a directory called "portable" in the top level directory (next to the "hardware" directory.)
This will give you a separate copy of the IDE that you should be able to modify as much as you want (and it will also leave behind the "unmodifed" main IDE...)


Robin2

create a directory called "portable" in the top ...
Just out of curiosity does the name "portable" have some special significance?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

JOHI

Hello,

I found a simple solution: It seems that the ability to modify is linked to the directory the files are in.
So if I copy them to another directory, I can modify and copy back.


For the solution presented by westfw (thanks for the reaction) I have a question: if the same file is in portable

and in the other directory how can one make sure the right file is used during compile ?

Does the environment have some kind of include path settings one can modify ?

Is portable a specific name or identifier related to the IDE ?

Best regards,
Johi.

Delta_G

Once you had those two directories, portable and the original one, you would essentially have the IDE installed twice.  Remember, the IDE is just a java program, and everything in it uses relative paths.  So if you run the copy of the program in portable directory it would use the stuff in that directory and if you ran the copy that is in the original directory it would be a completely different (although identical) program running that would use the stuff in that directory. 
|| | ||| | || | ||  ~Woodstock

Please do not PM with technical questions or comments.  Keep Arduino stuff out on the boards where it belongs.

Robin2

Once you had those two directories, portable and the original one,
I guess then that "portable" could be replaced by "any-old-name"

On this Linux laptop I have 3 versions of the IDE and no restrictions on editing any of the files.

I found a simple solution: It seems that the ability to modify is linked to the directory the files are in.
So if I copy them to another directory, I can modify and copy back.
Presumably it is also possible to change your rights to the original directory so that you can modify the files without all that copying business.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

westfw

No "portable" is actually a magic directory name.   See https://www.arduino.cc/en/Guide/PortableIDE

A windows installer will normally put a lot of the files in system directories where (in theory) a normal (non-admin) user SHOULD NOT be able to modify them.  That's one of the purposes of an installer!  Whether you get similar behavior on other operating systems will depend on how you install it (I suspect if you use a linux package manager to install on your linux system, you'll end up with Core files that aren't editable as well.  (This isn't recommended, though.  The package managers installs tend to be out-of-date and sometimes badly constructed.)

The "portable" features isn't actually necessary to get editable Core files (just using the Zip download instead of the installer should get you that), but it adds other behaviors that (IMO) are nice to have once you're dealing with multiple versions of the IDE on the same computer...

Robin2

#10
Jul 29, 2017, 08:45 am Last Edit: Jul 29, 2017, 08:48 am by Robin2
No "portable" is actually a magic directory name.
Thanks - that's interesting.

I don't use the Arduino installer - just download and unzip to a convenient directory. That's one of the nice things about programs that use the JVM.

I suspect it is an incredibly small percentage of privately owned PCs and laptops that are used by more than one person and where those people need to be protected from each other. Rather than 5 users per PC I have 5 PCs per user :)

...R

Two or three hours spent thinking and reading documentation solves most programming problems.

westfw

Quote
I suspect it is an incredibly small percentage of privately owned PCs and laptops that are used by more than one person and where those people need to be protected from each other.
Sysadmin wisdom is that by running as a "normal user" instead of an "administrative user", you can cut down on your risk of malware infections by quite a bit, and so it would be a good idea to run as a "normal user" for most of your Windows use.

I'm not entirely convinced, and this seems to come with some pretty significant downsides in terms of convenience (as in this exact example), but it IS a reason that even a privately owned PC might run into file access problems...


JOHI

Hello Westf,

I did what you proposed: downloaded a .zip, extracted the files to c:/program files (x86) and made a new
folder "portable" in the same directory "hardware" resides. This before running Arduino.exe for the first time.
(This after I uninstalled my installer - based Arduino IDE version)

The result was not so good: Arduino refuses to start because it cannot create a folder where it can put its sketch. What can be the cause of this ? Is this again a problem with rights ?

The system I am using is my own private owned computer, I run Quartus, Visual Studio, Netbeans without any rights problems whatsoever. The install is a standard win7 install, my system is a Dell Precision 3620, I am administrator and the only user on this system.

Thanks for addtional help.

Best Regards,
Johi.

JOHI

Dear All,

Thanks for Your help:

One step father: I needed to take ownership of the Arduino directory and its subdirectories. I transferred the ownership from system to my user. Now I can start the Arduino program, make sketches and modify the system .c/.cpp files.

(https://technet.microsoft.com/en-us/library/cc753659(v=ws.11).aspx)

Now let us try do compile a modified system file and see where we get...


Best regards,
Johi.

Robin2

With Linux I can just download the IDE as a ZIP file and extract the contents to any directory that I want - no need to run any installer.

Is it not possible to do that on Windows? The IDE is just a Java program.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up