Forum: ARM programming with GCC/GNU tools at91sam7: operating flash

Author: Roman Mashak (romez777)
Posted on:

Rate this post
0 useful
not useful

I'm studying how to handle flash by the Atmel's examples and some found
on this site. Atmel provides library implementing the basic functions:
write page in flash, set/clear lock bits and so on.

I observed that the buffer's size passed to routine writing page in
flash is "FLASH_PAGE_SIZE_BYTE / 4", where FLASH_PAGE_SIZE_BYTE is page
size of the flash.

Why is it so? Is it because of 32-bit access to flash? Atmel datasheets
recommend to write the whole pages at once.

Author: Roman Mashak (romez777)
Posted on:

Rate this post
0 useful
not useful
I figured out why it is so, strange I could not get it earlier :) It's
all about the way we access the flash, i.e. by 4-bytes (32 bit). In
other words, we fill out the page NOT with bytes, but with 4-BYTES
blocks, hence the division.


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.