Programming Fail with Megaload bootloader

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I've built the Megaload Bootloader for CodeVision and made my changes to the source code (changes like device number which is ATMEGA1280 and XTAL and Baud Rate)

Then I programmed the controller with the hex file and programmed necessary fuse bits (according to the Megaload Tutorial.pdf) . But I got Programming Fail message when I run the MegaLoad .NET program : 

 

 

 

So by looking at the pictures you will notice that the communication works without problem because the program has detected the Device and PageSize and things like that. Besides the second pictures shows the characters that have been received from MCU and by looking at the source code I realized it was sending those exact characters. 

The problem is pretty much clear. in the main part of the bootloader source code there is a while loop like this : 

		while (1)
		{
			WDR(); 
			GetPageNumber();

			if (RealPageAddress == 0xffff) break;

			if (WriteFlashPage()) TxChar('!');
			else TxChar('@');
		}

It's obvious the WriteFlashPage() function is returning zeros instead of a True value and then it sends '@' character (which we saw in the second picture)

 

Now I'm not that much pro in AVR and specially things like bootloader and its assembly coding. So I couldn't make much sense out of what WriteFlashPage() function does and why it's returning a false. 

I have used the older version of this bootloader with the ATMEGA128 before and had no problem with it. But apparently the older version does not support ATMEGA1280 so I had to use the last version. So I was kind of expecting it to work in the first or second try!!

Could you please help me ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It just turns out that the latest version of the Megaload Bootloader (the version I have problem with) can work with ATMEGA128 but NOT with ATMEGA1280

Does anybody have any ideas ?