1249Views17Replies

Author Options:

programming a stealth USB caps locker problems? Answered

i have a problem programming my stealth USB caps locker (link
the PCB is ready, the components soldered on, and ive made connections to my ghetto programmer.
now, i opened programmers notepad and wanted to program it, but now it just gives a whole load of errors:



> "make.exe" program
set -e; avr-gcc -MM -mmcu=attiny45 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.lst  -std=gnu99 main.c \
    | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > main.d; \
    [ -s main.d ] || rm -f main.d
main.c:19:20: error: usbdrv.h: No such file or directory
main.c:20:21: error: oddebug.h: No such file or directory

Compiling: main.c
avr-gcc -c -mmcu=attiny45 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.lst  -std=gnu99 main.c -o main.o
In file included from main.c:16:
c:/winavr-20090313/lib/gcc/../../avr/include/util/delay.h:85:3: warning: #warning "F_CPU not defined for <util/delay.h>"
main.c:19:20: error: usbdrv.h: No such file or directory
main.c:20:21: error: oddebug.h: No such file or directory
main.c:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'reportBuffer'
main.c:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'idleRate'
main.c:27: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'reportCount'
main.c:33: error: 'USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH' undeclared here (not in a function)
main.c: In function 'buildReport':
main.c:65: error: 'uchar' undeclared (first use in this function)
main.c:65: error: (Each undeclared identifier is reported only once
main.c:65: error: for each function it appears in.)
main.c:65: error: expected ';' before 'key'
main.c:68: error: 'reportCount' undeclared (first use in this function)
main.c:69: error: 'key' undeclared (first use in this function)
main.c:73: error: 'reportBuffer' undeclared (first use in this function)
main.c: In function 'timerPoll':
main.c:87: error: 'reportCount' undeclared (first use in this function)
main.c: At top level:
main.c:104: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'usbFunctionSetup'
main.c: In function 'calibrateOscillator':
main.c:143: error: 'uchar' undeclared (first use in this function)
main.c:143: error: expected ';' before 'step'
main.c:144: error: expected ';' before 'trialValue'
main.c:149: error: 'trialValue' undeclared (first use in this function)
main.c:149: error: 'step' undeclared (first use in this function)
main.c:150: warning: implicit declaration of function 'usbMeasureFrameLength'
main.c:157: error: 'optimumValue' undeclared (first use in this function)
main.c: In function 'main':
main.c:193: error: 'uchar' undeclared (first use in this function)
main.c:193: error: expected ';' before 'i'
main.c:194: error: expected ';' before 'calibrationValue'
main.c:196: error: 'calibrationValue' undeclared (first use in this function)
main.c:200: warning: implicit declaration of function 'odDebugInit'
main.c:201: warning: implicit declaration of function 'usbDeviceDisconnect'
main.c:202: error: 'i' undeclared (first use in this function)
main.c:205: warning: implicit declaration of function 'usbDeviceConnect'
main.c:211: warning: implicit declaration of function 'usbInit'
main.c:215: warning: implicit declaration of function 'usbPoll'
main.c:222: warning: implicit declaration of function 'usbInterruptIsReady'
main.c:222: error: 'reportCount' undeclared (first use in this function)
main.c:224: warning: implicit declaration of function 'usbSetInterrupt'
main.c:224: error: 'reportBuffer' undeclared (first use in this function)
make.exe: *** [main.o] Error 1

> Process Exit Code: 2
> Time Taken: 00:03


maybe its this:

""Download capslocker.hex and use AVR Studio or a standalone programming tool to write into the ATTiny45 Flash. Oh, you'll also need to select the fuse for PLL/1k clock source."

thats what the maker of this thingie said, but what is the fuse for PLL/1k clock source? could it be that?



when i use the .hex file, i get about the same.
whats the problem? i didnt change anything.





17 Replies

user
lemonieBest Answer (author)2009-12-24

The complier is telling you something here: h: No such file or directory
Is the h:\ drive there and functional when you do this?
The rest looks like rotten-source to me?

L

Select as Best AnswerUndo Best Answer

user
godofal (author)lemonie2009-12-24

its in the same folder, so i guess its  there...

anyway, what could be rotten? i havent altered anything, and it should run ok, its a clean download...

Select as Best AnswerUndo Best Answer

user
godofal (author)godofal2009-12-24

ive made some screenshots:

Select as Best AnswerUndo Best Answer

user
godofal (author)godofal2009-12-24

ah, i found out that those 2 missing .h items where in that usbdrv folder, ive copied everything in the main folder, and i get alot less errors now.

this is what i have left:

> "make.exe" program
set -e; avr-gcc -MM -mmcu=attiny2313 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.lst  -std=gnu99 main.c \
    | sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > main.d; \
    [ -s main.d ] || rm -f main.d

Compiling: main.c
avr-gcc -c -mmcu=attiny2313 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.lst  -std=gnu99 main.c -o main.o
In file included from main.c:16:
c:/winavr-20090313/lib/gcc/../../avr/include/util/delay.h:85:3: warning: #warning "F_CPU not defined for <util/delay.h>"
main.c: In function 'timerInit':
main.c:96: error: 'TCCR1' undeclared (first use in this function)
main.c:96: error: (Each undeclared identifier is reported only once
main.c:96: error: for each function it appears in.)
make.exe: *** [main.o] Error 1

> Process Exit Code: 2
> Time Taken: 00:02

Select as Best AnswerUndo Best Answer

user
lemonie (author)godofal2009-12-24

You seem to be doing a good job of fixing this - you should be able to read the remaining error messages and fix them too?

L

Select as Best AnswerUndo Best Answer

user
godofal (author)lemonie2009-12-25

i think its a problem  with the makefile, the makefile that was in the download doesnt work at all, and with my own makefile i alot of errors...

Select as Best AnswerUndo Best Answer

user
godofal (author)godofal2009-12-25

okay, i dont think i can get further on my own...
these are the last errors, theyr mostly about some undefined stuff, but i just cant find what they should define in the code...


> "make.exe" program

Linking: main.elf
avr-gcc -mmcu=attiny45 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=main.o  -std=gnu99 main.o   --output main.elf -Wl,-Map=main.map,--cref -lm
main.o: In function `usbFunctionSetup':
I:\portableapps\programmers notepad\programma's\CapsLocker/main.c:108: undefined reference to `usbMsgPtr'
I:\portableapps\programmers notepad\programma's\CapsLocker/main.c:108: undefined reference to `usbMsgPtr'
I:\portableapps\programmers notepad\programma's\CapsLocker/main.c:115: undefined reference to `usbMsgPtr'
I:\portableapps\programmers notepad\programma's\CapsLocker/main.c:115: undefined reference to `usbMsgPtr'
main.o: In function `main':
I:\portableapps\programmers notepad\programma's\CapsLocker/main.c:211: undefined reference to `usbInit'
I:\portableapps\programmers notepad\programma's\CapsLocker/main.c:215: undefined reference to `usbPoll'
I:\portableapps\programmers notepad\programma's\CapsLocker/main.c:222: undefined reference to `usbTxLen1'
I:\portableapps\programmers notepad\programma's\CapsLocker/main.c:224: undefined reference to `usbSetInterrupt'
main.o: In function `calibrateOscillator':
I:\portableapps\programmers notepad\programma's\CapsLocker/main.c:150: undefined reference to `usbMeasureFrameLength'
I:\portableapps\programmers notepad\programma's\CapsLocker/main.c:160: undefined reference to `usbMeasureFrameLength'
make.exe: *** [main.elf] Error 1

> Process Exit Code: 2
> Time Taken: 00:01


how can i find out how i have to define this? or  can anyone else figure it out?

Select as Best AnswerUndo Best Answer

user
lemonie (author)godofal2009-12-25

I'm not that familiar with this stuff. You might ask another question, very specifically towards "compile error help". This question has dropped out of recent, and as we're the only two discussing it, having a fresh go might catch someone who knows the stuff better.

L

Select as Best AnswerUndo Best Answer

user
lemonie (author)godofal2009-12-25

You got two other people on that other question - stick with 'em as I think they'll be more help than me.

L

Select as Best AnswerUndo Best Answer

user
godofal (author)lemonie2010-01-02

they were :D
ive programmed it now.
the main problem was that it was made in AVRstudio, and i couldnt use that becouse it wouldnt open the project (it would crash) and it didnt support my ghetto programmer...

but ive used a CMD line with avrdude to load the .hex file directly into the chip

it should work now, im testing it but nothing so far...
maybe thats the fuse settings so il try to change those soon

anyway, thnx for all the time and efforts

Select as Best AnswerUndo Best Answer

user
lemonie (author)godofal2010-01-02

Oh good, glad about that, but still not working is a bit odd. Does the PC pick the device up - I'm guessing that it should in some way?

L

Select as Best AnswerUndo Best Answer

user
godofal (author)lemonie2010-01-02

yeah, it says USB device not recognised, sometimes nothing at all (but that can be bad connection)

Select as Best AnswerUndo Best Answer

user
lemonie (author)godofal2010-01-02

If the PC doesn't have a functional "connection" in place, it ain't going to work. Should it use generic drivers or do you need to install some?

L

Select as Best AnswerUndo Best Answer

user
hsandford (author)godofal2009-12-25

Check that you've got the usbdrvasm.s file in the right directory, try putting it in the same directory as the .h files you had problems with previously.  Or if you already have it there, then make sure it's in the ./usbdrv/ directory instead.

Select as Best AnswerUndo Best Answer

user
1051100720 (author)2010-04-17

Hi!!

How did u get rid of the "c:/winavr-20090313/lib/gcc/../../avr/include/util/delay.h:85:3: warning: #warning "F_CPU not defined for <util/delay.h>"" warning??

I've been trying and trying but it stays!

Select as Best AnswerUndo Best Answer

user
godofal (author)10511007202010-04-19

it was something in the makefile...
not sure what it was specifically though.
send me a message with more info, and il try 2 help u out as far as possible ;)

Select as Best AnswerUndo Best Answer