avrdude error opening test_leds.hex: No such file or directo

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
rc_flyer
 
Posts: 14
Joined: Sat Jan 24, 2015 10:00 pm

avrdude error opening test_leds.hex: No such file or directo

Post by rc_flyer »

The USBtinyISP is talking to the chip but i get this message.

Code: Select all

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e930d
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "test_leds.hex"
avrdude: error opening test_leds.hex: No such file or directory
avrdude: input file test_leds.hex auto detected as invalid format
avrdude: can't open input file test_leds.hex: No such file or directory
avrdude: read from file 'test_leds.hex' failed

avrdude: safemode: Fuses OK (H:01, E:DF, L:62)

avrdude done.  Thank you.
Im using a Macbook and don't know where to put the test file, from this tutorial.
http://ladyada.net/learn/avr/avrdude.html.
I saved it in my documents folder. But its not really a file. Its a web page. Zeros, ones, and letters.

Also, I can't get the Arduino boot loader to burn to the chip using your USBtinyISP.
Please help.

User avatar
Franklin97355
 
Posts: 23940
Joined: Mon Apr 21, 2008 2:33 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by Franklin97355 »

But its not really a file. Its a web page. Zeros, ones, and letters.
You can't directly load a web page. Could you give us more info like how you created the hex file, what you are trying to do and what command you use to launch avrdude? Also what are you trying to program and how is it connected?

User avatar
rc_flyer
 
Posts: 14
Joined: Sat Jan 24, 2015 10:00 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by rc_flyer »

My goal is to burn an Arduino sketch to the chip for a project. But first need the boot loader on the chip.
Here is what I have. A MacBookAir. The chip is an ATtiny861A
The red wires are all 5v, and white are data, ground, other. The crystal and caps are Adafruit part number 2215, 16mhz, 20pf.

Image

At http://ladyada.net/learn/avr/avrdude.html
the AVRDude tutorial, in the "putting it together" section, about halfway down the page it says to.....

Download the test_leds.hex file and place it in C:\ (Windows) or your home directory (Mac)
When I click the "pink" link it opens this....

Code: Select all

:1000000012C02AC029C028C027C026C025C024C0CD
:1000100023C022C021C020C01FC01EC01DC01CC0E4
:100020001BC01AC019C011241FBECFEDCDBF10E0F8
:10003000A0E6B0E0E4E0F1E003C0C89531960D928F
:10004000A036B107D1F710E0A0E6B0E001C01D92E4
:10005000A036B107E1F716C0D3CF61157105810550
:10006000910579F027E630E140E050E0245030403F
:100070004040504057FFFACF615070408040904060
:10008000ECCF0895CFEDD0E0DEBFCDBF8FEF87BBC3
:1000900018BA81E088BB68EC70E080E090E0DDDFBA
:1000A00082E088BB68EC70E080E090E0D6DF84E01E
:1000B00088BB68EC70E080E090E0CFDF88E088BB30
:1000C00068EC70E080E090E0C8DF80E188BB68EC1D
:1000D00070E080E090E0C1DF80E288BB68EC70E017
:1000E00080E090E0BADF80E488BB68EC70E080E0FC
:1000F00090E0B3DF80E888BB68EC70E080E090E0DF
:04010000ACDFC7CFDA
:00000001FF
So I copied it to text edit in plain text format and saved it as 'test_leds.hex' in my documents folder. I don't know what
a mac 'home directory' is.

Am I getting the wrong hex file, or putting it in the wrong place, or format?

User avatar
rc_flyer
 
Posts: 14
Joined: Sat Jan 24, 2015 10:00 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by rc_flyer »

The pictures are here.
http://rchelipilot2.weebly.com

User avatar
Franklin97355
 
Posts: 23940
Joined: Mon Apr 21, 2008 2:33 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by Franklin97355 »

The chip is an ATtiny861A
and what bootloader are you trying to load on this chip? Also what is the command you are sending to avrdude to try the load?

User avatar
rc_flyer
 
Posts: 14
Joined: Sat Jan 24, 2015 10:00 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by rc_flyer »

I am trying to burn an Arduino sketch to it.

I haven't tried to load anything yet with avrdude.
I'm still trying to get the USBtinyISP to work.

I have been trying to burn a chip, nights and weekends for 2 months with no success.
And a support member from element14 said I need a USBtinyISP.
So.............here we are. lol
I almost wish I had not started this, but now, it is no longer an Arduino project.
It is all out war with this little Tiny !!
Stan

User avatar
Franklin97355
 
Posts: 23940
Joined: Mon Apr 21, 2008 2:33 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by Franklin97355 »

You can use the USBtinyISP to burn code to your chip but it is not an arduino so you need to write code that runs on a ATtiny861A
I'm still trying to get the USBtinyISP to work.
What is not working? All it does is send data to the chip usually using avrdude to configure and send the data to the USBtinyISP.

User avatar
rc_flyer
 
Posts: 14
Joined: Sat Jan 24, 2015 10:00 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by rc_flyer »

I suspect it is working, except for the error opening test_leds.hex.
This file is probably in the wrong place.

