sam-ba 2.12 patch5 writing NAND fails at high addresses

Microchip in-system programming solution: SAM-BA

Moderators: nferre, fab

karlxo
Posts: 11
Joined: Mon Sep 16, 2013 11:10 am

sam-ba 2.12 patch5 writing NAND fails at high addresses

Tue Apr 15, 2014 5:55 pm

Hi All, 

I'm having issues writing to my NAND  at higher address 0x1200000  and 0x1600000 in sam-ba.   If i write to any address below this all works fine.   I can write to these addresses in uboot and it works.     I would like this to work in sam-ba though to automate the programming better.  Writhing the rootfs, kernel, uboot, bootstrap, works fine at address lower than 0x1200000. 

The NAND part is Spansion S34MS01G1
My board is based on at91sama5d3x-ek
I did not make any changes to the default samba NAND applet code. 


If i start writing rootfs at 0x1200000 it fails at 0x1200000
If i start writing rootfs at 0x1000000 it fails at 0x1200000
If i start writing rootfs at 0x800000 it fails at 0x1200000
If i start writing rootfs at 0x700000 it fails at 0x1200000
If i start writing rootfs at 0x600000 it writes correctly.  (image ends at 0x1140000)
If i start writing rootfs at 0x400000 it writes correctly.  (image ends at 0xF40000)
If i start writing rootfs at 0x200000 it writes correctly.  (image ends at 0xD40000)
If i start writing rootfs at 0x100000 it writes correctly.

When it writes to  0x11E0000 the block gets written OK


I enabled the debug traces in:
applets/sama5d3x/sam-ba_applets/nandflash/main.c

The  TRACE_INFO("SEND FILE command\n\r");  trace does not get printed when writing to 0x1200000   but it does get printed at every other lower address.   So it seems the applet is not even starting when writing to 0x1200000

Ohter interesting debug info:

Code: Select all

-I-     Nandflash driver initialized
-I-     pageSize : 0x800 blockSize : 0x20000 blockNb : 0x400 spareSize :0x40 numPagesPerBlock :0x40
-I-     Nandflash PMECC initialized
-I-     End of applet (command : 0 --- status : 0)
-I- command 21 commType=7
-I- PMECC Header configuration command
-I-     Configure paramHeader to c0902405.
-I-     Nandflash PMECC nbSectorPerPage is 2
-I-     Nandflash PMECC spareSize is 64
-I-     Nandflash PMECC eccBitReq is 4
-I-     Nandflash PMECC sectorSize is 0
-I-     Nandflash PMECC eccOffset is 36
-I-     Nandflash PMECC currentPmeccHeaderValue is c0902405
-I-     End of applet (command : 15 --- status : 0)
I added some debug in:
applets/sama5d3x/libraries/libnandflash/source/NandFlashOnfi.c

Code: Select all

-I- ONFI manufacturerId 0x1 
-I- ONFI onfiPageSize 0x800 
-I- ONFI onfiSpareSize 0x40 
-I- ONFI onfiPagesPerBlock 0x40 
-I- ONFI onfiBlocksPerLun 0x400 
-I- ONFI onfiLogicalUnits 0x1 
-I- ONFI onfiEccCorrectability 0x1 
-I- ONFI onfiDeviceModel 0x30 

When it gets hung at 0x01200000  I hooked up the j-link debugger and did:

Code: Select all

J-Link>mem32 0x20000000 16 hex
20000000 = 20000000 00000002 00000000 20016A88 
20000010 = 00020000 01200000 C0080405 00000000 
20000020 = 00000000 00000000 00000000 00000000 
20000030 = 00000000 00000000 00000000 00000000 
20000040 = 00000000 00000000 00000000 00000000 
20000050 = 00000000 00000000 
In the TCL scripts its hung in GENERIC::Run

Any tips or ideas on debugging this would be appreciated. 

Thanks
redfred
Posts: 1
Joined: Sat Feb 07, 2015 6:40 pm

Re: sam-ba 2.12 patch5 writing NAND fails at high addresses

Wed Feb 11, 2015 11:35 am

Hi Karl,

We have the same problem with exactly the same Spansion NAND.
Did you find any solution since your post?
Thank you,
Gabor

Return to “SAM-BA”

Who is online

Users browsing this forum: No registered users and 2 guests