Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

NAND Flash Booting

Honored Contributor II



Am facing problem with NAND Flash booting. Am able to boot the preloader successfully using nand.  

Am using s34ml01g1 NAND flash. 

What i have done is: 

1) I have placed preloader-mkpimage.bin file at 0x0 address of NAND. 

2) then u-boot.bin file at 0xC0000 (which is the next boot address as in bsp settings). 


Preloader is running fine, then the control is going to next boot address also, but u-boot is not executing fully. Its stopping inthe middle. Here is the snapshot of terminal window.  


How can i solve the problem? 


Can any of the following things solve my problem: 

1) Enabling ECC for NAND, if yes, How to enable this. 

2) Editing the values in socfpga_common.h file, what are the values for my NAND device? 

3) By making "bootstrap_inhibit_init" to 0 in "boot strap settings" register. How can i do this? 


Please help me out of this... 


0 Kudos
2 Replies
Honored Contributor II

I am using the same NAND device but am using the 2G size and think I have a similar problem that you were experiencing. The preloader runs fine but Uboot does not run. See the macros that I changed to support the device I am using. Did you ever figure out your problem? 


# define CONFIG_SYS_NAND_PAGE_SIZE 2048 /*512*/ 

# define CONFIG_SYS_NAND_OOBSIZE 64 /*16*/ 

# define CONFIG_SYS_NAND_BLOCK_SIZE (128 * 1024) /*(32 * 512)*/ 

/* number of pages per block */ 

# define CONFIG_SYS_NAND_PAGE_COUNT 64 /*32*/ 

/* location of bad block marker within OOB */ 



/* environment setting for NAND */ 


# define CONFIG_ENV_OFFSET (0x00080000) 

# endif
0 Kudos
Honored Contributor II



We are also facing the same issue wrt NAND flash booting. When I am loading preloader generated for my custom application in the hyper terminal i am getting the error as " NAND DENALI TIMEOUT INTERRUPT STATUS 00000000" after NAND flash initialisation. So it is not jumping to the image stored at NAND location 0xc0000.  


First i just loaded preloader into 0x0 address of NAND flash and hello world img at 0xc0000. Preloader is executing from NAND flash but hello world is not displayed. Then after programming preloader i was not able to erase, write or read even the silicon id of flash.  

So, replaced that NAND chip and debugging preloader from DS-5 and loaded hello world image at 0xc0000 then i am getting the above mentioned error. 


Please do suggest me what we have missed. 



0 Kudos