Notifications
Clear all

NAND flash disk ECC

42 Posts
6 Users
0 Likes
2,552 Views
(@rs8191)
Posts: 7
Active Member
 

hello everybody
nice that my post was matter of public concern.
if desired then please give me a few days and i write a detailed description of my work.
kind regards

 
Posted : 15/05/2013 11:51 pm
jaclaz
(@jaclaz)
Posts: 5133
Illustrious Member
 

hello everybody
nice that my post was matter of public concern.

I would say "interest" rather than "concern" D .

if desired then please give me a few days and i write a detailed description of my work.
kind regards

Sure, noone is in a hurry…

jaclaz

 
Posted : 16/05/2013 10:09 pm
(@rs8191)
Posts: 7
Active Member
 

From the beginning
Chapter 1 Dump of the Flash
after examination of the Hexdumps (4x2GB) I had the impression that the data would be gauges much encoded on the stick.
I searched for features such as boot block (0x55AA) or jpg Header. Unfortunately was nothing to be found of that.
Through chance, I assessed that Dump 0 and 2, Dump 1 and 3 must
joined byteswise (8 bits -> 16 bits).
After this action, I was able to recognize the Strucktur.
16x (512 dates bytes / 24 ECC bytes) and 64 bytes of Management Data.
To the better handling, I separated the Dumps again in data and spare file.
For each 8k dates, I wrote would save 512 Bytes spare.
This enabled me also the concurrence of data pages to spare file.
for example
0X800 in spare file corresponds data start address 0X8000.
For the pure ECC and mgmt data, only 448 bytes would be needed. I filled up the remainder with self own control data like NAND Nr. ; NAND Block Nr. ; NAND Page Nr; and other variables.

+—————-……………………………………..—————+
|4GB-NAND……………………|…………………4GB-NAND|
+—————-……………………………………..—————+
/……………………….\…………………………………../……………….\
2GB RawDump0 2GB RawDump1…………2GB RawDump2 2GB RawDump3
(00 02 04…)………………………………………….(01 03 05…)

Merge Byte wise
RawDump0_firstGB and RawDump2_firstGB; = 2GB Dump0 (00 01 02 03 04 05 ….)
RawDump0_secGB and RawDump2_secGB; = 2GB Dump1
RawDump1_firstGB and RawDump3_firstGB; = 2GB Dump2
RawDump1_secGB and RawDump3_secGB; = 2GB Dump3

Structure of this 2GB Dumps are now
+———————+——————–+
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 512 Data Byte | 24 ECC Byte |
| 64 Mgmt Byte | ={Sum 8640 Byte}

by sidein the web are the standard NAND described with as follow 512B Data area and 16Byte ECC area.
in my case the NANDs have 256Byte Data area and 14 Byte Spare area (16x256 + 16x14) x2 = 8640Byte

now we can separate our Dumps (0-3) in Data and Spare file
| 512 Data Byte | 512 Data Byte |……. -> Dump0'
| 24 ECC Byte | 24 ECC Byte | ……..| 64 Mgmt Byte | control var| ->Spare0

example of one 512Byte Spare0 file
Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00055A00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00…………….1
00055A10 00 00 00 00 00 00 00 00|81 DE 2A A2 11 44 B0 E3…………….1
00055A20 00 48 22 43 3C CC 88 A6 02 E6 9C 9A 13 27 68 00|
00055A30 D7 36 19 E4 5D 28 5D 8B 92 D7 0F 59 12 4E 13 87…………….1
00055A40 98 08 D2 7B F5 2C 74 00|21 E7 50 69 31 73 65 E4…………….1
00055A50 4A BF 30 AC D2 1D EC F9 DB 92 B0 BC 1A 67 84 00|
00055A60 DB 7F 6C 5D D8 62 BF 63 34 4F 0C F8 FE CE 36 8E…………….1
00055A7054 FE 5F 83 B6 15 FC 00| D0 41 73 FD D3 09 A5 96…………….1
00055A80 0B 00 D9 B6 0D E9 3B AB 8B A4 75 10 94 C4 14 00|
00055A90 C5 44 BD 28 FF 88 17 B1 67 DD C1 88 F5 DD 0D 58…………….1
00055AA0 65 9F BB 46 E2 6F 4C 00|DD 65 40 4A 59 4D 29 55 …………….1
00055AB0 94 4A 71 1E 78 F8 4E BF 4A 8C B8 BE EF 9B 00 00|
00055AC0 59 C0 ED 58 86 92 FB F7 8B 6F CB 3D D3 B2 A9 B9…………….1*
00055AD012 84 54 D9 D2 46 90 00| 59 C0 ED 58 86 92 FB F7…………….1*
00055AE0 8B 6F CB 3D D3 B2 A9 B9 12 84 54 D9 D2 46 90 00|
00055AF0 59 C0 ED 58 86 92 FB F7 8B 6F CB 3D D3 B2 A9 B9…………….1*
00055B00 12 84 54 D9 D2 46 90 00| 59 C0 ED 58 86 92 FB F7…………….1*
00055B10 8B 6F CB 3D D3 B2 A9 B9 12 84 54 D9 D2 46 90 00|
00055B20 59 C0 ED 58 86 92 FB F7 8B 6F CB 3D D3 B2 A9 B9…………….1*
00055B30 12 84 54 D9 D2 46 90 00|59 C0 ED 58 86 92 FB F7…………….1*
00055B40 8B 6F CB 3D D3 B2 A9 B9 12 84 54 D9 D2 46 90 00|
00055B50 59 C0 ED 58 86 92 FB F7 8B 6F CB 3D D3 B2 A9 B9…………….1*
00055B60 12 84 54 D9 D2 46 90 00| 59 C0 ED 58 86 92 FB F7…………….1*
00055B70 8B 6F CB 3D D3 B2 A9 B9 12 84 54 D9 D2 46 90 00|
00055B80 4D 1B 4D 1B FF FF 12 00| FF FF FF FF FF FF FF FF…………….2
00055B90 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF…………….3
00055BA0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
00055BB0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF|
00055BC000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00…………….4
00055BD000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00055BE0 00 01 00 00 02 02 00 00 AD AD 00 00 00 00 00 00
00055BF0 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF

