This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Unable to Load zimage to the NAND for AM335x EVM

As per u-Boot wiki for NAND Boot from SD Card , we tried to write MLO and u-boot.img is writing fine but zimage got some erors: Logs for nand write

U-Boot# mmc rescan
U-Boot# fatload mmc 0 0x82000000 MLO
reading MLO
79596 bytes read in 15 ms (5.1 MiB/s)
U-Boot# nand erase 0x0 0x20000

NAND erase: device 0 offset 0x0, size 0x20000
Erasing at 0x0 -- 100% complete.
OK
U-Boot# nand write 0x82000000 0x0 0x20000

NAND write: device 0 offset 0x0, size 0x20000
 131072 bytes written: OK

U-Boot# fatls mmc 0
    79596   mlo
   572284   u-boot.img
  4302208   zimage

3 file(s), 0 dir(s)

U-Boot# mmc rescan
U-Boot# fatload mmc 0 0x82000000 zimage
reading zimage             
4302208 bytes read in 578 ms (7.0 mb)
U-Boot# nand erase 0x00280000 0x00

Erasing at 0x680000 -- 100% complete.
OK
U-Boot# nand write 0x82000000 0x00280000 0x41FFFF

NAND write: device 0 offset 0x280000, size 0x41ffff
WARNING in ../drivers/mtd/nand/nand_base.c line 1072
WARNING in ../drivers/mtd/nand/nand_base.c line 1072
WARNING in ../drivers/mtd/nand/nand_base.c line 1072
BUG: failure at ../drivers/mtd/nand/nand_base.c:242/nand_select_chip()!
BUG!
resetting ...

// from here onwards why it is restarting --- not able to understand

U-Boot SPL 2015.04-rc1-dirty (May 13 2015 - 21:44:29)
Timed out in wait_for_event: status=0000
Check if pads/pull-ups of bus 0 are properly configured
The Expected Linux image was not found. Please check your NAND configuration.
Trying to start u-boot now...

U-Boot SPL 2015.04-rc1-dirty (May 13 2015 - 21:44:29)
Timed out in wait_for_event: status=0000
Check if pads/pull-ups of bus 0 are properly configured
The Expected Linux image was not found. Please check your NAND configuration.
Trying to start u-boot now...we are trying to load zimage so that we got this error -- kindly help in this -

//-------------------------------------

Please me correct we are missed any thing.

we are in confusion in nand-partition -- Linux core u-boot guide is explaning one type:

But we are not having : This config in u-boot in the ti-git repo.

AM335x GP EVM am335x_evm_nandboot_config   

// and those NAND fine are generating --- the files

U-Boot # mmc rescan
U-Boot # nand erase.chip
U-Boot # load mmc 0 0x81000000 MLO
U-Boot # nand write 0x81000000 NAND.SPL
U-Boot # nand write 0x81000000 NAND.SPL.backup1
U-Boot # nand write 0x81000000 NAND.SPL.backup2
U-Boot # nand write 0x81000000 NAND.SPL.backup3
U-Boot # load mmc 0 0x81000000 u-boot.img
U-Boot # nand write 0x81000000 NAND.u-boot
U-Boot # load mmc 0 0x81000000 zImage
U-Boot # nand write 0x81000000 NAND.kernel
U-Boot # run findfdt
U-Boot # load mmc 0 0x81000000 $fdtfile
U-Boot # nand write 0x81000000 NAND.u-boot-spl-os
U-Boot # saveenv

//=======
But we are following AM335x_U-Boot_User's_Guide#NAND_2 --wiki
for NAND write


Please kindly help me in this and suggest us if we are missing anything.

regards,

