zDrakon / arduino-tiny

Automatically exported from code.google.com/p/arduino-tiny
Other
0 stars 0 forks source link

AVRDUDE fails to auto-detect arduino-tiny binaries on Windows #117

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Compile code for ATtiny using the arduino-tiny core and create binary file.
2.Use avrdude like "avrdude -Cavrdude.conf  -pattiny85 -cusbtiny 
-Uflash:w:binary_file.bin:a" on Windows.

What is the expected output? What do you see instead?
Expected output is successful upload of the binary file. Instead, the output 
says
"avrdude: input file binary_file.bin auto detected as invalid format
avrdude: invalid input file format: -1"

What version of the product are you using? On what operating system?
I am using the arduino 1.0 version

Please provide any additional information below.
Standard Arduino core binaries get uploaded properly using 
"-Uflash:w:binary_file.bin:a"
The problem came up when I used the arduino-tiny core. If I use 
"-Uflash:w:binary_file.bin:r" (tell AVRDUDE
to upload raw binary instead of auto-detect the file type), then everything is 
ok. 

Is this a problem of the aruino-tiny core itself? 
Thanks in advance!

Original issue reported on code.google.com by fpapado...@gmail.com on 8 Aug 2014 at 11:14

GoogleCodeExporter commented 8 years ago
Test sketch...
void setup( void ) { }
void loop( void ) { }

Arduino IDE 1.0.5

No dot-bin file is produced.

Original comment by arduino....@gmail.com on 10 Aug 2014 at 8:03

GoogleCodeExporter commented 8 years ago
Hi again!

I am a member of the codebender (https://codebender.cc) team. Codebender is an 
online Arduino IDE (v1.0.5 compatible) and it uses the same toolchain in order 
to compile/upload Arduino projects. 
I do know that Arduino IDE uses hex files instead of binary, but there is a 
reason why we need to use binary files with AVRDUDE, as well as using 
auto-detection on upload.
The problem is that when compiling a project with the Arduino Tiny core (v1.0), 
the binaries are detected as invalid on Windows, whereas using the standard 
core (for example Arduino Uno), produces a valid binary.
Is there any way I can fix this?

Regards

Original comment by fpapado...@gmail.com on 13 Aug 2014 at 11:45

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
@fpapado
I have used IDE v1.0.5 on Windows to compile your sample sketch for Arduino Uno 
and no BIN file is generated.

Here are the final build step as well as the AVRDUD command line to upload the 
HEX file using USBtiny :
D:\arduino\hardware\tools\avr\bin\avr-gcc -Os -Wl,--gc-sections 
-mmcu=atmega328p -o C:\Temp\build6412160318083764428.tmp\sketch_aug18a.cpp.elf 
C:\Temp\build6412160318083764428.tmp\sketch_aug18a.cpp.o 
C:\Temp\build6412160318083764428.tmp\core.a 
-LC:\Temp\build6412160318083764428.tmp -lm 
D:\arduino\hardware\tools\avr\bin\avr-objcopy -O ihex -j .eeprom 
--set-section-flags=.eeprom=alloc,load --no-change-warnings 
--change-section-lma .eeprom=0 
C:\Temp\build6412160318083764428.tmp\sketch_aug18a.cpp.elf 
C:\Temp\build6412160318083764428.tmp\sketch_aug18a.cpp.eep 
D:\arduino\hardware\tools\avr\bin\avr-objcopy -O ihex -R .eeprom 
C:\Temp\build6412160318083764428.tmp\sketch_aug18a.cpp.elf 
C:\Temp\build6412160318083764428.tmp\sketch_aug18a.cpp.hex 
Binary sketch size: 444 bytes (of a 32,256 byte maximum)
D:\arduino\hardware/tools/avr/bin/avrdude 
-CD:\arduino\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p 
-cusbtiny 
-Uflash:w:C:\Temp\build6412160318083764428.tmp\sketch_aug18a.cpp.hex:i 

As you can see no BIN file is build/used, only HEX file.
This is a off-the-shelf IDE v1.0.5 for Windows building for Aruino UNO.

However, at no point arduino-tny can influence the build process. It only 
contains CODE that has been adapted/optimized for ATtiny instead of ATMega.
the build process is defined at 99% by Arduino IDE and slighly influenced by 
boards.txt/programmers.txt

Original comment by barbu...@gmail.com on 18 Aug 2014 at 4:43