[chbot] Anyone seen this error ? avrdude: verification error, first mismatch at byte 0x3c000 on atmega2560

Volker Kuhlmann list57 at top.geek.nz
Tue Apr 21 01:11:54 BST 2020


On Tue 21 Apr 2020 06:12:50 NZST +1200, Peter Ellens wrote:

> FLASHEND is 0x3FFFF on atmega2560's so the the BOOTSIZE is set to
> 8192, but the APP_END is set to (0x3FFFF - (2*0x2000) + 1) = 0x3BFFE

Uhhmm, (0x3FFFF - (2*0x2000) + 1) = 0x3C000

> Later the code uses the line "if (eraseAddress < APP_END )" So
> uploading over via the boot loader will only erase bytes from
> 0x00000 to 0x3BFFE.

"if (eraseAddress < 0x3C000)"
would erase from 0x00000 to 0x3BFFF.
It's still 0x2000 short...

I wonder whether you ought to say 
	#if FLASHEND >= 0x0F000
in your patch, although with actually available CPUs it might not make
any difference.

Well done for locating the problem!

Volker

-- 
Volker Kuhlmann
http://volker.top.geek.nz/	Please do not CC list postings to me.



More information about the Chchrobotics mailing list