4

My source files are *.ino, but after compilation there aren't any other files placed in the folder. Does the compiler generate intermediate assembler, and if so, where does it leave them? Or is the machine code available somewhere?

  • 1
    1) If you switch to a Makefile build or in some other way can customize arguments then you can ask avr-gcc to produce assembler ouput. 2) Alternately you can use avr-objdump to disassemble binary (or with the aid of objcopy, hex) ouput back to assembly mnemonics. With an original unstripped elf binary objdump may be able to print many symbols (the usual way of producing a list file), but with a raw binary or hex file those are permanently lost. – Chris Stratton Feb 9 '15 at 15:45
  • @ChrisStratton: Thanks. Can you elaborate on 1)? I know makefiles are commonly used by software developers, but I don't have any experience with them. – Joris Groosman Feb 9 '15 at 15:56
  • There are various stock Makefiles you can find online to build an Arduino project with greater control of the details. Not able to dig one up for you right now. There may also be ways to customize the IDE's commands, but the IDE has so many other problems I'm not sure it's worth the bother. – Chris Stratton Feb 9 '15 at 15:58
  • You can find Arduino compatible makefiles in the embedxcode repository at embedxcode.weebly.com You will probably look at the arduino15avr.mk file in particular. You can change this file to have assembler output save and place where you want it to be. – MAC Feb 9 '15 at 18:45
6

My source files are *.ino, but after compilation there aren't any other files placed in the folder.

Correct. The Arduino IDE performs compilation in a separate temporary directory, whose location you can see if you enable verbose compilation in the IDE options.

Does the compiler generate intermediate assembler, and if so, where does it leave them?

By default GCC (which the Arduino IDE uses) does not leave intermediate assembly language files on disk. You must pass the --save-temps argument to have it leave them in the current directory, or --save-temps=obj to save them in the output directory.

Or is the machine code available somewhere?

The machine code is available in the .elf and .hex files generated in the temprary directory.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.