PDA

View Full Version : Error running an Audio library example sketch



tenkai
02-24-2015, 06:58 AM
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:



[ 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?

tenkai
02-28-2015, 12:19 AM
solved...

not sure how..

it just works today!

must be ghosts in the machine...

fms1961
01-22-2016, 04:56 PM
Well, not on my Teensy 3.2 with Arduino IDE 1.6.7 and Teensyduino 1.27.

The error messages:


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.

Frank B
01-22-2016, 05:11 PM
Well, not on my Teensy 3.2 with Arduino IDE 1.6.7 and Teensyduino 1.27.

The error messages:


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..

fms1961
01-22-2016, 05:36 PM
Just delete the "miditones"- folder inside PlaySynthMusic or move it elsewhere..
There is no such folder in the PlaySynthMusic sketch folder ...

Frank B
01-22-2016, 05:43 PM
.. look at your errormessage:

............/sketch/miditones/miditonesV1.6.c

It's there ?!? Your computer tries to compile it :)
Just remove that "miditones" - folder..

fms1961
01-22-2016, 06:03 PM
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.