TV-OUT compile errors?

Hi, I am attempting to use TV-out for displaying info. Usually this is compiling just fine, but on some projects I get the following error:

Arduino: 1.6.11 (Windows 10), Board: "Arduino Nano, ATmega328"

<snip>

"C:\Users\Spinal\AppData\Local\Temp\buildcfa75d065b0c5993330c554de21b2e72.tmp/core\core.a" "-LC:\Users\Spinal\AppData\Local\Temp\buildcfa75d065b0c5993330c554de21b2e72.tmp" -lm
C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s: Assembler messages:

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:174: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:213: Error: unknown opcode `delay1'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:215: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:218: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:221: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:224: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:227: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:230: Error: unknown opcode `delay1'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:235: Error: unknown opcode `delay1'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:238: Error: unknown opcode `delay3'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:271: Error: unknown opcode `svprt'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:275: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:279: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:280: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:282: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:283: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:285: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:286: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:288: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:289: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:291: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:292: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:294: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:295: Error: unknown opcode `delay1'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:298: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:300: Error: unknown opcode `delay1'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:302: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:303: Error: unknown opcode `svprt'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:305: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:337: Error: unknown opcode `svprt'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:341: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:344: Error: unknown opcode `delay1'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:346: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:347: Error: unknown opcode `delay3'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:349: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:350: Error: unknown opcode `delay3'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:352: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:353: Error: unknown opcode `delay3'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:355: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:356: Error: unknown opcode `delay3'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:358: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:359: Error: unknown opcode `delay3'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:361: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:362: Error: unknown opcode `delay3'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:364: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:367: Error: unknown opcode `delay2'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:369: Error: unknown opcode `o1bs'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:370: Error: unknown opcode `svprt'

C:\Users\Spinal\AppData\Local\Temp\ccaOdhak.s:372: Error: unknown opcode `o1bs'

lto-wrapper: C:\Users\Spinal\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-gcc returned 1 exit status

c:/users/spinal/appdata/local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe: lto-wrapper failed

collect2.exe: error: ld returned 1 exit status

Using library SPI at version 1.0 in folder: C:\Users\Spinal\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.14\libraries\SPI 
Using library Gamebuino in folder: C:\Users\Spinal\Documents\Arduino\libraries\Gamebuino (legacy)
Using library TVout in folder: C:\Users\Spinal\Documents\Arduino\libraries\TVout (legacy)
exit status 1
Error compiling for board Arduino Nano.

Can anyone explain to me why those opcodes are unknown is some projects but not in others? From what I can tell, the macros are used by ALL tv-out projects no matter what, so why do they sometimes not work?

Thanks.

If only you had posted examples of working and not working code ...

That would have been good huh? :slight_smile:

‘Working’ code is a little long winded, I’m attempting to combine tv-out with gamebuino.

Attached the libraries that i’m using (I think that’s all of them).
TV-out connected to pins 4 and 9 on my nano.
buttons are up,down,left,right - 10,6,8,7, A,B,C - 5,2,A3 to ground.

Most of the gamebuino example work (other than SD loading, haven’t got that far yet) However the circles (libraries\Gamebuino\examples\2.Intermediate\CirclesPhysics) causes the above error, as do a handful of gamebuino games.

Gamebuino.zip (107 KB)

TVout.zip (27.9 KB)

I’v found that this problem have appeared after arduino IDE start to use “-flto” GCC compile and link flag.
Actually, I use not the ARduino IDE itself, but Netbeans with plugged toolchain and libs from installed Arduino IDE on Debian. After removing -flto switch from compile and link stages I can compile for MEGA2560, using 1.8.1 toolset. From the other side, -flto flag is important and allows to forget problems in optimising and inlining the code, placed in different object modules, and ommit this option is not desirable.

Does anyone have another solution?