How to save binary from NAND?

Moderator: nferre

jade74.lee
Posts: 1
Joined: Mon Nov 25, 2013 11:49 am

How to save binary from NAND?

Tue Nov 26, 2013 6:35 am

I want to backup NAND.
I connected SAM-BA to at91sama5d3x.
I can't save binary from nand.

Let's me know how to this
Thanks.


=================== SAM-BA LOG ===================
oading history file ... 18 events added
SAM-BA CDC console display active (Tcl8.5.9 / Tk8.5.9)
(board) 19 %
(board) 19 % NANDFLASH::Init
-I- NANDFLASH::Init (trace level : 4)
-I- Loading applet applet-nandflash-sama5d3x.bin at address 0x20000000
-I- Memory Size : 0x10000000 bytes
-I- Buffer address : 0x20010E30
-I- Buffer size: 0x20000 bytes
-I- Applet initialization done
(board) 19 % NANDFLASH::NandHeaderValue HEADER 0xc0902405
Ecc type is 2 Ecc Status is 2
-I- Configure trimffs 0
-I- PMECC c0902405 to be Configured
-I- Pmecc header configration successful
-I- PMECC configure c0902405
(board) 19 % receive_file {NandFlash} "/home/DISK1/linux/atmel/binary/board/test.bin" 0x0 0x40000 0
-I- Read File /home/DISK1/linux/atmel/binary/board/test.bin at address 0x0
GENERIC::ReceiveFile /home/DISK1/linux/atmel/binary/board/test.bin : 0x40000 bytes from address 0x0
-I- Reading: 0x20000 bytes at 0x0 (buffer addr : 0x20010E30)
-E- Can't receive data (0x0000000f)
(board) 19 % receive_file {NandFlash} "/home/DISK1/linux/atmel/binary/board/test.bin" 0x40000 0x40000 0
-I- Read File /home/DISK1/linux/atmel/binary/board/test.bin at address 0x40000
GENERIC::ReceiveFile /home/DISK1/linux/atmel/binary/board/test.bin : 0x40000 bytes from address 0x40000
-I- Reading: 0x20000 bytes at 0x40000 (buffer addr : 0x20010E30)
-E- Can't receive data (0x0000000f)
(board) 19 % NANDFLASH::BadBlockList
-I- No Bad Block found
(board) 19 % receive_file {NandFlash} "/home/DISK1/linux/atmel/binary/board/test.bin" 0x40000 0x40000 0
-I- Read File /home/DISK1/linux/atmel/binary/board/test.bin at address 0x40000
GENERIC::ReceiveFile /home/DISK1/linux/atmel/binary/board/test.bin : 0x40000 bytes from address 0x40000
-I- Reading: 0x20000 bytes at 0x40000 (buffer addr : 0x20010E30)
-E- Can't receive data (0x0000000f)
(board) 19 % receive_file {NandFlash} "/home/DISK1/linux/atmel/binary/board/test.bin" 0x40000 0x40000 0
-I- Read File /home/DISK1/linux/atmel/binary/board/test.bin at address 0x40000
GENERIC::ReceiveFile /home/DISK1/linux/atmel/binary/board/test.bin : 0x40000 bytes from address 0x40000
-I- Reading: 0x20000 bytes at 0x40000 (buffer addr : 0x20010E30)
-E- Can't receive data (0x0000000f)
(board) 19 % receive_file {NandFlash} "/home/DISK1/linux/atmel/binary/board/test.bin" 0x40000 0x40000 0
-I- Read File /home/DISK1/linux/atmel/binary/board/test.bin at address 0x40000
GENERIC::ReceiveFile /home/DISK1/linux/atmel/binary/board/test.bin : 0x40000 bytes from address 0x40000
-I- Reading: 0x20000 bytes at 0x40000 (buffer addr : 0x20010E30)
-E- Can't receive data (0x0000000f)
(board) 19 % NANDFLASH::Init
-I- NANDFLASH::Init (trace level : 4)
-I- Loading applet applet-nandflash-sama5d3x.bin at address 0x20000000
-I- Memory Size : 0x10000000 bytes
-I- Buffer address : 0x20010E30
-I- Buffer size: 0x20000 bytes
-I- Applet initialization done
(board) 19 % NANDFLASH::NandHeaderValue HEADER 0xc0902405
Ecc type is 2 Ecc Status is 2
-I- Configure trimffs 0
-I- PMECC c0902405 to be Configured
-I- Pmecc header configration successful
-I- PMECC configure c0902405
(board) 19 % receive_file {NandFlash} "/home/DISK1/linux/atmel/binary/board/test.bin" 0x40000 0x40000 0
-I- Read File /home/DISK1/linux/atmel/binary/board/test.bin at address 0x40000
GENERIC::ReceiveFile /home/DISK1/linux/atmel/binary/board/test.bin : 0x40000 bytes from address 0x40000
-I- Reading: 0x20000 bytes at 0x40000 (buffer addr : 0x20010E30)
-E- Can't receive data (0x0000000f)
(board) 19 %
AntoineC
Posts: 105
Joined: Wed Oct 03, 2012 11:33 am

