Go Down

Topic: How is the Due / SAM core arranged in the Arduino IDE ? (Read 2342 times) previous topic - next topic

ninja2

So I recently learnt the Arduino open source IDE is on Github and that includes the Arduino SAM core.

I'm curious to know how the Githib structure relates to the Arduino IDE for Due (under C:\Program Files (x86)\Arduino on my PC).

For example the other day I was trying to get Wire1 port SDA1/SCl1 working on my Due and went looking for the relevant Wire.h / Wire.cpp and twi.h.c for SAM/Due. But the sub-drectory C:\Program Files (x86)\Arduino\hardware\arduino only has the AVR core. The is no SAM sub-directory here, and elsewhere only an unhelpful directory containing a ServoTimer library

Maybe Wire/twi is not best example as under avr I can see the Wire library and (mutiple) copies of twi, and maybe these are what Due uses anyway. But my question is a general one: to what extent is the github structure replicated on my PC, and why don't I find any sam core sub-directories?

TIA

westfw

1) You have to "install" the Due boards before the compiler and core and such exist within your IDE installation.
2) Turn on the verbose compilation option in the IDE preferences to see where it has put everything (yeah, it has a standard place, but that place changes depending on version and installation settings.  Looking at the compiler output ALWAYS shows you where they are.)
3) I'm not quite sure how the core/etc goes from github "part of the IDE" to production "separately installable module."  It's obvious for the SAMD (Zero) boards - they have a separate github repository as well...

ninja2

My board manager shows I have the Due installed (SAM 32bits ARM-Cortex-M3) which is no surprise as I have compiled/run maybe 10 different sketches on my Due over recent weeks.

I'll try verbose mode as you suggest, maybe that will unravel the mystery a little!

cheers++


julyjim

In very generic way - after loading the compiled IDE you have  download/Arduino  structure and allegedly after first execution another directory structure -  in Linux .Arduino15 is build.
In  non tech description - you have a copy of Github  and a work copy you can modify.
Most of the shared core code have preprocessor  switches to select correct hardware , some hardware  depended cod eis in its own subdirectory - for example  there is "sam" directory.
Again - in very general - the "Open" concept is there , but the directory structure makes it difficult to implement in custom software.
But on the other and more prevalent philosophy of "this is for beginners " it is understandable why most of this is not published and left for  guesses. ( try to find how WDT is implemented in ARM / Due )

JIm

westfw

I like to invoke the "portable" option by creating the "portable" directory in the arduino install directory.
Then all of the board-manager installed stuff appears under <Arduinoinstall>/portable/packages/
(Due core would be in .../portable/packages/arduino/hardware/sam/1.6.9/cores/arduino/ )
On modern windows systems, this seems to require some fiddling with the directory permissions for "portable", and may have other detrimental effects, since preferences are also stored there.  (So it's not so good for multi-user PCs?)

I think it's horrible that the IDE installs add-on compilers in user-specific directories, but apparently that's the only "good" way to allow the add-ons to be installed by users running the IDE, according to microsoft :-(


ninja2

well this is all interesting, but as mentioned I don't have any \sam directories like those on GitHub on my Win10 single user PC, but I can use Due just fine?? So I'd say nothing is missing ...

julyjim

This probably won't help to answer the OP question, but try " tree " command.
It is actually overwhelming on Linux , but I did not check for options.


ninja2

Finally I found my sam directories ! ... using verbose compile as suggested (thanks)

I was only looking under: C:\Program Files (x86)\Arduino

but I found them  under: C:\Users\<username>\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.9

It's good to know, but I wonder why the IDE copies / puts the sam files there? Presumably a multi-user machine would have many copies, and aren't these files only ever read, i.e. not changed by compilation?

sylv41n

For Linux it is under: /home/user/.arduino15/packages/arduino/hardware/sam

Go Up