Issues with ATtiny85
Opened this issue · 4 comments
I was able to come quite far but get got stuck with this: "make[1]: *** [device/try1/onewire.o] Error 1"
Here is my "project.cfg":
_include: world.cfg
env:
prog: avrisp
devices:
_default:
_ref: defaults.target.t85
types:
_ref: defaults.types
code: []
try1:
_doc: My very first 1wire slave device
defs:
is_onewire: ds2423
onewire_id: x49ae6a524a39
targets:
- try1
I had to modify the "Makefile" as well:
$(AVRDUDE) -c $(PROG) -p $(MCU_PROG) -C +$$TF\
needed to be changed to
$(AVRDUDE) -c $(PROG) -p t85 -b 19200 -P /dev/ttyACM0 -C +$$TF\
as I could not figure out how to do this in "project.cfg". (See also [1].)
[1] http://technostuff.blogspot.ch/2013/06/arduino-nano-v30-with-avr-dude.html
With all this I get an error during the first step of make:
$ make CFG=project.cfg try1
make[1]: Entering directory `/home/osboxes/sketchbook/cli/owslave'
mkdir -p device/try1
MCU:attiny85
MCU_PROG:t85
PROG:avrisp
AVRDUDE:sudo avrdude
CFILES:moat_backend.c main.c jmp.S dev_data.c config.o ds2423.c onewire.c crc.c
TYPE:temp 0 console 0 pid 0 smoke 0 count 0 humid 0 config -1 alert -1 adc 0 port 0 pwm 0
mkdir -p device/try1
./cfg project.cfg .hdr try1
avr-gcc -g -mmcu=attiny85 -Wall -Wstrict-prototypes -Os -mcall-prologues -fshort-enums -Idevice/try1 -c -o device/try1/moat_backend.o moat_backend.c
In file included from features.h:22:0,
from onewire.h:20,
from moat_backend.c:26:
device/try1/dev_config.h:53:0: warning: "ONEWIRE_IFR" redefined [enabled by default]
#define ONEWIRE_IFR PCINT0
^
device/try1/dev_config.h:52:0: note: this is the location of the previous definition
#define ONEWIRE_IFR PCICR
^
avr-gcc -g -mmcu=attiny85 -Wall -Wstrict-prototypes -Os -mcall-prologues -fshort-enums -Idevice/try1 -c -o device/try1/main.o main.c
In file included from features.h:22:0,
from main.c:23:
device/try1/dev_config.h:53:0: warning: "ONEWIRE_IFR" redefined [enabled by default]
#define ONEWIRE_IFR PCINT0
^
device/try1/dev_config.h:52:0: note: this is the location of the previous definition
#define ONEWIRE_IFR PCICR
^
main.c:120:17: warning: ‘bootseq’ defined but not used [-Wunused-variable]
static uint16_t bootseq __attribute__((section(".noinit")));
^
avr-gcc -g -mmcu=attiny85 -Wall -Wstrict-prototypes -Os -mcall-prologues -fshort-enums -Idevice/try1 -c -o device/try1/jmp.o jmp.S
avr-gcc -g -mmcu=attiny85 -Wall -Wstrict-prototypes -Os -mcall-prologues -fshort-enums -Idevice/try1 -c -o device/try1/dev_data.o dev_data.c
In file included from dev_data.h:5:0,
from dev_data.c:6:
device/try1/dev_config.h:53:0: warning: "ONEWIRE_IFR" redefined [enabled by default]
#define ONEWIRE_IFR PCINT0
^
device/try1/dev_config.h:52:0: note: this is the location of the previous definition
#define ONEWIRE_IFR PCICR
^
set -e; \
./gen_eeprom device/try1/eprom.bin type $(./cfg project.cfg .type try1); \
if ./gen_eeprom device/try1/eprom.bin name >/dev/null 2>&1 ; then : ; else \
./gen_eeprom device/try1/eprom.bin name try1 ; fi ; \
if [ ds2423 != 0 ] ; then \
if ./gen_eeprom device/try1/eprom.bin owid serial >/dev/null 2>&1 ; then \
SER=$(./gen_eeprom device/try1/eprom.bin owid serial); \
if ./cfg project.cfg devices.try1.onewire_id >/dev/null 2>&1 ; then \
test "$(./cfg project.cfg devices.try1.onewire_id)" = "$SER" ; \
else \
./cfg_write project.cfg devices.try1.onewire_id x$SER; \
fi; \
elif ./cfg project.cfg .nofollow devices.try1.onewire_id >/dev/null 2>&1 ; then \
SER=$(./cfg project.cfg devices.try1.onewire_id); \
./gen_eeprom device/try1/eprom.bin owid type 0x$(./cfg project.cfg codes.onewire.ds2423) serial $SER; \
else \
./gen_eeprom device/try1/eprom.bin owid type 0x$(./cfg project.cfg codes.onewire.ds2423) serial random; \
./cfg_write project.cfg devices.try1.onewire_id x$(./gen_eeprom device/try1/eprom.bin owid serial); \
fi; \
fi
avr-objcopy -I binary -O elf32-avr --prefix-sections=.eeprom \
--redefine-sym "_binary_device_try1_eprom_bin_start=_econfig_start" \
--redefine-sym "_binary_device_try1_eprom_bin_size=_econfig_size" \
--redefine-sym "_binary_device_try1_eprom_bin_end=_econfig_end" \
device/try1/eprom.bin device/try1/config.o
avr-gcc -g -mmcu=attiny85 -Wall -Wstrict-prototypes -Os -mcall-prologues -fshort-enums -Idevice/try1 -c -o device/try1/ds2423.o ds2423.c
In file included from features.h:22:0,
from onewire.h:20,
from ds2423.c:39:
device/try1/dev_config.h:53:0: warning: "ONEWIRE_IFR" redefined [enabled by default]
#define ONEWIRE_IFR PCINT0
^
device/try1/dev_config.h:52:0: note: this is the location of the previous definition
#define ONEWIRE_IFR PCICR
^
avr-gcc -g -mmcu=attiny85 -Wall -Wstrict-prototypes -Os -mcall-prologues -fshort-enums -Idevice/try1 -c -o device/try1/onewire.o onewire.c
In file included from dev_data.h:5:0,
from onewire_internal.h:22,
from onewire.c:18:
device/try1/dev_config.h:53:0: warning: "ONEWIRE_IFR" redefined [enabled by default]
#define ONEWIRE_IFR PCINT0
^
device/try1/dev_config.h:52:0: note: this is the location of the previous definition
#define ONEWIRE_IFR PCICR
^
In file included from onewire.c:18:0:
onewire_internal.h:97:2: error: #error generic pin change interrupts are not yet supported
#error generic pin change interrupts are not yet supported
^
onewire.c: In function ‘onewire_init’:
onewire.c:68:17: error: ‘ONEWIRE_IFBIT’ undeclared (first use in this function)
ONEWIRE_IFR |= ONEWIRE_IFBIT;
^
onewire.c:68:17: note: each undeclared identifier is reported only once for each function it appears in
onewire.c:69:2: error: ‘ONEWIRE_IER’ undeclared (first use in this function)
ONEWIRE_IER |= ONEWIRE_IFBIT;
^
onewire.c: In function ‘xmit_any’:
onewire.c:135:2: warning: implicit declaration of function ‘CHK_INT_EN’ [-Wimplicit-function-declaration]
if(CHK_INT_EN()) {
^
onewire.c: In function ‘set_idle’:
onewire.c:398:2: warning: implicit declaration of function ‘SET_FALLING’ [-Wimplicit-function-declaration]
SET_FALLING();
^
onewire.c:399:2: warning: implicit declaration of function ‘EN_OWINT’ [-Wimplicit-function-declaration]
EN_OWINT();
^
onewire.c: In function ‘__vector_5’:
onewire.c:426:4: warning: implicit declaration of function ‘SET_RISING’ [-Wimplicit-function-declaration]
SET_RISING();
^
onewire.c:445:3: warning: implicit declaration of function ‘DIS_OWINT’ [-Wimplicit-function-declaration]
DIS_OWINT(); // wait for presence is done
^
onewire.c: At top level:
onewire.c:553:2: warning: #warning "Ignore the 'appears to be a misspelled signal handler' warning" [-Wcpp]
#warning "Ignore the 'appears to be a misspelled signal handler' warning"
^
onewire.c: In function ‘real_PIN_INT’:
onewire.c:554:6: warning: ‘real_PIN_INT’ appears to be a misspelled signal handler [enabled by default]
void real_PIN_INT(void) {
^
make[1]: *** [device/try1/onewire.o] Error 1
make[1]: Leaving directory `/home/osboxes/sketchbook/cli/owslave'
make: *** [try1] Error 2
What can I do now? What am I doing wrong?
It seems that I have to modify the owslave source code as mentioned in #13, correct?
Hi,
I have the exact same problem. Did you find any solution to this?
As this code supports mostly (only) mega8 which is kind of uncommon - at least for me - I changed to https://github.com/orgua/OneWireHub which is a library that can be used with Arduino IDE in a sketch (in other words with a bootloader) and supports a wide range of hardware like Uno/Nano, ATtiny, etc.
Forgot to add; OneWireHub has the further advantage that it emulates standard devices that are supported by most master out of the box.