Go Down

Topic: {object_file} not working in custom platform.txt  (Read 165 times) previous topic - next topic


I think this is the right place to ask this...

I'm just starting to create my own board profile following the guide here and I am not sure why the {object_file} isn't working in the platforms.txt file. From what I understood, the {object_file} is supposed to be auto-populated by the IDE, but I'm just getting an empty string. Here's the relevant line:

Code: [Select]
recipe.c.o.pattern="C:\Program Files (x86)\Rowley Associates Limited\CrossWorks for ARM 3.7\gcc\arm-none-eabi\bin\cc1" {compiler.c.flags}  -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" -MQ "{object_file}" -MD "{object_file}"

And here is the verbose output from the Arduino IDE (see the very end)

Code: [Select]
"C:\Program Files (x86)\Rowley Associates Limited\CrossWorks for ARM 3.7\gcc\arm-none-eabi\bin\cc1" -quiet -fmessage-length=0 -fno-diagnostics-show-caret -mtp=soft -mcpu=cortex-a5 -mlittle-endian -mfloat-abi=hard -mfpu=vfpv4-d16 -mthumb-interwork -nostdinc "-isystemC:/Program Files (x86)/Rowley Associates Limited/CrossWorks for ARM 3.7/include" -D__SIZEOF_WCHAR_T=4 -D__ARM_ARCH_7A__ -D__CROSSWORKS_ARM -D__ARM_ARCH_VFP4_D16__ -D__CROSSWORKS_MAJOR_VERSION=3 -D__CROSSWORKS_MINOR_VERSION=7 -D__CROSSWORKS_REVISION=6 -D__TARGET_PROCESSOR=SAMA5D31 -DCTL_TASKING -DNESTED_INTERRUPTS -DNDEBUG -D__ARM -Dsama5d3x -fPIC -std=gnu99 -fno-dwarf2-cfi-asm -fno-builtin -ffunction-sections -fdata-sections -fshort-enums -fno-common "-IC:\Users\Brian\Documents\Arduino\hardware\Amulet\sam\cores\sam\"  -DF_CPU=533000000L -DARDUINO=10613 -DARDUINO_MK-070C-HP -DARDUINO_ARCH_SAM   "-IC:\Users\Brian\Documents\Arduino\hardware\Amulet\sam\cores\Amulet" "-IC:\Users\Brian\Documents\Arduino\hardware\Amulet\sam\variants\Amulet" "C:\Users\Brian\AppData\Local\Temp\arduino_build_706746\sketch\Amulet_Test.ino.cpp" -o "" -MQ "" -MD ""

{includes} and {source_file} are also populated by the IDE and seem to be working here. Any ideas what I'm doing wrong?



Which version of the Arduino IDE are you using? I just tried inserting that property into the recipe.c.o.pattern in the Arduino AVR Boards platform.txt and it was populated correctly.


Thanks for the reply, pert. I was using 1.6.13 but I just upgraded to 1.8.2 and got the same result.

I also see other boards who's platform.txt recipes use the {object_file} and they do work as expected, so my first thought was that I mucked up my recipe. If that looks okay then I'm not sure where to poke around.


I noticed two things. First, my C++ compile recipe was set to
Code: [Select]
By copying the text in the c to the cpp pattern yielded a different result and the -o "{object_file}" actually worked, but just in the -o and not in my other -MQ and -MD options:

Code: [Select]
Generating function prototypes...
"C:\Program Files (x86)\Rowley Associates Limited\CrossWorks for ARM 3.7\gcc\arm-none-eabi\bin\cc1" -quiet -fmessage-length=0 -fno-diagnostics-show-caret -mtp=soft -mcpu=cortex-a5 -mlittle-endian -mfloat-abi=hard -mfpu=vfpv4-d16 -mthumb-interwork -nostdinc -fPIC -std=gnu99 -fno-dwarf2-cfi-asm -fno-builtin -ffunction-sections -fdata-sections -fshort-enums -fno-common "-IC:\Users\Brian\Documents\Arduino\hardware\Amulet\sam\cores\sam\"  -DF_CPU=533000000L -DARDUINO=10802 -DARDUINO_MK-070C-HP -DARDUINO_ARCH_SAM   "-IC:\Users\Brian\Documents\Arduino\hardware\Amulet\sam\cores\Amulet" "-IC:\Users\Brian\Documents\Arduino\hardware\Amulet\sam\variants\Amulet" "C:\Users\Brian\AppData\Local\Temp\arduino_build_77900\sketch\Amulet_Test.ino.cpp" -o "C:\Users\Brian\AppData\Local\Temp\arduino_build_77900\preproc\ctags_target_for_gcc_minus_e.cpp" -MQ "" -MD ""
cc1: error: to generate dependencies you must specify either -M or -MM

I also noticed that my error was actually caused during the "Generating function prototypes..." step, which appears to use the recipe.cpp.o.pattern. Since the -MQ and -MD are preprocessor-related, I think I'm just trying to do too much in the compile step because thats how my regular IDE (Rowley CrossStudio) was doing it.

Go Up