Read flash memory data, ATSAM3

911 views Asked by At

I am developing a Project over a Arduino Due Board(ATSAM3X), I am using Atmel Studio7, and ASF. I would like to know how to read a flash memory block/region, to calculate CRC32 or a simple check sum memory, the datasheet is very confusing, EEFC module describe how to write in the flash or how read "Unique Identifier", but not how read an address flash range.

If someone has a example code or documentation that i can read, I would be grateful.

Best Regards to everybody. Marco

1

There are 1 answers

0
Yash Jakhotiya On

You can use
char *ptr = <start address of the required memory block>;
and then start reading from ptr.

You happen to mention that you are going to calculate checksum. Calculating checksums of running programs has a disadvantage that the programs data section (section which contains variable assignments among other things) changes as program executes. Calculate checksum only of the text section, which remains constant throughout the program. Read about code sections for more details.