View previous topic :: View next topic |
Author |
Message |
marcomilazzo
Joined: 12 Oct 2005 Posts: 19
|
Posted: Mon Nov 25, 2019 8:00 pm Post subject: atmega328pb bootloader |
|
|
Hi
i an using the bootloader Bootloader.bas with atmega328pb
the bootloader is about 32K bin and my program about the same !
how is this possible?
there is a bug if i do not use the baudrate for all
How big is the bootloder ?
what are the correct setting for atmega328pb?
thank's marco
(BASCOM-AVR version : 2.0.8.2 ) |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Mon Nov 25, 2019 9:55 pm Post subject: |
|
|
Hi,
Read the data sheet. The bootloader "sits" at the top end of the Flash Memory (in last few KB).
You download the bootloader code to the AVR, the first 30Kb or so are empty, with the bootloader at the end. When you load you program with the bootloader, the bootloader starts at the lowest Flash address.
So, for example if you AVR has 32Kb Flash and the bootloader is 2Kb in size, the main application can only be Maximum 30Kb in size.
The starting address for the bootloader can usually be defined using the "fuse bits". Read the data sheet for the CPU to see what Options are available.
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
marcomilazzo
Joined: 12 Oct 2005 Posts: 19
|
Posted: Tue Nov 26, 2019 12:18 pm Post subject: |
|
|
Hi Ian
Thank's for the answer
Still ,how big is the boot loader? i'm courious
after compilation it's about 30KB
i tryied
$boot = $3c00
$inc Bootloader , Nosize , "BootLoader.bin"
this way i can program all togheter
and it's too big
if i program the bootloader and then i pass my code all works fine
i like to understand
marco |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Tue Nov 26, 2019 12:37 pm Post subject: |
|
|
Hello,
have a look at the data sheet for you CPU. Most AVR's have fuse bits that define the maximum size of the bootloader/the start address for the bootloader.
Your main application cannot be so large that it overwrites part of the bootloader.
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
marcomilazzo
Joined: 12 Oct 2005 Posts: 19
|
Posted: Tue Nov 26, 2019 12:58 pm Post subject: |
|
|
Hi Ian
i think i got it
compiling the bootloader it gives a file large to fit all the memory
while the code is at the end .eliminating the usless FF i get less then 2K(the true bootloader)
is there a way to add the bootloader code to my code and tell it to go in the desired position ?
marco |
|
Back to top |
|
|
|