Sample Firmware Build Error - attempt to use poisoned "SIG_T

by matp on Tue Dec 31, 2013 3:54 am

Built from adafruit kit.
LEDs worked fine (one turns on at a time).

Installed avr libc stuff on macos and ubuntu. Both can program the sample firmware fine (now displays MiniPOV message) using the provided pre-compiled .hex files (mypov.hex).

However, if I want to update the message which requires re-building it turns out the sample firmware doesn't want to build on ubuntu or macos with the latest AVR toolchain.

Has anyone updated this the sample firmware yet?

Code: Select all
Compiling: mypov.c
avr-gcc -c -I. -g -Os          -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -DF_CPU=8000000       -Wa,-adhlns=mypov.lst  -mmcu=attiny2313 -std=gnu99 mypov.c -o mypov.o
In file included from mypov.c:3:0:
/usr/local/CrossPack-AVR-20131216/avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete.  Use <avr/interrupt.h>." [-Wcpp]
 #warning "This header file is obsolete.  Use <avr/interrupt.h>."
  ^
mypov.c:50:9: error: attempt to use poisoned "SIG_TIMER1_COMPA"
 SIGNAL( SIG_TIMER1_COMPA ) {
         ^
In file included from mypov.c:2:0:
mypov.c: In function 'SIG_TIMER1_COMPA':
mypov.c:50:9: warning: 'SIG_TIMER1_COMPA' appears to be a misspelled signal handler [enabled by default]
 SIGNAL( SIG_TIMER1_COMPA ) {
         ^
make: *** [mypov.o] Error 1
matp
 
Posts: 3
Joined: Mon Dec 30, 2013 12:01 pm

Re: Sample Firmware Build Error - attempt to use poisoned "S

by adafruit_support_rick on Tue Dec 31, 2013 6:55 pm

Try this:
In mypov.c, comment out line 3:
Code: Select all
#include <avr/io.h>      // this contains all the IO port definitions
#include <avr/interrupt.h>
//#include <avr/signal.h>
#include <util/delay.h>

Then, on line 50, change the SIGNAL to this:
Code: Select all
SIGNAL( TIMER1_COMPA_vect ) {
User avatar
adafruit_support_rick
 
Posts: 8585
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Sample Firmware Build Error - attempt to use poisoned "S

by matp on Thu Jan 02, 2014 1:51 pm

Thanks. Builds now. I don't have the minipov with me at the moment, but am looking forward to trying it this weekend.
matp
 
Posts: 3
Joined: Mon Dec 30, 2013 12:01 pm

Re: Sample Firmware Build Error - attempt to use poisoned "S

by adafruit_support_rick on Thu Jan 02, 2014 5:41 pm

Great - let me know, and I'll get the download updated.
User avatar
adafruit_support_rick
 
Posts: 8585
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Sample Firmware Build Error - attempt to use poisoned "S

by adafruit_support_rick on Sun Jan 12, 2014 12:17 pm

Any luck?
User avatar
adafruit_support_rick
 
Posts: 8585
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY

Re: Sample Firmware Build Error - attempt to use poisoned "S

by matp on Sat Feb 01, 2014 12:16 pm

I finally got around to getting this working.

In addition to the interrupt change, had to make a few other changes to get it to build with the latest CrossPack.

Make largeimage_p const.
Code: Select all
PGM_P largeimage_p PROGMEM = large_image;

->
Code: Select all
PGM_P const largeimage_p PROGMEM = large_image;


Also the instructions here: http://learn.adafruit.com/minipov3/software...

It could be that the delay is not long enough. Open up the file /usr/local/AVRMacPack/bin/avrdude.conf using TextEdit and and search for "dasa" so that it will take you to the part shown below. Make sure you see a line with "delay = 2000" in it as shown below. That means that we are telling the programmer to go slow (wait 2 milliseconds between commands) because otherwise it gets confused.


...are incorrect. You can see that delay isn't an option for a programmer. http://www.nongnu.org/avrdude/user-manu ... efinitions

Adding the delay on the command line (-i option for avrdude) works.

The instructions to add DELAY to Makefile are also confusing because that isn't used in the sample code so I had to add it to the AVRDUDE_FLAGS myself.

Anyway, in the end it builds and programs now using the latest CrossPack on my macbook pro with a Keyspan USB-Serial adapter. I dumped all my changes on github so you can see exactly what I changed.

https://github.com/mattpr/MiniPOV3

By the way, I guess SIGNAL is deprecated now, so probably need to update that in the sample code at some point if you keep selling this kit.

Thanks again for helping me get this going.
matp
 
Posts: 3
Joined: Mon Dec 30, 2013 12:01 pm

Re: Sample Firmware Build Error - attempt to use poisoned "S

by wtfwtfdef on Mon Mar 03, 2014 1:24 am

hi. I've recently built this again after 7+ years and ran into the same problems as you did. I found out however that you can support all your old code in avrdude with a simple line in MAKEFILE:

-D__AVR_LIBC_DEPRECATED_ENABLE__

Afaik, this should work no problem on any programmer. I personally use an USBTINY to program all my chips and install a 10 pin or 6 pin header into all my boards, as i dont want to bother with USB to serial or parrallel and bit-banging chips. Once adding this line to your makefile you will be able to build/compile using the same code from original programs.
also if you want that warning to go away, do like rick says and comment out the old include file.
wtfwtfdef
 
Posts: 30
Joined: Sat Dec 15, 2007 1:35 am