But, if I burn the Arduino boot loader to the tiny, can't I then load a sketch on it and it will run
as if it were an Arduino?

User avatar
rc_flyer
 
Posts: 14
Joined: Sat Jan 24, 2015 10:00 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by rc_flyer »

I just thought of something............
If I get the Arduino boot loader on the chip, then burn my Neopixel sketch to it,
will the sketch run, because the Neopixel library is on my Mac and not plugged in with the usb cord?

User avatar
Franklin97355
 
Posts: 23940
Joined: Mon Apr 21, 2008 2:33 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by Franklin97355 »

1.) The Tiny is not an Arduino and has different registers and memory maps.
2.) The sketch upload will load everything it needs to function including any libraries included. These libraries need to be written for the Tiny or be generic enough not to call any ATMega 328 specific functions.

User avatar
rc_flyer
 
Posts: 14
Joined: Sat Jan 24, 2015 10:00 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by rc_flyer »

Thanks Franklin.
I am still getting...

avrdude: error opening blink.hex: No such file or directory

Where am I supposed to save this file so avrdude can find it?

Here is the code entered in avrdude...

Code: Select all

avr-gcc -mmcu=attiny861 -Wall -Os -o blink.elf blink.c

avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex

avrdude -p t861 -c usbtiny -e -U flash:w:blink.hex
I'm using a macbook.
I put it on the desktop, and in the documents folder.
Neither place works.

Please help.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: avrdude error opening test_leds.hex: No such file or dir

Post by adafruit_support_rick »

blink.hex or test_leds.hex needs to go in the same directory as avrdude. Either that, you you must specify the full path to the .hex file in your avrdude command line.

For instance, if test_leds is in your Documents folder, you would enter

avrdude -c usbtiny -p t861 -U flash:w:/Documents/test_leds.hex

User avatar
rc_flyer
 
Posts: 14
Joined: Sat Jan 24, 2015 10:00 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by rc_flyer »

I give up!

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: avrdude error opening test_leds.hex: No such file or dir

Post by adafruit_support_rick »

Did you try my suggestion? What was the result? What is the folder path to your .hex file?

User avatar
rc_flyer
 
Posts: 14
Joined: Sat Jan 24, 2015 10:00 pm

Re: avrdude error opening test_leds.hex: No such file or dir

Post by rc_flyer »

I tried your suggestion with no change.
I can't bring myself to give up.
But I'm so confused now........I not sure what I'm supposed to be doing.
So I'll tell you everything I'm doing.

Installed Crosspack for AVR
Attiny861a on bread board
Soldered USBtinyISP and used jumpers in place of r4 and r7.
Usbtinyisp with jumper in place for power to tiny861a on bread board.
USBtinyISP jumpers as follows.......ribbon pin 1 (by red wire and arrow) to miso on 861a, pin 2 to vcc and avcc, pin 3 to sck, pin 4 to mosi,
pin 5 to reset, pin 6 to gnd and agnd.

Plug in USBtinyISP via usb cable to macbook. Green light comes on.
Also the led on bread board from vcc to gnd comes on.

Then from http://www.micahcarrick.com/tutorials/a ... r-tutorial
I open TextWrangler.app, copy and paste the following, then save it in documents as blink.c.

Code: Select all

#define F_CPU 1000000UL

#include <avr/io.h>
#include <util/delay.h>

int
main (void)
{
    DDRB |= _BV(DDB0); 
    
    while(1) 
    {
        PORTB ^= _BV(PB6);
        _delay_ms(500);
    }
}
Then open Terminal.app in Utilities and type avrdude
Then copy/paste the following......

[img]avr-gcc -mmcu=attiny861 -Wall -Os -o blink.elf blink.c
avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex
avrdude -p t861 -c usbtiny -e -U flash:w:Documents/blink.c[/img]

This is what shows up.

[img]avrdude version 6.0.1, URL: <http://savannah.nongnu.org/projects/avrdude/>
stanleys-MacBook-Air:~ stanleythomas$ avr-gcc -mmcu=attiny861 -Wall -Os -o blink.elf blink.c
avr-gcc: error: blink.c: No such file or directory
avr-gcc: fatal error: no input files
compilation terminated.
stanleys-MacBook-Air:~ stanleythomas$ avr-objcopy -j .text -j .data -O ihex blink.elf blink.hex
avr-objcopy: 'blink.elf': No such file
stanleys-MacBook-Air:~ stanleythomas$ avrdude -p t861 -c usbtiny -e -U flash:w:Documents/blink.c[/img]

Then I hit Enter, in Terminal and get this.

[img]avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e930d
avrdude: erasing chip
avrdude: reading input file "Documents/blink.c"
avrdude: input file Documents/blink.c auto detected as invalid format
avrdude: invalid input file format: -1
avrdude: read from file 'Documents/blink.c' failed

avrdude: safemode: Fuses OK (H:01, E:DF, L:62)

avrdude done. Thank you.

stanleys-MacBook-Air:~ stanleythomas$ [/img]

I'm lost.
Please help

Locked
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”