Data flash AT45DB321D writing/reading length and bit-padding

Discussion about SAM7 Series and ARM7TDMI based products.

Moderator: nferre

RafaelA
Posts: 6
Joined: Fri Oct 03, 2014 4:44 pm

Data flash AT45DB321D writing/reading length and bit-padding

Mon Sep 28, 2015 9:26 am

Hi,

I am trying to write to data flash the following structure:
  1. 1 instance of a structure which consists of 20-char string + 1-byte unsigned integer.
  • 8 instances of a structure which consists of 4-byte signed integer, 2-byte signed integer, 2-byte signed integer, 1-byte unsigned integer.
I write 14 instances of this structure on 14 adjacent pages, that is, 1 instance per 1 page. After reading back, I always get corrupted data, which happens to match the 2nd, 3rd, and 4th signed integers of the eighth instance of the second structure of the thirteenth instance of the parent structure. It does not matter which data, but it is always the same "cell" or memory area, even if I play with the structure architecture.

My question: is there any need for bit-padding all variables so that they are 32-bit (4-byte)? I have found some statements like this on some comments from some pieces of Android code deployed on Atmel's data flash, but I haven't found anything similar on Atmel's datasheets.

Thanks in advance,
Rafael

Return to “SAM7 ARM7TDMI MCU”

Who is online

Users browsing this forum: No registered users and 3 guests