I've got an AT90CAN128 I'm trying to program with an Atmel ICE using a .hex
file consisting of a bootloader and application code.
I can erase the flash, write fuse values and write to the eeprom just fine - or at least without any error messages, but when I try to write to the flash, the operation just times out after a while. I tried increasing the timeout to 10mins, but there was no change.
I am confident that the .hex
file is not the issue as we successfully used it a few months ago and its "last modified" date predates that.
I have tried setting the fuses to allow serial programming, with no change.
What else should I be looking at?
Our programming process looks like
atprogram -t atmelice -i ISP -d at90can128 chiperase
atprogram -t atmelice -i ISP -d at90can128 program -fl -f "8000-00815-01_S_with_Bootloader.hex" --verify
atprogram -t atmelice -i ISP -d at90can128 program -ee -f "8000-00901-01_C.hex" --verify
atprogram -t atmelice -i ISP -d at90can128 write -fs --values FFF0FD
But it just sits and spins at the first programming step, and eventually times out.
I've tried adding the -xr
and --timeout 600
flags. I also tried running all the other commands, and they all succeeded.
Further info from comments:
It appears that I can successfully read from the flash using atprogram -t atmelice -i ISP -d at90can128 read -fl -s 1024
, which gives me a bunch of 0xff
bytes. Running a similar command with the -ee
switch confirms the eeprom is being written correctly.
If I disconnect the MCU, all the commands fail with a completely different error message.
Further, I have discovered I can program something onto the MCU using Microchip Studio, but that is not practical for use long term.
I can erase the flash
... how do you know this? \$\endgroup\$chiperase
command succeeds, without any errors. Is that not what that command does? \$\endgroup\$chiperase
fail if the AT90CAN128 is not connected? ... doeschiperase
have a-verify
option available? \$\endgroup\$chiperase
(and the other commands) fail with a completely different message if the IC is not connected, and there is no--verify
option available on that command. \$\endgroup\$