assembly output

Development environment specific, Arduino, Eclipse, VS2013,Em::Blocks etc
octavio
Posts: 44
Joined: Sat Apr 15, 2017 6:41 pm
Location: barcelona
Contact:

assembly output

Post by octavio » Tue May 23, 2017 2:16 pm

Hello,i'm using the arduino 1.16.13 (windows10) and would like to see the compiler output in assembly if possible.

stevestrong
Posts: 1832
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: assembly output

Post by stevestrong » Tue May 23, 2017 2:19 pm

Use the -S option to gcc (or g++).

You need to edit the platform.txt file and add the "-S" directive to C and/or CPP flags.

octavio
Posts: 44
Joined: Sat Apr 15, 2017 6:41 pm
Location: barcelona
Contact:

Re: assembly output

Post by octavio » Tue May 23, 2017 2:53 pm

Every time i edit the file i get compilation errors.what line of the attached file needs to be changed?
Attachments
platform.txt
(9.15 KiB) Downloaded 14 times

stevestrong
Posts: 1832
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: assembly output

Post by stevestrong » Tue May 23, 2017 5:01 pm

What kind of errors do you get?
It may be that you have to remove some other compiler directive in order to get this work.

octavio
Posts: 44
Joined: Sat Apr 15, 2017 6:41 pm
Location: barcelona
Contact:

Re: assembly output

Post by octavio » Sat May 27, 2017 3:01 pm

I edited this line:
compiler.cpp.flags=-c -g -Os -S {compiler.warning_flags} -MMD -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -DBOARD_{build.variant} -D{build.vect} -DERROR_LED_PORT={build.error_led_port} -DERROR_LED_PIN={build.error_led_pin}
and get this error message:
Arduino: 1.6.13 (Windows 10), Board: "Generic STM32F103C series, STM32F103CB (20k RAM. 128k Flash), Serial"

In file included from C:\Users\Octa\Documents\Arduino\OCTA5\OCTA5.ino:2:0:

C:\Users\Octa\Documents\Arduino\hardware\Arduino_STM32\STM32F1\libraries\FastLED-stm32f103/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.005

# pragma message "FastLED version 3.001.005"

^

c:/users/octa/appdata/local/arduino15/packages/rfduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe:sketch\OCTA5.ino.cpp.o: file format not recognized; treating as linker script

c:/users/octa/appdata/local/arduino15/packages/rfduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld.exe:sketch\OCTA5.ino.cpp.o:1: syntax error

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Generic STM32F103C series.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

User avatar
Rick Kimball
Posts: 1058
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: assembly output

Post by Rick Kimball » Sat May 27, 2017 3:05 pm

Why don't you just use arm-none-eabi-objdump:
$ ~/.arduino15/packages/arduino/tools/arm-none-eabi-gcc/4.8.3-2014q1/bin/arm-none-eabi-objdump -CS /tmp/arduino_build_224002/BlinkWithoutDelay.ino.elf | less
that is the linux version .. change paths for windows
-rick

octavio
Posts: 44
Joined: Sat Apr 15, 2017 6:41 pm
Location: barcelona
Contact:

Re: assembly output

Post by octavio » Sat May 27, 2017 3:28 pm

>Why don't you just use arm-none-eabi-objdump:
because i have no idea.
i will try it later,when i know where are the paths for windows.

User avatar
Rick Kimball
Posts: 1058
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: assembly output

Post by Rick Kimball » Sat May 27, 2017 3:43 pm

Probably for you:

c:\users\octa\appdata\local\arduino15\packages\rfduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\bin\arm-none-eabi-objdump.exe
-rick

octavio
Posts: 44
Joined: Sat Apr 15, 2017 6:41 pm
Location: barcelona
Contact:

Re: assembly output

Post by octavio » Sat May 27, 2017 4:16 pm

Ok,thanks.
appdata is a hidden directory,but i found the files and it works.

User avatar
RogerClark
Posts: 7489
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: assembly output

Post by RogerClark » Sat May 27, 2017 9:24 pm

%APPDATA% gets you to your appdata folder on windows

Depending on your version of the Arduino IDE, its either in appdata local or appdata roaming.

I think you can use %APPDATA%\local\arduino15\ .....etc...etc. on the newer versions of Arduino

Post Reply