jimmayhugh
Well-known member
OK, it's been a LONG time since I've used makefiles for anything other than the standard
that I occasionally used to compile and install Linux software that doesn't come in a .rpm or .deb package. Anyhoo...
I thought I'd try compiling my program from the command line just for grits and shins.
First step was to copy the Makefile to my program's sketckbook directory and modifying the area specified:
Tried running "make" and got the following:
I found the location of mk20dx128.ld, and placed the absolute patch for the file in the Makefile:
I also disabled the teensy_reboot:
Did a "make clean", followed by "make":
Examining the directory, I found:
So, shouldn't the .hex file be larger?? What am I missing?
Thank for the help.
Code:
./configure
make
sudo make install
that I occasionally used to compile and install Linux software that doesn't come in a .rpm or .deb package. Anyhoo...
I thought I'd try compiling my program from the command line just for grits and shins.
First step was to copy the Makefile to my program's sketckbook directory and modifying the area specified:
Code:
# The name of your project (used to name the compiled .hex file)
TARGET = TeensyPiPidDebug
# configurable options
OPTIONS = -DF_CPU=48000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH
#************************************************************************
# Location of Teensyduino utilities, Toolchain, and Arduino Libraries.
# To use this makefile without Arduino, copy the resources from these
# locations and edit the pathnames. The rest of Arduino is not needed.
#************************************************************************
# path location for Teensy Loader, teensy_post_compile and teensy_reboot
TOOLSPATH = /home/teensypi/arduino-1.0.4/hardware/tools # on Linux
#TOOLSPATH = ../../../tools/avr/bin # on Mac or Windows
# path location for Arduino libraries (currently not used)
LIBRARYPATH = /home/teensypi/arduino-1.0.4/libraries
# path location for the arm-none-eabi compiler
COMPILERPATH = /home/teensypi/arduino-1.0.4/hardware/tools/arm-none-eabi/bin
Tried running "make" and got the following:
Code:
[teensypi@CentosTeensyPi TeensyPiPidDebug]$ make
make: *** No rule to make target `mk20dx128.ld', needed by `TeensyPiPidDebug.elf'. Stop.
[teensypi@CentosTeensyPi TeensyPiPidDebug]$
I found the location of mk20dx128.ld, and placed the absolute patch for the file in the Makefile:
Code:
# linker options
LDFLAGS = -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -T/home/teensypi/arduino-1.0.4/hardware/teensy/cores/teensy3/mk20dx128.ld
$(TARGET).elf: $(OBJS) /home/teensypi/arduino-1.0.4/hardware/teensy/cores/teensy3/mk20dx128.ld
$(CC) $(LDFLAGS) -o $@ $(OBJS)
I also disabled the teensy_reboot:
Code:
%.hex: %.elf
$(SIZE) $<
$(OBJCOPY) -O ihex -R .eeprom $< $@
$(abspath $(TOOLSPATH))/teensy_post_compile -file=$(basename $@) -path=$(shell pwd) -tools=$(abspath $(TOOLSPATH))
# -$(abspath $(TOOLSPATH))/teensy_reboot
Did a "make clean", followed by "make":
Code:
[teensypi@CentosTeensyPi TeensyPiPidDebug]$ make
/home/teensypi/arduino-1.0.4/hardware/tools/arm-none-eabi/bin/arm-none-eabi-gcc -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb -T/home/teensypi/arduino-1.0.4/hardware/teensy/cores/teensy3/mk20dx128.ld -o TeensyPiPidDebug.elf
/home/teensypi/arduino-1.0.4/hardware/tools/arm-none-eabi/bin/arm-none-eabi-size TeensyPiPidDebug.elf
text data bss dec hex filename
1240 0 28 1268 4f4 TeensyPiPidDebug.elf
/home/teensypi/arduino-1.0.4/hardware/tools/arm-none-eabi/bin/arm-none-eabi-objcopy -O ihex -R .eeprom TeensyPiPidDebug.elf TeensyPiPidDebug.hex
/home/teensypi/arduino-1.0.4/hardware/tools/teensy_post_compile -file=TeensyPiPidDebug -path=/home/teensypi/sketchbook/TeensyPiPidDebug -tools=/home/teensypi/arduino-1.0.4/hardware/tools
Opening Teensy Loader...
Teensy Loader 1.07, begin program
File "TeensyPiPidDebug.hex". 1240 bytes, 1% used
Listening for remote control on port 3149
initialized, showing main window
remote connection opened
remote cmd: "comment: Teensyduino 1.13 - LINUX32"
remote cmd: "dir:/home/teensypi/sketchbook/TeensyPiPidDebug/"
remote cmd: "file:TeensyPiPidDebug.hex"
File "TeensyPiPidDebug.hex". 1240 bytes, 1% used
remote cmd: "status"
status data sent
remote cmd: "auto:on"
/home/teensypi/arduino-1.0.4/hardware/tools/teensy_reboot
remote connection closed
remote connection opened
remote cmd: "status"
status data sent
...
Please press the RESET BUTTON on your Teensy to upload your sketch. Auto-reboot only works if the Teensy is running a previous sketch.
remote connection closed
[teensypi@CentosTeensyPi TeensyPiPidDebug]$
Examining the directory, I found:
Code:
[teensypi@CentosTeensyPi TeensyPiPidDebug]$ ls -la
total 92
drwxrwxr-x 2 teensypi teensypi 4096 Mar 16 09:10 .
drwxrwxr-x. 63 teensypi teensypi 4096 Mar 2 07:11 ..
-rw-rw-r-- 1 teensypi teensypi 2680 Mar 16 09:04 Makefile
-rwxrwxr-x 1 teensypi teensypi 35837 Mar 16 09:10 TeensyPiPidDebug.elf
-rw-rw-r-- 1 teensypi teensypi 3507 Mar 16 09:10 TeensyPiPidDebug.hex
-rw-rw-r-- 1 teensypi teensypi 58179 Mar 15 09:41 TeensyPiPidDebug.ino
So, shouldn't the .hex file be larger?? What am I missing?
Thank for the help.