Re: How to save binary from NAND?

Tue Nov 26, 2013 2:56 pm

I am working on a SAM9G25

I have the same error: -E- Can't receive data (0x0000000f)

But only when I try to read from 0xE0000 and more. I have no problems dumping the Nand for add 0x0 --> 0xD FFFF

I do not know what I the problem after this adress. If you find any solution, please share with us. Thx
blue_z
Location: USA
Posts: 1763
Joined: Thu Apr 19, 2007 10:15 pm

Re: How to save binary from NAND?

Wed Nov 27, 2013 6:02 am

jade74.lee wrote:Let's me know how to this
Works for me provided that "Enable DDRAM" is executed prior to accessing NAND Flash.

Regards
AntoineC
Posts: 105
Joined: Wed Oct 03, 2012 11:33 am

Re: How to save binary from NAND?

Wed Nov 27, 2013 11:05 am

On my board, it do not change anything to enable the DDRRAM! I still have the same error. Do you think there is a difference between at91sam9g25 and at91sama5d3x on the methode to dump memory?

What is strange is that I have no problem dumping on adress 0 to 0xE0000
CptTitanic
Posts: 871
Joined: Sat Oct 30, 2010 6:04 pm

Re: How to save binary from NAND?

Wed Nov 27, 2013 12:10 pm

AntoineC wrote:Do you think there is a difference between at91sam9g25 and at91sama5d3x on the method to dump memory?
The applets come with source code, one could presumably analyze those, recompile and add debugging as required.

One might look where the data is getting buffered, and how the geometry of the NAND is identified and handled.
blue_z
Location: USA
Posts: 1763
Joined: Thu Apr 19, 2007 10:15 pm

Re: How to save binary from NAND?

Wed Nov 27, 2013 12:45 pm

AntoineC wrote:On my board, it do not change anything to enable the DDRRAM! I still have the same error.
My bad.
It's enabling DataFlash that seems to allow NAND transfers. The receive buffer is then set to an SRAM address, 0x30AC6C.
It seems to read across/past the 0xE0000 boundary.
AntoineC wrote:Do you think there is a difference between at91sam9g25 and at91sama5d3x on the methode to dump memory?
Sorry, I didn't mean that I was using a SAM5D3x. I'm actually using a SAM9M10G45-EK.
And SAM-BA CDC 2.12 on Linux.



Regards
Attachments
Screenshot- SAM-BA CDC 2.12  - at91sam9m10-g45-ek.png
Screenshot- SAM-BA CDC 2.12 - at91sam9m10-g45-ek.png (81.98 KiB) Viewed 2383 times
Last edited by blue_z on Wed Nov 27, 2013 9:46 pm, edited 2 times in total.
AntoineC
Posts: 105
Joined: Wed Oct 03, 2012 11:33 am

