NAND Flash behaving weirdly

Discussion around AT91RM9200 and SAM9 Series Products.

Moderator: nferre

wesperos
Posts: 8
Joined: Sun Jan 15, 2017 3:37 pm

NAND Flash behaving weirdly

Tue Jan 24, 2017 12:41 am

Hello guys... still struggling to make my AT91SAM9N12 custom made board work properly. So far, I haven't succeeded with installing at91bootstrap onto my NAND Flash and the said Flash behaves funny. Thisis the circuit I've taken for my board.

When I plug it in to my PC and turn on SAM-BA, it doesn't freak out and that's good thing. It also responds to "Enable NAND Flash" applet as well as "Send boot file". But sometimes, "Receive file", "send file" or "erase all" do not get executed to the end and SAM-BA freezes. Read functions sometimes work only from high addresses like 0x20000 and sometimes not at all. "Erase all" also sometimes work sometimes freezes in the middle of the process. Send file doesn't work at all. Weirdly, "Send boot file" causes no problems even though it consists of erase and write sequences. It's also finished in the blink of an eye even though it takes cca 5 seconds to perform the erase operations. Functions like PMECC configurations or read bad block work always and the latter one reports no bad blocks at all! Here are some code examples:

Init works fine:

Code: Select all

-I- -- NandFlash SAM-BA applet 2.14 --
-I- -- SAM9N12-EK
-I- INIT command
-I- 	Open NAND Flash Interface (ONFI)-compliant
-I- 	Nandflash driver initialized
-I- 	pageSize : 0x800 blockSize : 0x20000 blockNb : 0x1000 spareSize :0x80 numPagesPerBlock :0x40
-I- 	Nandflash PMECC initialized
-I- 	End of applet (command : 0 --- status : 0)
PMECC Configuration working fine:

Code: Select all

-I- PMECC Header configuration command
-I- 	Configure paramHeader to c0082805.
-I- 	Nandflash PMECC nbSectorPerPage is 2
-I- 	Nandflash PMECC spareSize is 128
-I- 	Nandflash PMECC eccBitReq is 4
-I- 	Nandflash PMECC sectorSize is 0
-I- 	Nandflash PMECC eccOffset is 2
-I- 	Nandflash PMECC currentPmeccHeaderValue is c0082805
-I- 	End of applet (command : 15 --- status : 0)
But read command blacks out:

Code: Select all

-I- READ at offset: 0x0 buffer at : 0x200113fc of: 0x1000 Bytes
-I- READ at block 0x0, page 0x0, offset in page 0x0
...and it stays like this forever. Write command is similar to this one.



What could be the reason for this? Would you suggest more like HW issue, like bad solder contact on NAND pins, or more of false Flash configuration?

Regards,

W.
blue_z
Location: USA
Posts: 1560
Joined: Thu Apr 19, 2007 10:15 pm

Re: NAND Flash behaving weirdly

Tue Jan 24, 2017 1:47 am

wesperos wrote:NAND Flash behaving weirdly ... Flash behaves funny.
"Weird" and "funny" are subjective, and convey no technical or diagnostic information.

SAM-BA is IMO a questionable tool to use for diagnostic work.
Once you get past two initialization applets, it is dependent on functional DRAM.
But you haven't validated that memory other than claim that it seems to work for the few tasks that you have performed.

If you build boards, then be prepared for detours to test and troubleshoot them. See discussions/viewtopic.php/f,12/t,21451/ ... tml#p38693

Try writing a memory test program than executes out of SRAM so that the entire DRAM can be tested. (You can presume the SRAM is functional since it's internal to the SoC, and should not be affected by your fabrication skills.
First write its address to each long word.
Then verify each location.
Repeat the two loops, but with the complement of the address.
There are many other, more stressful tests such as code from U-Boot and Memtest86+.

Note that the designer of your board admits that there may be flaw in the board design regarding DRAM.

Regards

Return to “SAM9 ARM9 MPU”

Who is online

Users browsing this forum: Google [Bot] and 3 guests