I have an arduino uno with me and have removed the microcontroller IC from it. If I read the hex file from that then will it contain the bootloader or not??The chip has bootloader in it but will the read hex file also have the bootloader or it will only give the program memory to me excluding bootloader.
the whole memory includes the boot loader (corrected - I had misread)
So the programmer actually doesnt give me the bootloaader section of it
when reading from it
did you connect to the ICSP (In-Circuit Serial Programming) header of your arduino ?
what programmer do you use?
I am using USBasp
and did you use the programer as well to program the arduino? (in which case you wiped the boot loader)
no I havent used it to program arduino it has the bootloader in it
I think that the programmer generally doesn't have a concept of a bootloader. It's all one chunk of memory. Usually when you select the device in your programmer and you the read the device, the programmer will read all of the memory. (Note you may have to select the memory you want to read if the device supports different memory types such as flash and EEPROM).
This is true even if you have previously programmed the device with a small program that only fills a quarter of the memory. The programmer doesn't know this or how to tell the difference between a program and unused memory. If your device has 32kb of flash, then your programmer will read 32kb of data for you.
I am wondering why wount it include the bootloader in it
how do you know it does not include the boot loader ?
are you using avrdude to extract the content?
This then means if I have a seperate section for bootloader it will read that as well
you said earlier
Yes. Unless your specific programmer does something differently. Some microcontrollers have a section of flash that can be protected. This is generally where a bootloader lives. It's possible that by reading the fuse settings within the microcontroller that the programmer may know that there is a protected area (and maybe even the size of that protected area) and offer you 2 separate files, but I've not seen it and my XGecu T48 PROM programmer doesn't do it.
Check the addresses in the hex file.
As far as I can remember, the hex file that you extract contains the full memory (32k for Uno).
When we read the flash of the removed ATmega328P, we read the entire memoy content that is composed of "user codes if any + Bootloader codes".