Go Down

Topic: How to view the raw C / AVR code generated by IDE before compliation? (Read 1 time) previous topic - next topic

eriknyquist

So I write my arduino code in the IDE, and with one click of a button, the compiled binary is whizzing down my USB cable to Arduinos flash. Simple!
However, sometimes I want to see the straight C code that sits behind my Arduino code in the libraries.  The IDE must dump a .c file in some temporary location before it becomes hex and goes to my board.....how can I see this C file?

EVP

Cant you just look at the libraries your using. In their folder is a .h file and a .cpp file you can open them in a text editor or notepad2 is good. Sometimes you will need to to reconfigure them.

eriknyquist

yes, that is one way of doing it, if you have a LOT of spare time.....also seems such a waste since the IDE generates a .c file anyway. There must be a way of getting a dump of this .c file.

KeithRB

I don't think it does create a .c file. I think it goes straight to intermediate code and then assembly language.

PeterH


yes, that is one way of doing it, if you have a LOT of spare time


I don't understand why you think that the time taken is "a lot". The source code for the libraries you use is readily available under the Arduino directory (for the standard libraries) and under your sketches directory (for libraries that you have added).

If you want to see what your sketch looks like after the IDE has converted it from .ino to .cpp then you can turn on verbose output in the IDE options and then look for the message telling you where the IDE has placed your temporary files. I can't imagine many situations where that would be necessary, though.
I only provide help via the forum - please do not contact me for private consultancy.

Go Up