This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Flash programming fails with AT45DB641E

We are working on at91sam9G20 controller, which is interfaced to AT45DB641E data flash
recently AT45DB642D got obsolete. Keil flash programming algorithms are available
for AT45DB642D only.
AT45DB641E is a 264 page size flash whereas AT45DB642D is 1056
how can I configure/modify the flash programming algorithm to suite
for AT45DB641E

Regards
Kumar

Parents Reply Children
  • Hi Kumar,

    can you please share the flash algorithm for AT45DB641E flash device.. Even i am trying to use the same flash but unbale to get the algorithm.

    Regards,

  • I am unable to upload flash algorithm (.FLX file) as attachment, Please follow the
    instructions and create at your end.

    make a copy the project \ARM\Flash\AT91SAM9_DF
    edit FlashDev.c file
    Add the following lines at the end of file

    
    #ifdef P264_CS1               // Page Size 264 Bytes, Chip Select 1
    struct FlashDevice const FlashDevice  =  {
       FLASH_DRV_VERS,             // Driver Version, do not modify!
       "AT91SAM9 DataFlash Page264 CS1(45DB641E)",   // Device Name
       EXTSPI,                     // Device Type
       0x20000000,                 // Device Start Address
       0x00840000,                 // Device Size in Bytes (8.25MB)
       264,                        // Programming Page Size
       0,                          // Reserved, must be 0
       0xFF,                       // Initial Content of Erased Memory
       100,                        // Program Page Timeout 100 mSec
       100,                        // Erase Sector Timeout 100 mSec
    
    // Specify Size and Address of Sectors
       0x840, 0x000000,           // Sector Size 2112 bytes (block = 8*page)
       SECTOR_END
    };
    #endif
    
    #ifdef P256_CS1               // Page Size 256 Bytes, Chip Select 1
    struct FlashDevice const FlashDevice  =  {
       FLASH_DRV_VERS,             // Driver Version, do not modify!
       "AT91SAM9 DataFlash Page256 CS1(45DB641E)",   // Device Name
       EXTSPI,                     // Device Type
       0x20000000,                 // Device Start Address
       0x00840000,                 // Device Size in Bytes (8.25MB)
       256,                        // Programming Page Size
       0,                          // Reserved, must be 0
       0xFF,                       // Initial Content of Erased Memory
       100,                        // Program Page Timeout 100 mSec
       100,                        // Erase Sector Timeout 100 mSec
    
    // Specify Size and Address of Sectors
       0x800, 0x000000,           // Sector Size 2048 bytes (block = 8*page)
       SECTOR_END
    };
    #endif
    
    

    pass, P256_CS1 or P264_CS1 through preprocessor symbols (present in project options dialog)
    as required

    add the following lines to DFlashHW.c (in the beginning)

    
    // ----------------- Page Size 264, CS1 used ----------------------------------
    #ifdef P264_CS1
    #define PAGE_SIZE    264               // Size of page
    #define ADDR_BITS    9                 // Bits for addressing inside page
    #define CHIP_SIZE    0x840000          // Chip size (in bytes) = 8MB
    #define SPI_PCS_DF   SPI_PCS1_DF
    #define CS_INDEX     1
    #endif
    
    // ----------------- Page Size 256, CS1 used ----------------------------------
    #ifdef P256_CS1
    #define PAGE_SIZE    256               // Size of page
    #define ADDR_BITS    8                 // Bits for addressing inside page
    #define CHIP_SIZE    0x840000          // Chip size (in bytes) = 8MB
    #define SPI_PCS_DF   SPI_PCS1_DF
    #define CS_INDEX     1
    #endif
    
    

    compile the project, FLX file will be generated
    copy FLX Files to \ARM\Flash folder
    restart keil
    new flash programming algorithm can be seen in flash programming window.

    Regards
    Kumar