AnsweredAssumed Answered

imx6ULL Custom Board booting from NAND flash

Question asked by Ian Caddy on Jan 4, 2019
Latest reply on Jun 11, 2019 by Ian Caddy

Hi All,

We hve a custom board based on the imx6ULL processor.  We are using u-boot and *not* a linux kernel, but an RTEMS kernel.  We have been using the JTAG interface to download and test the code.  Now we want to put u-boot into the NAND flash to boot.

I have tried various methods and in the end have settled for adding a imx-kobs command to u-boot to allows us to program the NAND flash directly from u-boot as we do not have a linux kernel setup for our custom board.

This was slightly complicated by the fact that the u-boot that I am using does not support writing to raw NAND, but only through the ECC, so I had to create a raw command to write the FCB page.  The other pages I have placed through the normal MTD interface.

This seems to work OK, but on reboot, nothing happens and u-boot does not start.  I have looked at a bunch of issues getting NAND flash to boot for custom boards here, sometimes even using the linux tool, but that is not an option for us.

Here is an output of the nand info command on the board:

nand info


Device 0: nand0, sector size 128 KiB
  Page size       2048 b
  OOB size          64 b
  Erase size    131072 b
  subpagesize     2048 b
  options     0x40004200
  bbt options 0x00068000


Here is the output from our kobs (equiv) command:

Saving the store u-boot image @ 0x82000000, size = 0x00088000 to NAND Flash


Updating Boot control blocks
Progammed FCB Header:
  u32Checksum = 0xfffffbf9
  u32FingerPrint = 0x20424346
  u32Version = 0x01000000
  NANDTiming.u8DataSetup = 80
  NANDTiming.u8DataHold = 60
  NANDTiming.u8AddressSetup = 25
  NANDTiming.u8NandTimingState = 0
  NANDTiming.u8REA = 0
  NANDTiming.u8RLOH = 0
  NANDTiming.u8RHOH = 0
  u32DataPageSize = 2048
  u32TotalPageSize = 2112
  u32SectorsPerBlock = 64
  u32NumberOfNANDs = 0
  u32TotalInternalDie = 0
  u32CellType = 0
  u32EccBlockNEccType = 4
  u32EccBlock0Size = 512
  u32EccBlockNSize = 512
  u32EccBlock0EccType = 4
  u32MetadataBytes = 10
  u32NumEccBlocksPerPage = 3
  u32EccBlockNEccLevelSDK = 0
  u32EccBlock0SizeSDK = 0
  u32EccBlockNSizeSDK = 0
  u32EccBlock0EccLevelSDK = 0
  u32NumEccBlocksPerPageSDK = 0
  u32MetadataBytesSDK = 0
  u32EraseThreshold = 0
  u32BootPatch = 0
  u32PatchSectors = 0
  u32Firmware1_startingSector = 512
  u32Firmware2_startingSector = 960
  u32SectorsInFirmware1 = 272
  u32SectorsInFirmware2 = 272
  u32DBBTSearchAreaStartAddress = 256
  u32BadBlockMarkerByte = 1999
  u32BadBlockMarkerStartBit = 0
  u32BBMarkerPhysicalOffset = 2048
  u32BCHType = 0


Progammed DBBT Header:
  u32Checksum = 0x00000000
  u32FingerPrint = 0x54424244
  u32Version = 0x01000000
  u32Res = 0x00000000
  u32DBBTNumOfPages = 0x00000000
Writing u-boot image from block 8 to 14
Writing u-boot image from block 15 to 21


U-Boot write completed successfully.


I have checked all the pages and the correct data appears to be in place.  I have checked the FCB (page 0) and used the correct ECC version from the kobs command for the imx6ULL and it appears to get through the FCB portion as the NAND CE is different to when I have a blank flash (or an incorrectly formatted FCB page).


There does not appear to be any useful information on how to debug this other than I found these questions:


NAND BOOT fail on iMX6UL 

i.MX6Q NAND boot issues 

The second one was referenced from one I have misplaced for the moment.  So, I put the JTAG back on after a reset and on the imx6ULL the reference manual states the BOOT ROM Log Buffer Pointer is located  @ 0x01E0, so I got that location and printed out the 256 bytes that it points to, and here is the information, but I have no information on how to decode it.  Any suggestions?


(gdb) x /x 0x1e0
0x1e0:  0x00901d14
(gdb) x /64x 0x901d14
0x901d14:       0x000e0000      0x00010002      0x000200f0      0x00030000
0x901d24:       0x00040000      0x00050001      0x00060000      0x00070000
0x901d34:       0x000700f0      0x00080000      0x000003c0      0x000800f0
0x901d44:       0x00090000      0x000a2233      0x00061fff      0x00062001
0x901d54:       0x00070000      0x00070033      0x000c0000      0x00000000
0x901d64:       0x00000000      0x00000000      0x00000000      0x00000000
0x901d74:       0x00000000      0x00000000      0x00000000      0x00000000
0x901d84:       0x00000000      0x00000000      0x00000000      0x00000000
0x901d94:       0x00000000      0x00000000      0x00000000      0x00000000
0x901da4:       0x00000000      0x00000000      0x00000000      0x00000000
0x901db4:       0x00000000      0x00000000      0x00000000      0x00000000
0x901dc4:       0x00000000      0x00000000      0x00000000      0x00000000
0x901dd4:       0x00000000      0x00000000      0x00000000      0x00000000
0x901de4:       0x00000000      0x00000000      0x00000000      0x00000000
0x901df4:       0x00000000      0x00000000      0x00000000      0x00000000
0x901e04:       0x00000000      0x00000000      0x00000000      0x00000000



Ian Caddy


P.S Does anyone know why there is no Category for the imx6ULL (the closest I can find is the imx6UL)?