Viswanath K.

  • Hi Viswanath,

    You need to write zImage in nand not zimage:  fatload mmc 0 0x82000000 zImage .

    Where did you downloaded your u-boot (U-Boot SPL 2015.04-rc1) from? Latest ti SDKs 08 & 1 use U-boot 2014-07. 

    Your console says that there is something suspicious in line 1072 in nand_base.c. Around that line in my u-boot sources are the functions related to the ecc scheme: nand_read_page_hwecc() & nand_read_page_hwecc_oob_first()

    Is it the same in your u-boot code? If so can you try changing the ecc scheme with nandecc command? 

    Can you add #define DEBUG in the beginning of nand_base.c, so that you can enable all debug messages in this driver? 

    Best Regards, 

    Yordan

  • Thanks for the reply.

    U-boot version is didnt saw properly -- from ti-wiki only through git . i need to check.


    1. One problem i found -- there is difference in Nand Paritions offsets latest one to early one. its 9 partitions.
    So i need to change partition offsets and then to test.
    2. I am not getting how to create UBIFS -- ?? there are few links are there but not given clearly.. like size of image parameters and etc.
    3. with SDK 8 -- in the filesystem folder there having 2 filesystem image ".ubi" can we use use those ????

    4. Finally to load all these file from U-boot --- in the SD card /boot partions -- there is no enough space to accommodate these file to load from
    "mmc 0" .. can you increase the size of boot partition size in the sd card.

    Regards,

    Viswanath K
  • Hi Yordan,

    Yes U-boot version : U-Boot SPL 2015.04-rc1-dirty (May 13 2015 - 21:44:29).

    We given these commands to write MLO,u-boot.img ,zImage and am335x-evmsk.dtb to the NAND --

    These are commands to load files to the NAND:

    U-Boot# fatls mmc 0
        79596   mlo
       572284   u-boot.img
      4294832   zimage
                .trash-1000/
        36205   am335x-evmsk.dtb
       131072   uboot.env

    5 file(s), 1 dir(s)

    U-Boot# mmc rescan
    U-Boot# nand erase.chip

    NAND erase.chip: device 0 whole chip
    Erasing at 0xffe0000 -- 100% complete.
    OK
    U-Boot# load mmc 0 0x81000000 MLO
    reading MLO
    79596 bytes read in 15 ms (5.1 MiB/s)
    U-Boot# nand write 0x81000000 NAND.SPL

    NAND write: device 0 offset 0x0, size 0x20000
     131072 bytes written: OK
    U-Boot# nand write 0x81000000 NAND.SPL.backup1

    NAND write: device 0 offset 0x20000, size 0x20000
     131072 bytes written: OK
    U-Boot# nand write 0x81000000 NAND.SPL.backup2

    NAND write: device 0 offset 0x40000, size 0x20000
     131072 bytes written: OK
    U-Boot# nand write 0x81000000 NAND.SPL.backup3

    NAND write: device 0 offset 0x60000, size 0x20000
     131072 bytes written: OK
    U-Boot# load mmc 0 0x81000000 u-boot.img
    reading u-boot.img
    572284 bytes read in 81 ms (6.7 MiB/s)
    U-Boot# nand write 0x81000000 NAND.u-boot

    NAND write: device 0 offset 0xc0000, size 0x100000
     1048576 bytes written: OK
    U-Boot# load mmc 0 0x81000000 zImage
    reading zImage
    4294832 bytes read in 576 ms (7.1 MiB/s)
    U-Boot# nand write 0x81000000 NAND.kernel

    NAND write: device 0 offset 0x200000, size 0x800000
     8388608 bytes written: OK
    U-Boot# run findfdt
    U-Boot# load mmc 0 0x81000000 $fdtfile
    reading am335x-evmsk.dtb
    36205 bytes read in 11 ms (3.1 MiB/s)
    U-Boot# nand write 0x81000000 NAND.u-boot-spl-os

    NAND write: device 0 offset 0x80000, size 0x40000
     262144 bytes written: OK
    U-Boot# saveenv
    Saving Environment to NAND...
    Erasing redundant NAND...
    Erasing at 0x1e0000 -- 100% complete.
    Writing to redundant NAND... OK
    U-Boot# boot


    //=========================================================

    we got these errors after restarting the system


    U-Boot SPL 2015.04-rc1-dirty (May 13 2015 - 21:44:29)
    Timed out in wait_for_event: status=0000
    Check if pads/pull-ups of bus 0 are properly configured
    The Expected Linux image was not found. Please check your NAND configuration.
    Trying to start u-boot now...


    U-Boot 2015.04-rc1-dirty (May 13 2015 - 21:44:29)

           Watchdog enabled
    I2C:   ready
    DRAM:  256 MiB
    NAND:  256 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Viswa this is my Image
    Net:   Phy 0 not found
    cpsw, usb_ether
    Hit any key to stop autoboot:  0
    Card did not respond to voltage select!    // why this is came -- might SD Card -- becoz i removed the sd card.
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Card did not respond to voltage select!
    Booting from nand ...                                            // might this is u-booting

    NAND read: incorrect device type in u-boot-spl-os    // why this -- error we given dtb file related to the kernel we use.

                          // is this due to the " u-boot is having all names with beaglebone -- names and in kernel all r "evmsk" is that difference..?????

    NAND read: incorrect device type in kernel    --
    Bad Linux ARM zImage magic!                               -- i didnt understand why we got this error -- we given working kernel with SD-CARD.
    U-Boot#

    I am having another we didnt given rootfilesystem --

    I am not having any idea -- how to load ubis.img to the nand -- becoz u-boot prompt is taking on "mmc 0" and then this sd-card "/boot" partitions is is accomidating only MLO , u-boot.img and zImage.   ---- do we need to increase the boot partition in the SD Card or is there any thing else is there..???

    I generated ubis.img using mtb-utils -- with mkfs.ubifs command

    Please any once guide here --

  • Thanks for sharing your solution.

    Best Regards,
    Yordan
  • Dear VISWANATH

    I can't find solution  from your link about below error message

    Timed out in wait_for_event: status=1100
    Check if pads/pull-ups of bus 1 are properly configured
    Timed out in wait_for_bb: status=1000
    The Expected Linux image was not found. Please check your NAND configuration.


    May I get your  opinion? Thank you.

  • can you please post complete log and how you are going to load the commands and etc so that i can help you.

    "Timed out " thing is not fixed - but linux will boot.

    regards,

    Viswa.
  • Dear VISWANATH

    Sorry, I'm late to reply.

    This is my flash command below:

    U-Boot # mmc rescan
    U-Boot # nand erase.chip
    U-Boot # fatload mmc 0 0x82000000 MLO
    U-Boot # nand write 0x82000000 NAND.SPL
    U-Boot # nand write 0x82000000 NAND.SPL.backup1
    U-Boot # nand write 0x82000000 NAND.SPL.backup2
    U-Boot # nand write 0x82000000 NAND.SPL.backup3

    There is weird thing is that the behavior is different between with SD and NAND.

    My code:

      

    int sil_rev;

            /*
             * The GP EVM, IDK and EVM SK use a TPS65910 PMIC.  For all
             * MPU frequencies we support we use a CORE voltage of
             * 1.1375V.  For MPU voltage we need to switch based on
             * the frequency we are running at.
             */
            +puts("HHHHHHHHHHHHHHHIIIIIIIIIIII\n");
            +i2c_set_bus_num(1);

            if (i2c_probe(TPS65910_CTRL_I2C_ADDR))

                                 return;
            +puts("123\n");

    then I boot from sd card:

            U-Boot SPL 2015.07 (Oct 26 2015 - 12:51:41)
             HHHHHHHHHHHHHHHIIIIIIIIIIII
            123

                                        reading args
                                       spl_load_image_fat_os: error reading image args, err - -1
                                       reading u-boot.img
                                       reading u-boot.img

    ===================================================================================

                                       and I boot from nand:

          U-Boot SPL 2015.07 (Oct 26 2015 - 12:51:41)
          HHHHHHHHHHHHHHHIIIIIIIIIIII
         123
         Timed out in wait_for_event: status=1100
         Check if pads/pull-ups of bus 1 are properly configured

      

  • HI,

    1. after SPL3, what happening.. ??? OR -- are facing any problem with u-boot writing to nand. ???

    2. This code is all belongs too u-boot -- so here my question is -- don't keep any thing in the u-boot. it works -- only it will fail -- if u done any new change u done -- those might effecting.

    3. are adding NAND to u-boot on your own ???. any thing else. NAND related code is perfect -- u need add its initialization functions call at proper places thats it and thats what i did for the NAND-Boot.
    Please check the places -- the nand initialization places -- is it added properly .. ??

    4. forgot about -- "check if pads/pull-ups of bus 1 are properly configured" error message.


    regards,

    Viswanath K.
  • Dear VISWANATH KONDAPALLI

    1 After we type "nand write 0x82000000 NAND.SPL.backup3", It is wrote correctly to nand flash.

    2 u-boot can work, and it can read kernel, then kernel mount filesystem.

    3 We have not change anything with u-boot

    4 OK......, but, it is very weird.

    Thank you.

  • Hi

    You can try reduced speed of i2c, I have solved this problem.