Lock bits info

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

Hi, i'm writing a bootloader for atmega2560 microcontroller and i'm getting a bit confused with lock bits.
 

Can someone please explain to me how it works?

The quieter you become, the more you can hear.

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

Maybe turn that around - exactly what protection are you looking for? Presumably you want things set so that the bootloader cannot inadvertently write over itself?

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

i want bootloader self update. At the moment i set 0xFF lockbits. but when i try to erase entire flash it doesn't happens. So maybe there's other stuff. I red also about "Read While Write". Could this is the problem?

The quieter you become, the more you can hear.

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

Yanujz wrote:
i want bootloader self update.
Wow - that is very very difficult to do in an AVR but sadly it means you almost certainly cannot enable any kind of BLB protection as that is all about stopping the bootloader being over-written but you need to keep that option open.

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

My idea is to keep bootloader in ram until new bootloader is flashed. What do you thinks about this?

The quieter you become, the more you can hear.

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

Yanujz wrote:
i want bootloader self update

You want your boot loader to be perfect, as it is almost impossible to update it in the field!

Why do you want to change your bootloader?

 

Jim

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

ki0bk wrote:
Why do you want to change your bootloader?

it's just prevention, in certain project maybe i can't take physically  the microcontroller. If i have a new version of bootloader i want upgrade the old one. For sure it's not like firmware update (like weekly), but if i need i can do it.

The quieter you become, the more you can hear.

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

Best to design your bootloader so it does not need updating!  Take the TIME to do it correctly, taking all possibilities into account!

Think then program!

 

Jim

If the boot loader does need updating, that is what ISP is all about!

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

ki0bk wrote:
Best to design your bootloader so it does not need updating!
+1000

 

If you get it right first time (and keep it simple!) then there should never be a need to update. In that case you can apply locks to the one bootloader and it will be much more robust.

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

ki0bk wrote:
Best to design your bootloader so it does not need updating!

I 100% agree with you.

The quieter you become, the more you can hear.

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

I feel like that's sort of awful advice. Humans are, quite consistently, incapable of being 100% flawless. There will be a bug. Eventually. Designing for what to do when that happens is good engineering.