Re: How to save binary from NAND?

Wed Nov 27, 2013 1:00 pm

I do enable the Nand Flash before trying to dump it.

There is no error when dumping from 0x0 to 0xE 0000
I flashed (on another board) what I dump and the bootstrap and barebox works fine.

It seems that I could not dump from adress > 0xE 0000 which are device tree and kernel (seen from barebox output)

Do you know if there is a way to flash something with a protection that do not allow to dump memory?

Anyway thanks for your help
CptTitanic
Posts: 871
Joined: Sat Oct 30, 2010 6:04 pm

Re: How to save binary from NAND?

Wed Nov 27, 2013 5:49 pm

AntoineC wrote:I do enable the Nand Flash before trying to dump it.
He mentioned Data Flash, not NAND, but obviously you'd need to enable the NAND interface/code for it to work at all.
Do you know if there is a way to flash something with a protection that do not allow to dump memory?
The problem is likely more mundane, for instance a buffering or geometry issue. Consider also if the ECC scheme chosen is coherent, or if the meta data is different. For example can you write to some other scratch part of the NAND with SAM-BA and read it back?

There are bare-metal methods of accessing and testing the NAND, should be some stuff in at91lib, and the source tree for the applets.

Try also under Windows lest that makes a difference.
blue_z
Location: USA
Posts: 1763
Joined: Thu Apr 19, 2007 10:15 pm

Re: How to save binary from NAND?

Wed Nov 27, 2013 10:36 pm

[Egg on face]
Sorry, but I take back my comments about this SAM-BA reading NAND.
Looking at the retrieved data "from NAND", it turns out to actually be from DataFlash, which was the last chip enabled, even though the NAND tab is selected. Reading the messages, there is no indication from which chip the data are being read. SAM-BA only indicates that it is using the filename from the NAND tab as the destination, not that it is reading data from NAND.

After NAND is enabled, all reads from NAND fail as the OP described.

So SAM-BA seems to be broken.
Maybe that's why I dislike GUIs and haven't used it in 5 years.

My apologies for the misdirection.

Regards

PS Have you tried applying Patch 5, and rebuilding SAM-BA? http://www.atmel.com/tools/ATMELSAM-BAI ... AMMER.aspx
AntoineC
Posts: 105
Joined: Wed Oct 03, 2012 11:33 am

Re: How to save binary from NAND?

Thu Nov 28, 2013 11:03 am

Consider also if the ECC scheme chosen is coherent
I am able to dump memory from address 0 to 0xE 0000. So the ECC sheme should be correct. ECC can not change in one NAND, do it?
For example can you write to some other scratch part of the NAND with SAM-BA and read it back?
The problem is that I do not want to erase any data on the board before dumping it. It is the only copy of the application I got for now (have it from another company witch will send us more, but not now)
Try also under Windows lest that makes a difference.
I do work under Windows. There is no USB on the board, so I have to work with the SAM-ICE and SAM-BA that are working together only on Windows
Reading the messages, there is no indication from which chip the data are being read
Same for me ^^ Activation of DDRAM and then reading in NAND flash tab make read from DDRAM... Stupide SAM-BA! ;-)
So SAM-BA seems to be broken.
For me, it is only "broken" for address > 0xE 0000! Strange!
PS Have you tried applying Patch 5, and rebuilding SAM-BA?
Yes. It do not change anything.


I tryied to contact Atmel Support. They again explain me how to Enable, configure ECC and than dump the memory. They miss the part that I am able to dump from 0 to E0000... I wrote back to explain AGAIN the problem. Waiting for response now.


Anyway, thanks guys for the support. I you have any other ideas, I would be glad to try them.

Antoine

Return to “SAM9-based”

Who is online

Users browsing this forum: No registered users and 1 guest