Author Topic: VEMS bootloader flash with ISP  (Read 7402 times)

Offline Karl Buchka

  • Jr. Member
  • **
  • Posts: 10
  • BHP: 5
VEMS bootloader flash with ISP
« on: February 15, 2013, 03:33:02 am »
I've got an older V3.3 VEMS board here that has become completely unresponsive.

I've gone over the hardware and couldn't find anything out of the ordinary. The board doesn't draw inordinate amounts of current, and all the voltages check out.

I've been trying to reflash the bootloader using an AVRISPMK2, but I've been unable to get any response from there either.

Before I assume the AVR is completely dead and must be replaced, I'm curious to know if the VEMS is delivered with the SPIEN bit unprogrammed. Does anyone know if this is the case? That could explain why I can't get my programmer to work.

The last time I had to program a bootloader on a VEMS was several years ago using an STK200 cable. I couldn't find anything online indicating that anyone has ever used a standard SPI programmer when flashing the VEMS bootloader.

Thanks

Offline Karl Buchka

  • Jr. Member
  • **
  • Posts: 10
  • BHP: 5
Re: VEMS bootloader flash with ISP
« Reply #1 on: February 19, 2013, 09:28:41 pm »
Figured I'd post some kind of follow up here for others that might be having the same problem.

Turns out I was being too clever for my own good. The ATmega128 has an ISP pinout that doesn't match any other AVR I've ever worked with.  :-[ The MOSI and MISO pins on the SPI unit are not used for serial programming. The TDO and TDI pins are.

After figuring that out, I was able to get a response from the m128, but I hit some other snags with the bootloader.

The scripts that come packaged with the bootloader seem somewhat broken. There are absolute paths that require editing to resolve and I couldn't run the bootloader id patch script in windows with just Perl installed, so I ended up doing it on a linux machine. Cygwin would probably work though.

After patching and flashing the bootloader and flashing the fuse bits, I wasn't able to get a response from VemsTune.

I ended up stitching the firmware and bootloader hex files together in a text editor by removing the last line of the firmware's hex file and pasting the bootloader lines in after it. After flashing, everything seems ok.

VemsTune can talk to the box and the serial number shows up properly.