2011-02-25 08:16:45     Flash read error

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-02-25 08:16:45     Flash read error

ThangarJ P (INDIA)

Message: 98440   


Hi ,


we are working in 2010R1-RC5 distribution and BF527 based custom board.


we ported our custom flash driver in this kerenl.


It seems the flash read data is wrong.


we are not facing this issue in 2009R1.The flash read data is proper.


we are using the same hardware and the same flash driver code is ported in both the kernels.


Is there any kerenl dependency?


Please provide your suggestions.




Thank you,






2011-02-28 10:36:37     Re: Flash read error

Mike Frysinger (UNITED STATES)

Message: 98471   


you need to provide real details before you can get any sort of useful response


what kind of flash are you using ?  what is your driver exactly ?  what is the problem you're seeing exactly ?  what timings exactly are you using ?


why not post the code to the forum ?




2011-03-01 01:19:22     Re: Flash read error

ThangarJ P (INDIA)

Message: 98480   


Dear Mike,


we are using the flash chip  macronix(MX29GL128E) .it is a intel cmd set nand flash type.


i have attached the code with this message.


Its a character driver implementation.


we are locking all the flash sectors at the flash driver initialization.


The following sequence are done while  the flash programming.


1.unlock the sector


2.flash write.


3.lock the sector.




we are facing the problem in static int FLASH_Init(void) API in the file MX29GL256E.c of line no 1030.


All the scetors are locking in this API.Thats in the for loop which starts from the line no:1134.


we reading the sector status before locking the sector and also after locking the sector .thats printed in the log.


the sector status is same as before  and after lock the the sector and status value also wrong in 2010 kerel.


but in 2009 kernel the sector status is zero before locking and its one after locking.


the same hardware and same driver code used for both the kernels.


i have attached the log for both 2010 kernel as well as 2009 kerenl.




Please  provide ur suggestions.


Thank you,









2011-03-01 02:04:16     Re: Flash read error

Mike Frysinger (UNITED STATES)

Message: 98481   


why arent you using the MTD stack ?  writing your own custom driver (char at that) makes no sense at all.


looking at this code, i'd venture that it's pure luck it worked at all in 2009R1.  you're ignoring all of the proper i/o accessors defined in asm/io.h.


so you can do it the right way (use MTD), or you can have fun debugging this thing.




2011-03-07 02:02:35     Re: Flash read error

ThangarJ P (INDIA)

Message: 98663   


Hi Mike,


We used the io access apis and the problem disappeared.


we used mtd drivers also but due to our customer requirement we have developed this custom driver.


the io access apis and the custom developed apis are used for the same purpose,


but in the case of custom apis it did not work only in 2010R1.


what could be the reason? can you tell us so that we will try to avoid such mistakes in future.


Thank you.




2011-03-07 05:27:05     Re: Flash read error

Mike Frysinger (UNITED STATES)

Message: 98667   


i see no functionality that your driver provides that is not already available in the MTD stack.  so i dont know what possible "customer requirement" would necessitate this waste of developer resources.