I want to write a driver for AT45DB041 dataflash for Open Flashloader. This flash has the page of 264 bytes. It seems that JLink supports only power of 2 sizes for pages. Any idea?
Thank you for your inquiry.
Yes, the Open Flashloader only supports page sizes with power of 2.
This is because in the J-Link internal these values are shifted to work with them.
Adjusting this for non power of 2 sizes is on the list, however this will not be supported any time soon.
There are good reasons to only use power of 2 for flash sizes and Atmel/Microchip decided to not
follow this convention for some reason.
The page size is used by the dll to call the flash loader to program a page and providing it with the data.
What the Flashloader actually does is 100% up to the flashloader.
Even though it is a little bit "hacky", it is absolutely possible to set the page size to a value
that is not the actual page size, as long as the Flashloader works around it.
Example: "Virtual" page size 512 bytes, actual page size 264 bytes:
1) The DLL then provides the flashloader with 512 bytes to program 1 "virtual" page (offset 0x0).
The flashloader internally programs actual pages:
1st page: 264 bytes.
2nd page: 248 bytes (16 bytes remaining).
2) The DLL calls the routine again to program the 2nd virtual page (offset 0x200):
The flashloader can calculate the remaining bytes of the 2nd actual page by the start address.
2nd page: program the remaining 16 bytes
3rd page: 264 bytes.
4th page: 232 bytes (32 bytes remaining).
As already mentioned this is of course only a work around, but it should do the trick in your case.
FabianPlease read the forum rules before posting.
Keep in mind, this is *not* a support forum.
Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
Should you be entitled to support you can contact us via our support system: segger.com/ticket/
Or you can contact us via e-mail.
ok, with this workaround it works!
Thank you so much