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

Using Keil File System on STM32F4 with NAND

Hi!
I have MT29F32G08CBACA Nand Flash device, and I need wear leveling.
This device have Page Size = 4096 user + 224 spare bytes. But in FS_Config_NAND_0.h a can chose only 4096+ 128. Will this device work with the Keil File System?

Parents
  • Hi.
    I difined NAND0_PAGE_SIZE 4320.
    I'm trying to do next code, drive N0 not formatted, it's okey becose never formatted before.
    And when I do: stat = fformat ("N0:", "/LL");,
    I get error and stat = 8.

    static void Filesystem_Init (void)
    {
            fsStatus stat;
    
            /* Initialize and mount drive "N0" */
      stat = finit ("N0:");
      if (stat == fsOK) {
        stat = fmount ("N0:");
        if (stat == fsOK) {
          printf ("Drive N0 ready!\n\r");
        }
        else if (stat == fsNoFileSystem) {
          /* Format the drive */
          printf ("Drive N0 not formatted!\n\r");
          cmd_format ();
        }
        else {
          printf ("Drive N0 mount failed with error code %x\n\r", stat);
        }
      }
      else {
        printf ("Drive N0 initialization failed!\n\r");
      }
    }
    static void cmd_format (void) {
    
            fsStatus stat;
            stat = fformat ("N0:", "/LL");
    
      if (stat == fsOK) {
        printf ("Format completed.\n\r");
      }
      else {
        printf ("Formatting failed. Code = %d\n\r", stat);
      }
    
    }
    

    About ECC: Minimum required ECC 24-bit ECC per 1080 bytes of data. It's from DS.

Reply
  • Hi.
    I difined NAND0_PAGE_SIZE 4320.
    I'm trying to do next code, drive N0 not formatted, it's okey becose never formatted before.
    And when I do: stat = fformat ("N0:", "/LL");,
    I get error and stat = 8.

    static void Filesystem_Init (void)
    {
            fsStatus stat;
    
            /* Initialize and mount drive "N0" */
      stat = finit ("N0:");
      if (stat == fsOK) {
        stat = fmount ("N0:");
        if (stat == fsOK) {
          printf ("Drive N0 ready!\n\r");
        }
        else if (stat == fsNoFileSystem) {
          /* Format the drive */
          printf ("Drive N0 not formatted!\n\r");
          cmd_format ();
        }
        else {
          printf ("Drive N0 mount failed with error code %x\n\r", stat);
        }
      }
      else {
        printf ("Drive N0 initialization failed!\n\r");
      }
    }
    static void cmd_format (void) {
    
            fsStatus stat;
            stat = fformat ("N0:", "/LL");
    
      if (stat == fsOK) {
        printf ("Format completed.\n\r");
      }
      else {
        printf ("Formatting failed. Code = %d\n\r", stat);
      }
    
    }
    

    About ECC: Minimum required ECC 24-bit ECC per 1080 bytes of data. It's from DS.

Children
No data