By default, the main sketch has an .ino extension. This type of file isn't recognised by the disassembly utility —e.g. arm-none-eabi-objdump


Disassembly requires using the C++ standard .cpp extension for the sketch.


Example: my main sketch has the standard .cpp extension and includes two variables.

 

uint16_t myFirstVariable;

uint32_t mySecondVariable;


The resulting compiled executable file .elf is then disassembled and provides all the details for the variables:

 

myFirstVariable = 0x1234;

253a: 4b06 ldr r3, [pc, #24] ; (2554 <setup+0x20>)

253c: f241 2234 movw r2, #4660 ; 0x1234

2540: 801a strh r2, [r3, #0]

mySecondVariable = 0x12345678;

2542: 4a05 ldr r2, [pc, #20] ; (2558 <setup+0x24>)

2544: 4b05 ldr r3, [pc, #20] ; (255c <setup+0x28>)

 

So the solution consist on selecting the standard .cpp extension when creating a new project.

 


An existing project using the an .ino extension can modified to have the .cpp extension. Please don't forget to 

  • update the #include "embed1.cpp" in main.cpp and 
  • change the Build Settings as follow:

 

//:configuration = Debug

SKETCH_EXTENSION = cpp


//:configuration = Release

SKETCH_EXTENSION = cpp


//:completeSettings = some

SKETCH_EXTENSION