Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
david.harrison
PostPosted: Aug 21, 2009 - 09:41 PM
Rookie


Joined: Oct 21, 2007
Posts: 22
Location: Ottawa, Ontario, Canada

I want to use batchisp.exe to program fuse settings in the AT32UC3A1128 in chips that are already in system and have only the USB bootloader available - no JTAG port is accessible on the system board.

I setup the fuse settings I want in AVR32 Studio (2.2.0) and program them in a AT32UC3A1128 in an STK600 using JTAG. I then use the following script to read the fuse settings into a hex file that I could use subsequently to program the in-system chips.

batchisp.exe -device AT32UC3A1128 -hardware usb -operation memory configuration read savebuffer "ReadGPFuses.hex" hex386

The hex file that this produces is here :

:020000040000FA
:1000000001010101010101010101010101010101E0
:1000100001010101000000000000010000010101D8
:00000001FF

This should represent fuse settings of 0x640FFFFF

I then use the following script to write the ReadGPFuses.hex file to the in-system chips :

batchisp.exe -device AT32UC3A1128 -hardware usb -operation memory configuration program loadbuffer "ReadGPFuses.hex"

This script completes normally and looks as though everything is OK, BUT when I try to read the fuses back using batchisp, I cannot connect to the module using the bootloader and If I try to read the fuses using avr32program I get this message :

"The chip is protected. Perform a chip erase command to enable programming".

Then when I try to do that using avr32program through JTAG I get this message.

"Connected to STK600 (rev C). Firmware version 0x0206.
Failed to determine whether the CPU is in debug mode or not.
Falied reading from OCD debug register 4.
SAB read from address 0x100000010 failed.
Unexpected respons from STK600. Got 0xa0, expected 0x87."

I have two problems :

1) Why does writing the same ReadGPFuses.hex fuses
file back to the same chip that that file was
read from corrupt things and mess things up?

2) Why do I get the last error when I try to
perform a chip erase?

Note the last error only happens with the
latest GNU Toolchain version 2.2.1.
If I uninstall that and re-install
GNUToolchain version 2.1.4 the last error
does not occurr - I can then perform a chip
erase. BUT the chip is still corrupted when
I try the read/write fuses sequence through
batchisp.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
kblomqvist
PostPosted: Jul 10, 2012 - 10:57 AM
Hangaround


Joined: Dec 11, 2011
Posts: 200
Location: Finland

This is a late response, but as there was a question concerning the same topic, http://www.avrfreaks.net/index.php?name ... 949#963949 , I decided to answer.
david.harrison wrote:
I then use the following script to write the ReadGPFuses.hex file to the in-system chips :

batchisp.exe -device AT32UC3A1128 -hardware usb -operation memory configuration program loadbuffer "ReadGPFuses.hex
Batchisp commands are executed in order and you missed that. You should first load the buffer and then program:
Code:
batchisp.exe -device AT32UC3A1128 -hardware usb -operation memory configuration loadbuffer "ReadGPFuses.hex" program
It's also good to verify the memory after it has been reprogrammed:
Code:
batchisp.exe -device AT32UC3A1128 -hardware usb -operation memory configuration loadbuffer "ReadGPFuses.hex" program verify
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits