Filesystem NAND problem

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Filesystem NAND problem

      New

      Hello,
      I am facing with a big problem with my tool based on LP2478 and NAND Flash with FAT Filesystem placed on the EMC bus together with a RAM.
      The emFile version is 3.22a

      My flash was obsolete and I have changed it for a new compatible one.
      In this link I have included the two datasheet, NEW and OLD Nand FLASH.
      https://drive.google.com/drive/folders/1OvuxNXTXEWVQTaweNiXdhCsgp_KPeA0W?usp=sharing

      I have problem with bad read: I have uploaded a screenshot of my device with the filesystem full LOG enabled.

      the Busy pin is sampled via a GPIO pin in this way:

      OPTIMIZE int FS_NAND_HW_X_WaitWhileBusy(U8 Unit, unsigned us)
      {
      //
      // This function is called to check the busy pin of
      // the NAND flash.
      // When no busy pin is available this function should
      // return 1, so the upper layer can check if NAND
      // flash is busy.
      //

      /* while( FIO1PIN & (1 << 13) );// from high to low once
      __asm
      {
      nop
      nop
      }*/
      while( !(FIO2PIN & (1 << 12)) ); /* from low to high once */
      return 0;

      }


      Verying from this:
      EMC_STA_WAITWEN0 = 0x2;
      EMC_STA_WAITOEN0 = 0x2;
      EMC_STA_WAITRD0 = 0x1f;
      EMC_STA_WAITPAGE0 = 0x1f;
      EMC_STA_WAITWR0 = 0x1f;
      EMC_STA_WAITTURN0 = 0xf;
      EMC_STA_CFG0 = 0x00000081;

      to this:

      EMC_STA_WAITWEN0 = 0x0;
      EMC_STA_WAITOEN0 = 0x0;
      EMC_STA_WAITRD0 = 0x5;
      EMC_STA_WAITPAGE0 = 0x2;
      EMC_STA_WAITWR0 = 0x3;
      EMC_STA_WAITTURN0 = 0x1;
      EMC_STA_CFG0 = 0x00000081;


      i have noticed that varying the EMC timing the problem changed: the problem is translated in the WRITING and the filesystem becomes corrupted and inusable (no more writing allowed). Unfortunately now I do not have screenshot of the error.

      Anyone has some advices?
      Thanks a lot.
      Images
      • WhatsApp Image 2019-01-19 at 16.06.24.jpeg

        127.09 kB, 1,600×1,200, viewed 3 times