Compiling on windows without Atmel Studio

All the tutorials I see on here for customizing and building drivers present how to install Atmel studio, create a project and get your code into it, and then use atmel to compile. AS is GREAT for its debugging and simulator (the simulator is really fantastic from my perspective) but it seems the process is surely a little daunting for the noob who just wants to enable a feature and recompile it on an attiny45 instead of an attiny25.

I've made a makefile for bistro-HD, and having based it loosely on Atmel's Makefile I thought it needed DFP packs from atmel, but then realized it doesn't (not sure what those even do but they don't change my builds). I can change the GCC directory in the makefile to WinAVR and have a .bat file that just has the make command, and all you have to do is install winavr, and click the bat file.

Maybe this is something folks are already aware of, I don't know (I'm sure some of the experts are). I know TA had linux builld scripts, but that's not always as convenient either.

The process this way goes like:

a) order usbasp and clip from fastech

b) click on some WinAVR setup link somewhere to install.

c) download the firmware source.

d) connect your usbasp up to your computer and driver

e) double click a bat script that compiles the driver

f) double click another bat script that flashes.

Then once you're comfortable with that, change some files and do it again and you're now a firmware customizer. Anyone interested in flashing hex's needs every step here except b and e anyway, two clicks.

My Makefile at the moment is very specialized. You'd want something a little more generic to apply it more universally, but that's easy enough.

Sounds interesting. I am not an expert with this sort of stuff. Are there any limitations compared to Atmel studio? What if there is an error in the code?

If you're compiling a single hex, the error will be printed somewhere very near the end of the output. Warnings are a little trickier. I don't know if they print on stderr or stdoutput. Worst case they'd have to be grepped I guess. Anyway, it's should be doable to get them sent to a separate file, but I haven't done it. You can scroll up and find them though, really worst case. It works fine. I've done a bunch of compiling that way and still don't find it uncomfortable.

Limitations? Well, code just exists in text files. It's nice to at least have a highlighting editor, but even that is not a huge handicap to not have it either. I'd say it's about like cruise control on a car, or maybe more like power mirrors. It's nice but it's not like driving is particularly difficult without them. Notepad will get the job done. The main thing is just the simulator in AS. Of course if you start getting into it more, that's all stuff you'll probably want, being that it's 2017, but you can still find cars without power mirrors too.

I guess I should add my batch file stays open after completion. There are a couple of ways to make that happen. Maybe that was your point.

Oops, seems I only took the DFP's out in one place, (-B switch which I don't quite understand), but not in the standard -I include switch. That's still needed. I'll have to see if WinAVR has replacements. This is basically all the aliases for port numbers likce DIDR0 and TCCROA etc. Not actually a big thing, but still in the way since the idea was to make things easier, not harder.

So that was easily solved. WinAVR has its own headers, not too surprisingly. I haven't timed it but it also seems quite a bit faster, which actually matters when you're building as many hex's at once as I am. I'll release bistro-HD Universal Edition with a build system like this and at some point maybe I'll make instructions for something a little more general.