1…..24 Byte ECC(182 Bit used) of 512 Byte Data Sector
1*…..(ECC of Data field with all 0xFF)
2…..64 Byte Mgmt Block for 16x512 Byte Data Block(8k)
first 2x2 Bytes are redundant writen(4D 1B)
first Byte of them describe the Partition 4=first user Partition(Filespace of 2GB);1-3=perhaps user Partition 2-4???;6=Filespace for the controller self,used for FTL table and so what.
next 3 Byte describe the Mega Byte Nr. in the 2GB Block of NAND filespace.There was in every 2GB Dump the same MegaByte Nr. –> The CPU handle max 2GB Filespace(16 Bit adressing) 4x2GB pices->8GB
3…..56 unused Bytes, are 0xFF
4…..I fieled up to 512B the rest of Spare file with self used control Data
00 01=NAND Nr.; 02=NAND Block Nr.; AD=NAND Page Nr.; FF FF FF FF=Page end Mark

To bring around a part Filesystem (the first 2GB) into correct sequence I must rerange all the data again.
In my case, the 8k pages of the same mega byte number and the follow up mega byte number 8k Pages must be joined to 16k.
for example

8k read from 0001(MBNr.) Page 00 and 8k read from 0002(MBNr.) Page 00 -> write 16k;
8k read from 0001(MBNr.) Page 01 and 8k read from 0002(MBNr.) Page 01 -> write next 16k
etc
8k read from 0001(MBNr.) Page 7F and 8k read from 0002(MBNr.) Page 7F -> write last 16k

This step were necessary for respectively the first to the fourth 2GB file.
it was important that the MBNR. with the position in the new File agrees.
With the tool dd, the new 2GB files could be written now successive on a hard disk.
The Filesystem was to be recognized with all its structures and picture preview. But there where 1000' of bitflips.

Continuation follows ECC description

 
Posted : 18/05/2013 5:35 pm
(@rs8191)
Posts: 7
Active Member
 

Hello admin
How can I insert a GIF Picture in my last post (IMAGE)
Kind regards rs8191

 
Posted : 18/05/2013 5:40 pm
Jamie
(@jamie)
Posts: 1288
Moderator
 

Hello admin
How can I insert a GIF Picture in my last post (IMAGE)
Kind regards rs8191

You need to link to it elsewhere using the image button (bottom left of the 2 rows under "Message body" when submitting/editing a post)

 
Posted : 18/05/2013 7:25 pm
jaclaz
(@jaclaz)
Posts: 5133
Illustrious Member
 

Through chance, I assessed that Dump 0 and 2, Dump 1 and 3 must
joined byteswise (8 bits -> 16 bits).
After this action, I was able to recognize the Strucktur.

And here you already lost me.

What do you mean "join byteswise (8 bits->16 bit)"?

If I get it right you dumped four "banks" of memory, each 2 Gb, numbering them as dump 0, dump 1, dump 2 and dump 3.

Then you "joined byteswise (8 bits->16 bit)" dump 0 and dump 2 (and then dump 1 and dump 3).
Do you mean that the result is
Byte 0 dump0
Byte 0 dump2
Byte 1 dump0
Byte 1 dump2
etc.

jaclaz

 
Posted : 18/05/2013 8:32 pm
(@rs8191)
Posts: 7
Active Member
 

Yes, that is correct, there two NAND Flash with the same controlline(Chipselect;WR;RE;D0-D7 CHIP0; D8-D15 chip1).
Therefore that is read and write twice as quickly if the CPU must address the storage media only with a step and puts for that a 16 bit word on the data bus.
On this insight, I came also first later. lol

Inserting a image Must I place the picture on one other web server and then link in the post to it?
is there no other way, to upload it to your server? ?

kind regards.

 
Posted : 18/05/2013 9:30 pm
Jamie
(@jamie)
Posts: 1288
Moderator
 

Must I place the picture on one other web server and then link in the post to it?

That's correct.

 
Posted : 19/05/2013 2:11 am
jaclaz
(@jaclaz)
Posts: 5133
Illustrious Member
 

Yes, that is correct, there two NAND Flash with the same controlline(Chipselect;WR;RE;D0-D7 CHIP0; D8-D15 chip1).
Therefore that is read and write twice as quickly if the CPU must address the storage media only with a step and puts for that a 16 bit word on the data bus.

Well, I am probably far thicker than you would like, but earlier you talked of 4 "items" (that I imagined being "banks", i.e. chips) 2 GB each, now you are talking of 2 of them (that you explicitly call "chips").

How many "chips" are there on that stick?
How big in size are each?
Which is the total capacity of the stick?
Describe a "chip".

jaclaz

 
Posted : 20/05/2013 12:17 am
(@rs8191)
Posts: 7
Active Member
 

So there are 2 chips per 4 GB (totally 8GB of capacity)
The subdivision per 2x2GB is due to the fact that it is not easy in standard C programming editing files greater then 2 GB.
It is possible absolutely, however, in it I am not fit enough. oops
kind regard
rs8191

 
Posted : 21/05/2013 5:45 pm
Page 3 / 5
Share: