Go To Last Post
3 posts / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
I am trying to develop bootloader code with using boot.h library. I can write data to memory and erase data from memory
but i can only use 32kB of memory. I can
use atmega128 and its flash size 64kB.
When reach to address which is 0x7fff count turns to 0. How to erase or write whole memory space with boot.h library?
Last Edited: Thu. Jul 6, 2017 - 01:14 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"projects" is not the correct forum for this post. Tell me which AVR you are talking about and I'll move this thread to a more appropriate forum.


In passing I'll note that in the documentation for boot.h:


There is a given example of how the functions can be put together to make a boot_program_page(). Isn't that example about 90% of what you require in a bootloader. The only other bit is the comms. that is going to receive the binary to be programmed.




EDIT: Now I have fixed the layout problem in your post that was obscuring half the text I see it is about mega128 so I will move this to the correct place (tiny/mega forum)

EDIT2: When I look at the source for boot.h I see:

604 	#elif (FLASHEND > USHRT_MAX)
606 	/* Extended: >16 bit address */
607 	#define boot_page_fill(address, data) __boot_page_fill_extended(address, data)
608 	#define boot_page_erase(address)      __boot_page_erase_extended(address)
609 	#define boot_page_write(address)      __boot_page_write_extended(address)
610 	#define boot_rww_enable()             __boot_rww_enable()
611 	#define boot_lock_bits_set(lock_bits) __boot_lock_bits_set(lock_bits)

So for a device like 128 it should  be using the "extended" macros which cope with wide addresses. So it should work.


Tell us more about this "count". Something that "rolls over" at 0x7FFF sounds like something wrongly be held in "signed int"

Last Edited: Thu. Jul 6, 2017 - 01:20 PM