Error running an Audio library example sketch

Status
Not open for further replies.

tenkai

Well-known member
Hi Guys!

I am getting an error running ths "PlaySynthMusic" demo for the Teensy Audio Library. I get this error, the solution to which has eluded me:

Code:
[ 97%] Creating /tmp/Stino_build/PlaySynthMusic/PlaySynthMusic.elf...
"/Applications/Arduino 1.0.6.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/arm-none-eabi-gcc" -Os -Wl,--gc-sections -mcpu=cortex-m4 -mthumb "-T/Applications/Arduino 1.0.6.app/Contents/Resources/Java/hardware/teensy/cores/teensy3/mk20dx256.ld" -o "/tmp/Stino_build/PlaySynthMusic/PlaySynthMusic.elf" "/tmp/Stino_build/PlaySynthMusic/PlaySynthMusic.ino.cpp.o" "/tmp/Stino_build/PlaySynthMusic/PlaySynthMusic/william_tell_overture.c.o" "/tmp/Stino_build/PlaySynthMusic/PlaySynthMusic/miditones/miditonesV1.6.c.o" "/tmp/Stino_build/PlaySynthMusic/core.a" "-L/tmp/Stino_build/PlaySynthMusic" -larm_cortexM4l_math -lm -gcc
/Applications/Arduino 1.0.6.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-openr.o): In function `_open_r':
openr.c:(.text+0x16): undefined reference to `_open'
/Applications/Arduino 1.0.6.app/Contents/Resources/Java/hardware/tools/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-gettimeofdayr.o): In function `_gettimeofday_r':
gettimeofdayr.c:(.text+0x14): undefined reference to `_gettimeofday'
collect2: error: ld returned 1 exit status

The code to this sketch is here: https://github.com/PaulStoffregen/Audio/tree/master/examples/Synthesis/PlaySynthMusic

Any ideas?
 
Last edited:
Well, not on my Teensy 3.2 with Arduino IDE 1.6.7 and Teensyduino 1.27.

The error messages:
Code:
Arduino: 1.6.7 (Mac OS X), TD: 1.27, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz optimized (overclock), German (Mac)"

/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c: In function 'HandleOptions':
/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c:299:13: warning: array subscript has type 'char' [-Wchar-subscripts]
switch (toupper(argv[i][1])) {
^
/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c:305:17: warning: array subscript has type 'char' [-Wchar-subscripts]
if (toupper(argv[i][2]) == 'G') loggen = true;
^
/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c:306:17: warning: array subscript has type 'char' [-Wchar-subscripts]
else if (toupper(argv[i][2]) == 'P') logparse = true;
^
/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c: In function 'main':
/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c:954:23: warning: 'earliest_tracknum' may be used uninitialized in this function [-Wmaybe-uninitialized]
find_note (tracknum); // use up the note
^
/Applications/Develop/Embedded/Arduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/armv7e-m/libc.a(lib_a-openr.o): In function `_open_r':
openr.c:(.text._open_r+0x10): undefined reference to `_open'
/Applications/Develop/Embedded/Arduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/armv7e-m/libc.a(lib_a-gettimeofdayr.o): In function `_gettimeofday_r':
gettimeofdayr.c:(.text._gettimeofday_r+0xe): undefined reference to `_gettimeofday'
collect2: error: ld returned 1 exit status
exit status 1
Fehler beim Kompilieren.
 
Well, not on my Teensy 3.2 with Arduino IDE 1.6.7 and Teensyduino 1.27.

The error messages:
Code:
Arduino: 1.6.7 (Mac OS X), TD: 1.27, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz optimized (overclock), German (Mac)"

/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c: In function 'HandleOptions':
/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c:299:13: warning: array subscript has type 'char' [-Wchar-subscripts]
switch (toupper(argv[i][1])) {
^
/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c:305:17: warning: array subscript has type 'char' [-Wchar-subscripts]
if (toupper(argv[i][2]) == 'G') loggen = true;
^
/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c:306:17: warning: array subscript has type 'char' [-Wchar-subscripts]
else if (toupper(argv[i][2]) == 'P') logparse = true;
^
/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c: In function 'main':
/var/folders/74/2v8g31_n38360tz71d47mkpc0000gn/T/build51617b55d984391ecff552ec9263adb0.tmp/sketch/miditones/miditonesV1.6.c:954:23: warning: 'earliest_tracknum' may be used uninitialized in this function [-Wmaybe-uninitialized]
find_note (tracknum); // use up the note
^
/Applications/Develop/Embedded/Arduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/armv7e-m/libc.a(lib_a-openr.o): In function `_open_r':
openr.c:(.text._open_r+0x10): undefined reference to `_open'
/Applications/Develop/Embedded/Arduino.app/Contents/Java/hardware/tools/arm/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/lib/armv7e-m/libc.a(lib_a-gettimeofdayr.o): In function `_gettimeofday_r':
gettimeofdayr.c:(.text._gettimeofday_r+0xe): undefined reference to `_gettimeofday'
collect2: error: ld returned 1 exit status
exit status 1
Fehler beim Kompilieren.

Might be a bug which is introduced by the new Arduino buildsystem. I think it tries to compile the "miditones" - utility which is not intended to run on the Teensy. Just delete the "miditones"- folder inside PlaySynthMusic or move it elsewhere..
 
Last edited:
Oh, indeed, sorry, my fault - after "Saving as ..." of the sketch the folder was not copied with the other data, so I missed it. Now it works ...

It's a little curious: a sketch might not be saved in another directory under it's proper name - this was possible until now. But this seems to be an Arduino issue.
 
Status
Not open for further replies.
Back
Top