Correct PMECC header value for Micron MT29F2G08ABAGAWP-ITE:G

Microchip in-system programming solution: SAM-BA

Moderators: nferre, fab

wmoors
Posts: 4
Joined: Mon Sep 27, 2010 4:38 pm

Correct PMECC header value for Micron MT29F2G08ABAGAWP-ITE:G

Tue Aug 11, 2020 10:44 pm

Hey all,

We're having trouble configuring the right PMECC header value for our NAND flash component and I found your name in the AT91 Wiki page on PMECC configuration for SAM-BA/AT91bootstrap so I hope U guys can help me.

Our board design is based on the KSZ9477 board (EVB-KSZ9477) which in turn seems to be based on the sama5d3 Xplained board. We had to change the NAND flash though, as the availability of the used component is limited.

For the new NAND flash we stuck to the same Micron NAND flash family but chose a component that has the internal PMECC enabled by default. (could be changed if really needed)

But since both sam-ba as at91 seem to disable the internal PMECC that should not be a problem.

I followed the guide on the Wiki page with the following parameters:

Code: Select all

(1) usePmecc              1
(2) nbSectorPerPage 2           (4 sectors/page)
(3) spareSize         0x80          (128 according to the datasheet)
(4) eccBitReq               2           (8 bit error correcting)
(5) sectorSize              0           (512 sector size)
(6) eccOffset       0x04C          (128 - (4 sectors * 13 bytes) = 76)
(7) reserved
(8) key                      0xC

c             1            3             0            4             8             0            5
1 1 0 0   0 0 0 1   0 0 1 1   0 0 0 0   0 1 0 0   1 0 0 0   0 0 0 0   0 1 0 1
So a PMECC header value of 0xC1304805 seems to be the correct value.
However, if I use this value in sam-ba, and perform the sendbootfile command, the board falls back into ROMBoot after a power cycle.
So I take it the configured PMECC value is incorrect, and ROMBoot get read errors. (too bad there is no feedback/output on that)

I also tried to ignore the PMECC, and only use the internal On-DIE PMECC, and in that case I get a booting at91bootstrap(also configured for on-die PMECC), can also boot into uboot, but uboot refuses to read anything else because of too many PMECC read errors. (even though it is supposed to use the ONFI detection for PMECC configuration)

(Does anyone know if I can dump the OOB through sam-ba by any chance?)

So I hope you can help me out and point out my error or at least set me off in the right direction to solve this issue.

Best regards and thanks in advance
blue_z
Location: USA
Posts: 2151
Joined: Thu Apr 19, 2007 10:15 pm

Re: Correct PMECC header value for Micron MT29F2G08ABAGAWP-ITE:G

Wed Aug 12, 2020 1:20 am

wmoors wrote: ... in that case I get a booting at91bootstrap(also configured for on-die PMECC), can also boot into uboot ...
Getting U-Boot to read and erase/write your NAND (using the ECC configuration you plan to use) is IMO the top priority.
U-Boot is a more versatile and capable tool than (whatever version that you're using of) SAM-BA. You will be able to erase & write any page, and then read (normal) and/or read raw (with OOB data) to verify ECC offset and length.
Then use U-Boot to install the NAND parameter header with AT91Bootstrap; see this topic.

wmoors wrote: ...but uboot refuses to read anything else because of too many PMECC read errors. (even though it is supposed to use the ONFI detection for PMECC configuration)
Do not try to mix ECC configurations unless you have verified that those ECC configurations are truly compatible.
IOW if you wrote to NAND using your explicit parameters, then do not try to read using the ONFI parameters.

If you have correctly modified U-Boot to use ONFI parameters, then you could try using U-Boot to install AT91Bootstrap without the NAND parameter header, and thus force the RomBOOT program to also use ONFI parameters.

BTW you seem to conflate ECC and PMECC, e.g. "internal PMECC" should probably be "internal ECC"?
"PMECC" is an acronym coined by and only used by Microchip/Atmel.

Regards

Return to “SAM-BA”

Who is online

Users browsing this forum: No registered users and 1 guest