TeensyLoader seems to choke on large .hex files II: Audio's SamplePlayer

sdaau

New member
I don't have a Teensy 3.1 yet; nor do I have Audio Adaptor Board for Teensy 3.0 & 3.1 (audio shield) yet - but I may have to work with them, so I thought I'd try and compile some programs at home, just to see how it goes.

I already had Arduino IDE 1.0.5 from before (installed in, say,
Code:
/path/to/arduino-1.0.5
); working on Ubuntu Natty 11.04. Since the latest Download Teensyduino, Version 1.19 doesn't work with the latest Audio Library For Teensy 3 on github, I got the Teensyduino 1.20 Release Candidate #2:

Code:
wget http://www.pjrc.com/teensy/td_120-rc2/teensyduino.32bit -O teensyduino-1.20rc2.32bit
chmod +x teensyduino-1.20rc2.32bit
./teensyduino-1.20rc2.32bit

The install seems to finish fine; then I get the Audio library:

Code:
git clone https://github.com/PaulStoffregen/Audio.git Teensy3_Audio_git
ln -s $(readlink -f Teensy3_Audio_git) /path/to/arduino-1.0.5/libraries/Audio

This seems to pass fine. Then, from the page Teensyduino > Libraries > Audio > Play > Memory > Audio 4 Channel Mixer, I gather this:

AudioMixer4 is used in File > Examples > Audio > PlayFromSketch to combine 6 memory players, so all 6 sounds can play simultaneously.

... however, it turns out PlayFromSketch has been removed in commit 98ee40d5965c6dccae95f73aae78e2dd53848bea, and apparently renamed as SamplePlayer.

So, I try to open the Arduino IDE, choose Teensy 3.1 as the target, and load SamplePlayer from File / Examples / Audio / SamplePlayer (in the IDE). File loads, then I build, but the process ultimately fails. I enabled
Code:
build.verbose=true
in
Code:
~/.arduino/preferences.txt
, and I got a verbose build log, which is attached.

Just like in TeensyLoader seems to choke on large .hex files, it ends with:

Code:
...
/tmp/build339863402923666416.tmp/SamplePlayer.cpp.elf /tmp/build339863402923666416.tmp/SamplePlayer.cpp.hex
Opening Teensy Loader...
Teensy Loader could not find the file SamplePlayer.cpp

Weird, because it seems that SamplePlayer.cpp is indeed there?:

Code:
$ ls -la /tmp/build339863402923666416.tmp/SamplePlayer.cpp
-rw-r--r-- 1 user user 4068 2014-09-10 23:28 /tmp/build339863402923666416.tmp/SamplePlayer.cpp

Then I realize the Teensy Window that starts up, says: "SamplePlayer.cpp.hex (too large);", going in there to Help/Verbose Info, I get

Code:
23:29:08: Teensy Loader 1.20-rc2, begin program
23:29:08: File "SamplePlayer.cpp.hex". 210760 bytes, 327% used
23:29:08: File contains data beyond chip size, yikes!
23:29:08: Listening for remote control on port 3149
23:29:08: initialized, showing main window
23:29:08: remote connection opened
23:29:08: remote cmd: "comment: Teensyduino 1.20-rc2 - LINUX32"
23:29:08: remote cmd: "dir:/tmp/build339863402923666416.tmp/"
23:29:08: remote cmd: "file:SamplePlayer.cpp.hex"
23:29:09: File "SamplePlayer.cpp.hex". 210760 bytes, 327% used
23:29:09: File contains data beyond chip size, yikes!
23:29:09: remote connection closed
23:34:49: Verbose Info event

Right, so apparently here the .hex file is too big?! (Btw, I think I tried some other non-Audio Teensy examples from the IDE, they compiled fine if I recall correctly...)

So my question is - how can I get SamplePlayer to compile, preferably without having to have a Teensy with me? Could I somehow "fake" the amount of available memory? What sort of environment is SamplePlayer otherwise supposed to compile in?

Many thanks in advance for any answers,
Cheers!

The full build log is attached here:
View attachment Teensy3_Audio_SamplePlayer_verbosebuildlog.txt
 
Ah, the 327% used is because Teensy Loader hasn't actually seen a real Teensy yet.

As soon as you actually use it with with a Teensy 3.1, which has 256K of flash, that usage number should suddenly change to 256K.

Perhaps a future version should look more at the .hex and .elf files when they're loaded, rather than defaulting to a size estimate for one of the other boards.
 
Many thanks @PaulStoffregen - this:

Ah, the 327% used is because Teensy Loader hasn't actually seen a real Teensy yet.

As soon as you actually use it with with a Teensy 3.1, which has 256K of flash, that usage number should suddenly change to 256K.

... explains well why I'm seeing this behavior.

Btw, in this case, I'm aware that the program compiles fine, given that no build errors are reported. However, just for psychological reasons, I would like not to see the "Teensy Loader could not find the file" message when compilation ends. Judging by your answer, the answer to this is probably "no", but I'd just like to confirm: is there some sort of a `#define` or something that I could use directly in the master `.ino` file, so that the message would be suppressed if I have to compile stuff at home without a Teensy?
 
Back
Top