Author Topic: MPLABX XC16 generate assembly listing file COFF / ELF agnostic  (Read 4431 times)

0 Members and 1 Guest are viewing this topic.

Offline ZeynebTopic starter

  • Regular Contributor
  • *
  • Posts: 233
  • Country: nl
Hi guys,

It took me some effort to configure MPLABX to get the assembly listing file the way I wanted. So I would like to share this with you as there are many users of Microchip parts on this forum I think.

This method works for me on my Windows XP x64 edition machine.
MPLABX v3.05 and XC16 v1.24

First you need to enable "Don't delete intermediate files" in the XC16 (Global Options)

Then in Building you need to enable "Execute this line after build"

In the field below I have:
C:\dev\MCU\gen_asm_listing\gen_asm_listing.bat ${DEBUGGABLE_SUFFIX} ${ImageDir} ${PROJECTNAME} ${IMAGE_TYPE}

You need to adjust the path part to point where you want the batch file to be. I have this purposefully outside the MPLABX installating folder. Because I might want to delete MPLABX and I might have forgotten about my tweak. So if MPLABX is deleted I still have that batch file.

The contents of the batch file is:

if "%1" == "cof" goto coff_file_format
:elf_file_format
@echo dump for ELF/DWARF
xc16-objdump -omf=elf -S %2\%3.%4.elf > %2\%3.%4.lst
goto end
:coff_file_format
@echo dump for COFF
xc16-objdump -omf=coff -S %2\%3.%4.cof > %2\%3.%4.lst
:end

Create this batch file at the path I just mentioned.

Now no matter whether you build with COFF or ELF you get the assembly listing in your [project dir]\dist\default\production folder.

You might want to set some other preferences for the assembly listing file. The documentation is in [your XC16 install folder]\xc16\v1.24\docs

There is the PDF file: MPLAB XC16 ASSEMBLER, LINKER AND UTILITIES User’s Guide. In paragraph 15.5 is the part about xc16-objdump command line options.

Good luck!
Zeyneb
goto considered awesome!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf