howto: Use Atmel AVR Studio 5 to make a .hex file

It’s probly not what your missing its probly what studio 7 is missing.

That program actually even managed to degrade the version of 6.2 on my shop PC so that it will no longer recognize my programmer box. Not just me either. Even smart guys are having this issue.

http://www.avrfreaks.net/forum/avr-studio-will-not-find-avripsmkii?page=all

About half way down starts the 7.0 discussion.

I cant even get all the of trash components from 7.0 UNinstalled from my PC (almost like a virus) Reinstalling 6.2 with resents 7 still in there was to no avail either.

Lucky for me I have second PC with 6.2 still on it. That will have to do till I can either roll back or reformat to get rid of the poo.

Probably it’s only 1 error: the compiler is missing the file “tk-attiny.h”. Is it in your source directory?

Thanks for the imput guys!

Flashymike, you got me on the right track.

First I placed the “tk-attiny.h” file in every folder related to Atmel I could think of :smiley:
Still no joy though

After reading the output log I found the Narsil code is using 4 external files.
I placed the four “tk-*.h” files in the folder:

AtmelStudio\7.0\GccApplication7\GccApplication7\

(Application7 is offcourse the project name I use in AtmelStudio)

Then it compiled!

I don’t know if I can get away with 7.0 in the long run, but as long as I can it would be great. I don’t have another windows PC available…

I adjusted a few parameters in Narsil for my DQG and just wrote the .hex code with MHV AVR tools to my first Attiny85! Next to see if I can reflow it to the X6 driver.

Thanks for the help :+1:

I’m trying the firmware thing for the first time. My goal is just to recompile and reflash the factory firmware on my A6. I copy-pasted the main code to the editor window, and added the tk dependencies to the parent folder. It all looks good, but when I try to build it gives 9 errors. It appears like it may be building to the wrong target. But I am sure I chose attiny13a and am using avr for 8-bit. What might be the problem?

bump :frowning:

Tom posted a good detailed guide in the tiny25/85 thread on how to setup the environment. I had so many issues getting it to work in atmel studio I gave up and now just work with linux.

This is why I have been scared to try opening narsil, I just don’t want to have to go through all those compile errors again.

Lucky you I added the dependencies the lazy way (Copy them into the same project folder) this but still can't get the toykeeper bistro to compile in Atmel Studio 7 :(

I'm working out of a VM, so I really don't want to create a VM within a VM to run linux... Nor do I want tp or have the space to install linux on my laptop.

I believe it may just be a dependency problem. There is a bunch of includes like this

#include <avr/pgmspace.h>
#include <avr/eeprom.h>
#include <avr/sleep.h>   

and I don't know where to get them from.

As a software developer, if my pride was not so hurt I would have given up.

But I found the following information.

1) Install winAVR.

2) following this guid (Well sorta) -> https://avrstudio5.wordpress.com/2013/03/07/using-winavr-with-atmel-studio-6-0-or-later/

Now I just need to figure out why I don't have a .hex file :(

I'm getting an error:

Severity Code Description Project File Line
Error recipe for target 'main.o' failed Bistro C:\bazaar\Atmel\toykeeper\Bistro\Bistro\Bistro\Release\Makefile 79

Lines 79 and after in the makefile :

@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : 0.0.0
$(QUOTE)C:\WinAVR-20100110\avr-gcc.exe$(QUOTE) -x c -funsigned-char -funsigned-bitfields -DNDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.1.102\include" -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -Wall -mmcu=attiny25 -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
@echo Finished building: $<

Ok last post is probably not correct, what I was seeing is actually just an error that was short circuiting all the errors I was seeing before. The link I found shows the correct picture, but the description above seems to imply I was not supposed to select the bin directory shown in the picture. Well you do need the bin directory which was quite obvious after I figured out how to show the Output window in the IDE (It would display while compiling for 1/2 second then disappear!) .

Severity Code Description Project File Line Source
Error Program Memory Usage : 2412 bytes 117.8 % Full (Memory Overflow)
 Data Memory Usage : 29 bytes 22.7 % Full GccApplication1 GccApplication1 0 Build

I am trying to compile Bistro under Atmel Studio 7.

Did you actually get it to work Justintoxicated?

Here are the errors AS is giving me: Imgur: The magic of the Internet

I gave up with Atmel Studio 7 and installed the version suggested in the OP.

I realized that I had never defined which Attiny version I was using and this may have been the problem all along with AS 7. But all is working with AS 5. I can compile, produce hex, and load it onto a attiny25 with avr dude.

For those having a similiar problem to mine mentioned in my last post, you need to go into tk-attiny.h and choose which define you want. I am using #define ATTINY 25.

Its good to see you have it sorted david. You have a new world ahead of you now. :+1:

So I am trying to compile and flash toykeepers a6 firmare on an a6 driver and when i build it, it is compiling to 4kb. The one directly from toykeepers repository is 3kb. I cannot send mine to the chip as avrdude is telling me its too big. Any suggestions? I have not modified the code at all.

Optimize for size

Okay how do I do that?

Atmel Studio is using -Os by default which is apparently optimize for size.

Oh boy, after ordering hardware to flash my D4 I am now starting to look into the joy of the SW part of it. Anyway, based on what I am reading I see that likely Studio 5 is the way to go, but I am only finding Studio 7. Help please?

edit: Never mind, it took about 3 seconds to search and find a link in an old forum, presently installing . . .

Well, Atmel Studio 5 installed great, or so it seemed. At the end of the installation I got a note that some features would not run unless I installed a service patch. I ignored that, and got the same message when I opened Studio 5. So I tried to download the patch, and apparently it no longer exists. Oh joy . . . :person_facepalming:

Is there any reason 7 wont work the same?

not sure, I recall reading posts earlier in this thread that had problems with 7 for some reason, but likely I will give it a go next.