vladn 3 Posted April 26, 2014 Share Posted April 26, 2014 Is there a way to get an assembler listing using Energia (ideally a mixed c / assembler listing) ? Quote Link to post Share on other sites
spirilis 1,265 Posted April 26, 2014 Share Posted April 26, 2014 From cli, cd into the tmp build dir where it compiled the sketch then use arm-none-eabi-objdump -dS on the .elf file. Kudos to @@Rickta59 for teaching me that trick. vladn, igor and tripwire 3 Quote Link to post Share on other sites
energia 485 Posted April 26, 2014 Share Posted April 26, 2014 In case you are not able to figure out where the build folder is then you can get the it from the little black window (console) when you have "verbose output during compilation" turned on in the preferences or you can get to it using "Sketch->Show Compilation Folder". spirilis 1 Quote Link to post Share on other sites
vladn 3 Posted April 27, 2014 Author Share Posted April 27, 2014 Thanks, that works ! Quote Link to post Share on other sites
igor 163 Posted September 16, 2014 Share Posted September 16, 2014 Update to this answer - In Energia 0101E0013 there is a new option which you must be sure is checked in order to get the source code included in the listing. Go to the File menu, select Preferences, be sure there is a check mark next to "Include debug information in the output ELF file" Without this the listing will just be assembly language. @@energia perhaps an answer to the question about how to get a listing might be worth including in the FAQ? As an asside: be aware that the optimization level changed a lot between Energia 0012 (-Os, i.e. optimize for size) and Energia 0013 (-O0, i.e., don't optimize). So the code you get will depend a lot on which version of Energia you use. [Edit: the change in optimization was unintentional, it has been reported and a fix is available.] Quote Link to post Share on other sites
igor 163 Posted October 2, 2014 Share Posted October 2, 2014 I notice that listings generated this way contain source code for libraries, but not for the main sketch. How do I make it list the source for the main program as well? Would also be convenient if there was a way to get it to list the values of static constant variables (i.e. strings, etc.) Thanks. Quote Link to post Share on other sites
Lyon 3 Posted October 2, 2014 Share Posted October 2, 2014 HI, Don't know if there is a command inside Energia - but outside of it you may try: arm-none-eabi-objdump -h -S your_file.elf > your_file.lst (in Eclipse usually this is realised as post-build step). L igor 1 Quote Link to post Share on other sites
igor 163 Posted October 2, 2014 Share Posted October 2, 2014 arm-none-eabi-objdump -h -S your_file.elf > your_file.lst Thanks. That seems to deal with the listing variables part. (I had tried various options, but the help on -h did not make it a clear one to try.) (Energia does not have a command for this, although it would be nice if it did.) Now to figure out how to get the source for the main program included. Quote Link to post Share on other sites
Lyon 3 Posted October 3, 2014 Share Posted October 3, 2014 Hi, I have tried also -D (disassemble-all) with the same result. L Quote Link to post Share on other sites
pjacobs4 0 Posted October 6, 2014 Share Posted October 6, 2014 What is the fix for optimize for size? Update to this answer - In Energia 0101E0013 there is a new option which you must be sure is checked in order to get the source code included in the listing. Go to the File menu, select Preferences, be sure there is a check mark next to "Include debug information in the output ELF file" Without this the listing will just be assembly language. @@energia perhaps an answer to the question about how to get a listing might be worth including in the FAQ? As an asside: be aware that the optimization level changed a lot between Energia 0012 (-Os, i.e. optimize for size) and Energia 0013 (-O0, i.e., don't optimize). So the code you get will depend a lot on which version of Energia you use. [Edit: the change in optimization was unintentional, it has been reported and a fix is available.] Quote Link to post Share on other sites
igor 163 Posted October 6, 2014 Share Posted October 6, 2014 What is the fix for optimize for size? See this thread. There is an interim file you can download which updates Energia with the fix. (You probably have to create a 43oh account in order to download it.) http://forum.43oh.com/topic/5876-energia-0101e0013-how-turn-on-optimization-for-tivacc3200/?p=51199 A workaround for an individual project is to use the optimization pragma (mentioned in one of my posts in the above thread). Sorry my edit wasn't more informative to start with. With multiple discussion boards I sometimes forget what has been covered in which forum. Quote Link to post Share on other sites
pjacobs4 0 Posted October 6, 2014 Share Posted October 6, 2014 Works great! This has been killing me for the last month! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.