Read and write a value from flash's user page of AT32UC3A3256

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

Anybody do have an example for accessing flash user page of AT32UC3A3256.

Thanks in advance.

regards,

Sathishkumar.

Sathishkumar.

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

Have you looked for example code in ASF?

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

Reading from the user page (or flash) is easy., create a pointer to a variable or structure and set it to the address you want. (the user page starts at 0x80800000).


Writing to the flash (or user page) is more complicated, because you need to write an entire page of 512 bytes and you need to tell the FLASHC module what to do.
A general method is ;
a) clear the page buffer.
b) write your data to the page buffer.
c) erase the target page in the flash.
d) write the page buffer to the flash page.


If you are using the ASF it defines AVR32_FLASHC_USERPAGE_ADDRESS as 0x80800000
The ASF has an FLASHC driver and one of the many routines available is flashc_memcpy(,,,)

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

@clawson thanks for your reply, i saw the examples but didn't give a proper picture so that only i asked for the some suggestions.

 

@mikech thanks for your reply, i did as per your steps it worked, i was wondering that reading is direct reading, but why writing can't be done through the same process??

 

 

regards,

Sathishkumar.

Sathishkumar.