Post Go back to editing

BF538F - On-chip Flash

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.

  • Hi,

    regarding your third question, this is explained in the readme for the Flash Programmer Driver at: "...\Blackfin\Examples\ADSP-BF538F EZ-KIT Lite\Flash Programmer\InternalFlash\"

    For your convenience:

    "If you take a look at the datasheet for the ADSP-BF538 processor A0-A18 of the flash is connected to A1-A19 of the processor because A0 does not exist on the processor. Because of this whenever we put an 8 bit command on the bus it actually is a 16 bit command when it gets to the connection with the flash. So if we put a 0x554 on the bus the flash sees that as 0x2AA and if we put an 0xAAA on the bus the flash sees that as a 0x555.


    We use 0x554 because if we use a 0x555 we will trigger a misaligned access exception in EXCAUSE since only 16 bit writes are supported to ASYNC memory. This is also the same reasoning as to why when loading the driver in the flash programmer, you will see a sector map that uses the 8 bit address ranges. When these addresses are placed on the bus, they are shifted, and are actually seen as 16-bit addresses."
    Regards,
    Craig.
  • Thank you CraigG,

    Your answer pretty much answered all of my interogations!

    I probably had missed that pragraph of the datasheet...

    With it, i could gess the following :

    1) Only the 16bits mode is avaible, it is internally linked, no MMR can change it.

    2) Only even addresses are valid and access 16bits.

    3) See CraigG answer

    4) Only the 16bits mode is avaible.

  • Hi djerem,

    you could probably look at the source of the uboot bootloader or the BFloader backend (ICEbear flash driver) for AMD command compatible flashes to see how the proper flash sequences have to look like.

    Cheers,

    - Martin

    P.S. Ah, just attaching the relevant file for convenience...

    cfi.c.zip