AnsweredAssumed Answered

MPC-5125 NAND Flash Boot

Question asked by Tim Hutchinson on Apr 17, 2014
Latest reply on May 6, 2014 by Tim Hutchinson

Hi All,


     I’m having a difficult time getting a new board that uses the MPC-5125 to run the bootloader (I’m using the bootloader that Freescale uses for the Tower module system). This board was designed by referencing the Freescale Tower module demo board and works properly under control of the CodeWarrior Debugger. The DDR memory, Ethernet system, LocalPlus Bus, SD card interface, etc, all work properly using the same Freescale BSP code as the TWR-MPC-5125 (as it was designed to). In fact the software for this project was originally developed using the Tower Module hardware (great idea by the way Freescale).

 

     I have confirmed that the processor can properly read and write the NAND flash by storing images on it with the bootloader (running under debug control) and that the power on reset configuration (as set by the various bus pull ups and pull downs) is specifying a boot from the NAND flash device at 0xFFF0_0000 (8 bit mode), same as the Tower System.

 

     I have a logic analyzer on the NFC interface and I am observing that the bootloader appears to be written to the NAND flash device when the CodeWarrior “Ext NAND Download Release” target is run. I also observe that upon a reset, the processor reads the boot header and bootstrap code from NAND Flash Block[0] then reads the image header and boot loader code from NAND Flash block[1], but the bootloader doesn’t run.

 

      I had to spec a different Micron NAND Flash part (the one Freescale uses on the Tower module is obsolete) but the new part is still a 32Gb X 8 bit part that Micron recommended as a replacement for the original. I’ve tried booting with the original MQX NAND Flash defines statements, and I’ve tried changing them for the different page size, block size, etc values of the new part. Neither works. I have noticed that the MQX defines for the existing NAND Flash part were incorrect (yet they worked on the Tower module).


     Has anyone been through this process before and can you tell me what changes you had to make to boot to a different NAND Flash part? Here are the Flash parts and the #defines that were used. Note that I tried the original MQX defines with the new flash parts as well as changing the #defines in the two files below to more accurately define the flash chip. Neither way seems to work. Are there other MQX files that I need to modify beyond the two I show below? Thanks for any suggestions.


Best,

Tim



-----[ Original Tower Module NAND Flash device and MQX #defines ]----------

NAND Part         : Micron MT29F32G08CBABA

Page Size x8      : 4320 bytes (4096 + 224 bytes)

Block Size        : 256 pages (1024K + 56K bytes)

Plane Size        : 2 planes x 2048 blocks per plane

Device Size       : 32Gb – 4096 blocks


C:\Program Files (x86)\Freescale\Freescale MQX 3.8.1.1\mqx\source\bsp\twrmpc5125\twrmpc5125.h

#define BSP_FLASH_BASE                  ((pointer)0x0) /* block #0 */
#define BSP_FLASH_SIZE                  (0x400000)
#define BSP_FLASH_WIDTH                      (8)
#define BSP_FLASH_DEVICES               (1)
#define BSP_VIRTUAL_PAGE_SIZE           (2048)
#define BSP_ECC_SIZE                    (32) /* 32-error correction bits (60 ECC bytes) */

#define BSP_NAND_BLOCK_SIZE             (512 * 1024)  /* 512 KB */
#define BSP_NAND_NUM_BLOCKS             (2048)



C:\Program Files (x86)\Freescale\Freescale MQX 3.8.1.1\mqx\source\bsp\twrmpc5125\bsp_prv.h

#define NANDFLASH_PHYSICAL_PAGE_SIZE      2048
#define NANDFLASH_SPARE_AREA_SIZE         60
#define NANDFLASH_BLOCK_SIZE              524288
#define NANDFLASH_BOOT_PAGE_SIZE          0x3E4
#define NANDFLASH_BOOT_ECCBYTES           0x3C






-----[ Micron Recommended Replacement NAND Flash device and My Changed #defines ]----------

NAND Part         : Micron MT29F32G08CBADA

Page Size x8      : 8936 bytes (8192 + 744 bytes)

Block Size        : 256 pages (2048K + 186K bytes)

Plane Size        : 2 planes x 1064 blocks per plane

Device Size       : 32Gb – 2128 blocks


C:\Program Files (x86)\Freescale\Freescale MQX 3.8.1.1\mqx\source\bsp\twrmpc5125\twrmpc5125.h

#define BSP_FLASH_BASE                  ((pointer)0x0) /* block #0 */
#define BSP_FLASH_SIZE                  (0x400000)
#define BSP_FLASH_WIDTH                 (8)
#define BSP_FLASH_DEVICES               (1)
#define BSP_VIRTUAL_PAGE_SIZE           (8192)
#define BSP_ECC_SIZE                    (32) /* 32-error correction bits (60 ECC bytes) */
#define BSP_NAND_BLOCK_SIZE             (8192 * 256)  /* 2,097,152 Bytes */
#define BSP_NAND_NUM_BLOCKS             (2128)



C:\Program Files (x86)\Freescale\Freescale MQX 3.8.1.1\mqx\source\bsp\twrmpc5125\bsp_prv.h

#define NANDFLASH_PHYSICAL_PAGE_SIZE      8192
#define NANDFLASH_SPARE_AREA_SIZE         60
#define NANDFLASH_BLOCK_SIZE              2097152
#define NANDFLASH_BOOT_PAGE_SIZE          0x3E4
#define NANDFLASH_BOOT_ECCBYTES           0x3C


 

 

Outcomes