微處理器 - Nuvoton NUC977 - Flash NAND



1. 設定PA0、PA1成USB啟動
2. 開啟CONFIG_ENV_IS_IN_NAND並編譯UBoot程式

$ vim include/configs/nuc970_evb.h
    48 #define CONFIG_SYS_USE_SPIFLASH
    49 #define CONFIG_SYS_USE_NANDFLASH
    50 #define CONFIG_SYS_NO_FLASH    // that is, no *NOR* flash 
    51 #define CONFIG_ENV_IS_IN_NAND 
    52 //#define CONFIG_ENV_IS_IN_SPI_FLASH 
    53 //#define CONFIG_ENV_IS_IN_MMC

3. 編輯env.txt

$ vim spi_env.txt
    bootcmd=nboot 0x7fc0 0 0x200000; bootm 0x7fc0
    baudrate=115200
    bootdelay=3
    ethact=emac
    ethaddr=00:00:00:11:66:88
    stderr=serial
    stdin=serial
    stdout=serial

4. 燒錄至NAND

$ sudo nuwriter -m nand -d NUC972DF62Y.ini -e 0xffffffff
$ sudo nuwriter -m nand -d NUC972DF62Y.ini -t env -a 0x80000 -w nand_env.txt -v
$ sudo nuwriter -m nand -d NUC972DF62Y.ini -t uboot -a 0x200 -w nand_spl/u-boot-spl.bin -v
$ sudo nuwriter -m nand -d NUC972DF62Y.ini -t data -a 0x100000 -w u-boot.bin -v
$ sudo nuwriter -m nand -d NUC972DF62Y.ini -t data -a 0x200000 -w arch/arm/boot/uImage -v

5. 設定PA0、PA1成NAND啟動