Arduino_cli not passing build-property to preprocessing and compile phase

RidingBumbleBee

New member
I am new to the Teensy HW but have been using/working with AVR's for many years. I usually use VS Code and the arduino-cli in a makefile to build and upload the binaries.
Using latest Teensyduino 1.58.1

Below statement works
arduino-cli compile -v -e -b arduino:avr:mega --build-property 'compiler.cpp.extra_flags=-DSENSOR_XYZ -I/Users/g/Documents/LMC/SW/BMS/BMS_temp/BMSv3' ../EEPRom_Dumper

Stayed at the same filesystem location
And now I want to compile it for the teensy40 by just switching out the board type in the command
arduino-cli compile -v -e -b teensy:avr:teensy40 --build-property 'compiler.cpp.extra_flags=-DSENSOR_XYZ -I/Users/g/Documents/LMC/SW/BMS/BMS_temp/BMSv3' ../EEPRom_Dumper

And it couldn't find the include files that it needed that are located in the specified folder.

Check the verbose output and would have expected my option in the bold marked area.
Detecting libraries used...
/Users/g/Library/Arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++ -E -Os -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=158 -DARDUINO=10607 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -I/Users/g/Library/Arduino15/packages/teensy/hardware/avr/1.58.1/cores/teensy4 /private/var/folders/sl/pq8j52dn65s056t443qhs6r00000gn/T/arduino/sketches/F85ABA2B3AD34F8179AF490F11400716/sketch/EEPRom_Dumper.ino.cpp -o /dev/null


Nothing....
Tested a couple of different things no luck.

Now I remembered the platform.txt has the macros being used for doing most/all the work.
I ended up "hacking" the platform.txt adding {compiler.cpp.extra_flags}
to the ## Preprocessor Macros

And now it works.

Detecting libraries used...
/Users/g/Library/Arduino15/packages/teensy/tools/teensy-compile/11.3.1/arm/bin/arm-none-eabi-g++ -E -Os -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=158 -DARDUINO=10607 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH -DSENSOR_XYZ -I/Users/g/Documents/LMC/SW/BMS/BMS_temp/BMSv3 -I/Users/g/Library/Arduino15/packages/teensy/hardware/avr/1.58.1/cores/teensy4 /private/var/folders/sl/pq8j52dn65s056t443qhs6r00000gn/T/arduino/sketches/F85ABA2B3AD34F8179AF490F11400716/sketch/EEPRom_Dumper.ino.cpp -o /dev/null


But I hope Paul is reading this he better check my assumption and if that is the correct way and place to add that or is there a better way
and another spot that I might have missed.
 
Back
Top