Author Topic: Arduino IDE internal structure  (Read 1598 times)

0 Members and 1 Guest are viewing this topic.

Offline ledtester

  • Frequent Contributor
  • **
  • Posts: 881
  • Country: us
Re: Arduino IDE internal structure
« Reply #25 on: July 21, 2019, 04:56:35 am »
The Arduino team has released  "arduino-cli" -- a command line interface to the Arduino tool chain:

I haven't tried it yet, but there is a "--debug" flag which is used to debug the CLI itself, and I'm sure it will show how the gcc compiler tools are called.
The following users thanked this post: edavid

Offline Rick Law

  • Super Contributor
  • ***
  • Posts: 2897
  • Country: us
Re: Arduino IDE internal structure
« Reply #26 on: July 22, 2019, 11:46:37 pm »
Can someone point me to a description of how the internals are organized?   I'm looking for a short detailed description of things like linker search paths, preprocessor symbol definitions, where libraries and header files  are located,  file and directory naming conventions, etc.

Coming from Greenleaf/Microsoft C (and Visual C++) background, the organization of include ".h" files to me seem very similar except the lack of a real "make" file controlled by the end user.  Also, unfamiliar to me was the multiple copies of similar header files apparently for different hardware but not well described anywhere until you look inside the content of those include files.

After initially digging into those includes, I conclude that the drop down selections (like what CPU and what Arduino board type, etc.) merely pre-define some #define names and include the right header.  I largely left it alone as something that I really don't need to know how it does it as long as it works.  Should I ever need to really know, (if I recalled correctly), Arduino IDE does have an option to be verbose about what it is doing - to the point of keeping all the temp files so looking into those temp files can tell me what the #define names expansions becames and what went on each step of the process.

The part the IDE I found most annoying (and initially confused the daylight out of me) - The IDE "make" is annoying in the short cuts it took in the spirit of making it simple but instead made it confusing:
I am still using V1.6.x, newer ones might have fixed this problem.  It automatically include all the .c/.cpp/.ino files in your project directory.  If I copied currentVersion.c to versionYesterdayAsBackup.c and left it in the same project folder, it would automatically compile both and link both into the project which of course causes a ton of compile/link errors.  Since this is done behind the scenes, I have no control of it.  I would prefer to have a drop down box or something that specify any additional files I wish to compile/link into this project instead of just grabbing everything in my project folder chain.
« Last Edit: July 22, 2019, 11:52:24 pm by Rick Law »

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 9893
  • Country: my
  • reassessing directives...
Re: Arduino IDE internal structure
« Reply #27 on: July 23, 2019, 01:59:03 am »
I largely left it alone as something that I really don't need to know how it does it as long as it works.
dittto!... one easy way to know which branch to compile without having to look at each single line is by removing the suspected unused code (files and directories) from the search path and compile the project. if success, that chunk of code is not used, vice versa...
It's extremely difficult to start life.. one features of nature.. physical laws are mathematical theory of great beauty... You may wonder Why? our knowledge shows that nature is so constructed. We simply have to accept it. One could describe the situation by saying that... (Paul Dirac)

Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo