Learning to flash again

Got my flash kit today, this will be my first attempt at flashing anything larger than atmega32p and the like. Advice and opinions about hex dump proggys and such, will be received with welcome. I’ll be flashing the big atmega, 556-ATMEGA644PA-PU, for the EU modular tester. :slight_smile:

Ahh Olivier makes it way too easy :wink:
Just checkout this repository: https://github.com/pichenettes/module_tester
and build/flash with: make -f module_tester/makefile bootstrap

Oh, and you may have to edit avril/makefile.mk and change the lines at the top to the correct paths and correct programmer for your system.

Well that sounds pretty easy, but might you be so kind as to give an example?

Ill be following this closely as the euro test module will also be my first attempt at flashing a chip.

Building from source look like so much hassle, wouldnt be using a binary a lot easier?

Anyhow, Flip is on holidays :stuck_out_tongue: but the example is right inside the makefile:
AVRLIB_TOOLS_PATH = /usr/local/CrossPack-AVR/bin/

Just change it to wherever you installed your (I think its avrdude being used here?) Point it to that binary and also change the programmer to whatever device you are using. Try avrdude -c to see a list of options. Would be an Arduino in my case.

So maybe
AVRLIB_TOOLS_PATH = /home/diwib/avrdude/bin/
PROGRAMMER = arduino

Wouldn’t it be easier to use avrdudess and the precompiled hex file?

Isn’t that exactly what I said in my very first sentence? :stuck_out_tongue:

Anyway, I was able set and verify fuses… no problem. What should lock bits be set to, if anything?
I’m able to load the hex file but it won’t verify 100%. I’m pulling down the pre-compiled file again and trying to reload. More later… I’m using ISP off the pocket usb programmer from Spark fun.

avrdude -B 100 -V -p m644p -c avrispmkII -P usb -e -u -U efuse:w:0xfd:m -U hfuse:w:0xd2:m -U lfuse:w:0xff:m -U lock:w:0x2f:m

Looking at the ambika firmware example Lock setting is 0x2f I don’t know what the :m is for though…

Should this be the same for the modular tester?

Yes, 0x2f is the lock setting for all my 644p projects. The “:m” means that “0x2F” should be interpreted as an immediate hexadecimal value rather than the name of a file from which the data would be pulled.

Thanks Oliver, I set the lock and was able to flash the chip, but came up with an error during verification:

avrdude.exe: verification error, first mismatch at byte 0x0100
0x03 != 0x00
avrdude.exe: verification error; content mismatch

Here is the command line AVRdudess generated:

-c usbtiny -p m644p -P usb -F -U flash:w:C:\\Users\\E5510 PreProd\\Desktop\\Embeded programming\\module_tester.hex -U lfuse:w:0xff:m -U hfuse:w:0xd4:m -U efuse:w:0xfd:m -U lock:w:0x2f:m

But then again you use the disable verify option

I use the disable verify option because I trust my programmer, but this error message is certainly a symptom of something going bad.

Try flashing at a lower speed (-B 2 or 4).

Thanks again Oliver,

You helped me realize I had set the baud rate (-b), not the bit clock (-B) to 100. After reviewing settings and reflashing I was able to successfully load the program and verify it to 100% ! Now to order parts and start working on a case. :slight_smile:

I wanted to include a couple of sites here that helped with setting up the ATM.



Still looking for a good site to learn how to “make” from source file and trying to upload a snapshot of avrdudess settings just for shi-grins.