Hello,
I'am having some difficulties to understand how the on-chip flash memory works and how to reprogram it during a program execution.
I mainly need answers to the following questions:
1) The S29AL008D datasheet indicates that the #BYTE pin is used to configure the device into 8bits or 16 bits mode. I cannot find any reference to such pin in the BF538F datasheet and therefore assume it is set on hardware. Is it set to use 8bits or 16bits mode, is there a MMR to configure it?
2) If it is set in 16bits mode, ho do addresses work? I mean, are each address used to access all 16 bits, or are even addresses used to access the lower half of the 16 bits and the odd addresses used for the upper half, or vice versa?
3) According to the S29AL008D datasheet, the command to program the flash is to first write 0xAA at relative address 0x555, then 0x55 at 0x2AA, then 0xA0 at 0x555 and finaly the desired word (16bits) at the desired address (for byte mode, it is 0xAA at 0xAAA, then 0x55 at 0x555, then 0xA0 at 0xAAA and finaly the data). However in the adi_S29AL004D_8D.c file, which is the driver for the on-chip flash given with VisualDSP++, they write 0xAA at 0xAAA, then 0x55 at 0x554, then 0xA0 at0xAAA and the data to write words... How do you explain that? (table below summerizes the values given here)
| Address 1 | Data 1 | Address 2 | Data 2 | Address 3 | Data 3 | |
|---|---|---|---|---|---|---|
| Datasheet : word | 0x555 | 0xAA | 0x2AA | 0x55 | 0x555 | 0xA0 |
| Datasheet : byte | 0xAAA | 0x555 | 0xAAA | |||
| Driver : word ? | 0xAAA | 0x554 | 0xAAA |
4) If both the 16bits and 8bits modes are avaible, when booting from flash (Boot mode 01), is it set as 8bits or 16bits by default.
Thank you for trying to help me out. If you do not have the answers to those questions but have a working code (in c or asm) to directly read/write from the on-chip memory you may post it here as well if you think it can help.
Thank you again.