First, consult the datasheet, or [url]http://www.engbedded.com/fusecalc/[/url] about the possible boot addresses, for an ATMega32 for example, it is 0x3800, 0x3C00, 0x3E00 and 0x3F00. These addresses are word-addresses, CPeek() works on byte-addresses, so these boot addresses have to be multiplied by 2.
If either address is different to 0xFF, then there's a chance that a boot-loader exists at this address.
However it can happen, that no boot-loader is installed, and the program reaches within the boot-loader memory range, the simple test for an empty cell isn't possible then.
One has to look then for the boot-loader's footprint, let's say the first three bytes, which for a certain loader will be very likely always the same.
↧