No Bootloader activity after saving NAND Env

cancel
Showing results for 
Search instead for 
Did you mean: 

No Bootloader activity after saving NAND Env

Jump to solution
904 Views
carlovalgocela
Contributor III

Hello

I have some problem where the bootloader no longer works after saving the setenv in nand.

Below is my procedure:

 

 

Board: PCM052

 

1 Erase NAND Flash

    =>nand erase.chip

 

2. Load U-boot

    =>fatload mmc 0:1 0x80400000 u-boot.nand

    =>nandwrite 0x80000 0x80400000 0x3DAA0

3. reset your board (For the Phytec phyCORE Vybrid, the "Boot" switches 1, 2, and 5 should be set to On).

 

 

4. Booting Kernel/RFS from NAND Flash

 

    =>fatload mmc 0:1 0x80010000 uImage-3.0-ts-armv7l

    =>nand write 0x80010000 0x100000 0x2491A4

 

 

 

5. set to BOOT from SD

6. Writing RFS to NAND Flash

    => setenv bootcmd fatload mmc 0:1 0x81000000 uImage-3.0-ts-armv7l\;bootm 0x81000000

    => setenv bootargs mem=256M console=ttymxc1,115200 root=/dev/mmcblk0p2 rw rootwait mtdparts=NAND:0xe0000(U-boot),0x20000(U-boot_env),0x500000(Kernel),0x14000000(RFS),-(DATA)

7. boot

8. Write RFS

    #nandwrite /dev/mtd3 rootfs.jffs2

9. poweroff and removed SD Card

 

10. set set env and boot

    =>setenv bootargs mem=256M console=ttymxc1,115200 rootfstype=jffs2 root=/dev/mtdblock3 rw rootwait mtdparts=NAND:0xe0000(U-boot),0x20000(U-boot_env),0x500000(Kernel),0x14000000(RFS),-(DATA)

    =>setenv bootcmd 'nand read 0x80010000 0x100000 0x2491a4; bootm 0x80010000'

    =>boot

 

11. reboot and repeat step 10 to check if still boot from NAND

        Result: booted the Linux Kernel

 

 

11. reboot and save env

    =>setenv bootargs mem=256M console=ttymxc1,115200 rootfstype=jffs2 root=/dev/mtdblock3 rw rootwait mtdparts=NAND:0xe0000(U-boot),0x20000(U-boot_env),0x500000(Kernel),0x14000000(RFS),-(DATA)

    =>setenv bootcmd 'nand read 0x80010000 0x100000 0x2491a4; bootm 0x80010000'

    =>saveenv

   

    -- Reboot Board

           Result: bootloader no longer loads.

 

 

 

After performing Step 11 the bootloader no longer work.

 

Any ideas what is wrong when i perform step 11.

Original Attachment has been moved to: saveenv.zip

Labels (1)
Tags (3)
0 Kudos
1 Solution
275 Views
carlovalgocela
Contributor III

Feedback from timesyssupport

The source of the problem is that u-boot is set up to store it's

environment to 0x80000, and it ends up over-writing itself.

So one fix is to use 'nandwrite 0x40000 0x80400000 0x3da98' instead of

'nandwrite 0x80000 0x80400000 0x3da98'.

This will work as long as your uBoot is not greater than 0x40000 bytes.

Another option is to change where u-boot environment is stored, by

editing:

.../factory_directory/build.../u-boot-2013.07/u-boot-2013.07/include/configs/pcm052_nand.h

      and change '8' to '14' in line  '#define CONFIG_ENV_OFFSET        (8

* 64 * 1024)'

I used option 2 and it works...

View solution in original post

0 Kudos
1 Reply
276 Views
carlovalgocela
Contributor III

Feedback from timesyssupport

The source of the problem is that u-boot is set up to store it's

environment to 0x80000, and it ends up over-writing itself.

So one fix is to use 'nandwrite 0x40000 0x80400000 0x3da98' instead of

'nandwrite 0x80000 0x80400000 0x3da98'.

This will work as long as your uBoot is not greater than 0x40000 bytes.

Another option is to change where u-boot environment is stored, by

editing:

.../factory_directory/build.../u-boot-2013.07/u-boot-2013.07/include/configs/pcm052_nand.h

      and change '8' to '14' in line  '#define CONFIG_ENV_OFFSET        (8

* 64 * 1024)'

I used option 2 and it works...

View solution in original post

0 Kudos