8 Replies Latest reply on Sep 18, 2020 7:48 AM by prasannakotrappa

    Booting/InstallingLinux on Zedboard

    andrewmine

      Hi

      I am very new with the embedded software world and I am currently trying to boot Linux Kernel on Zedboard from SD CARD. I had about a week back tried to install on a zybo board and it was working. I had followed the same steps but however ended up running into issues. Currently , I am able to connect to the uboot bootup console via usb-uart and the following is the log.

      Further details on how I have done this:

      1) Obtained the linux uImage

      2) Compiled devicetree.dtb from linux-digilent-dev branch

      3)Created a base design in Vivado consisting of the processing system and axi gpio. In the Xilinx SDK created a new zyng fsbl(didn't do any changes to any files). 

      4) From Xilinx Tools , create boot image i added the systemwrapper.bit , the fsbl. elf and uboot.elf to create boot.bin.

      5) Partioned the SD card into 4 mb space left at start, 1 gb fat partition and rest as ext4 partition.

      6) Copied the uImage, boot.bin and devicetree.dtb with same names into the 1gb partition.

      7) Set JP9 and JP8 to 3V3 amd JP7 ,JP8 and JP11 to GND.

      8) Connected the usb-art ,inserted SD card in the slot and powered on.

      9) I can see the following output via minicom console.

      U-Boot 2014.01 (Aug 09 2016 - 17:17:22)
       
      I2C:   ready
      Memory: ECC disabled
      DRAM:  512 MiB
      MMC:   zynq_sdhci: 0
      SF: Detected S25FL256S_64K with page size 256 Bytes, erase size 64 KiB, total 32 MiB
      In:    serial
      Out:   serial
      Err:   serial
      Net:   Gem.e000b000
      Hit any key to stop autoboot:  0 
      Configure PL and booting Linux from TFTP...
      Device: zynq_sdhci
      Manufacturer ID: 3
      OEM: 5344
      Name: SU04G
      Tran Speed: 50000000
      Rd Block Len: 512
      SD version 3.0
      High Capacity: Yes
      Capacity: 3.7 GiB
      Bus Width: 4-bit
      Xilinx Device
      Descriptor @ 0x1ffbaa54
      Family:         Zynq PL
      Interface type: Device configuration interface (Zynq)
      Device Size:    4045564 bytes
      Cookie:         0x20 (32)
      Device name:    7z020
      No Device Function Table.
      Gem.e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
      Gem.e000b000: No link.
      fpga - loadable FPGA image support
       
      Usage:
      fpga [operation type] [device number] [image address] [image size]
      fpga operations:
        dump  [dev]                   Load device to memory buffer
        info  [dev]                   list known device information
        load  [dev] [address] [size]  Load device from memory buffer
        loadp [dev] [address] [size]  Load device from memory buffer with partial bitstream
        loadb [dev] [address] [size]  Load device from bitstream buffer (Xilinx only)
        loadbp        [dev] [address] [size]  Load device from bitstream buffer with partial bitstream(Xilinx only)
        loadmk [dev] [address]        Load device generated with mkimage
              For loadmk operating on FIT format uImage address must include
              subimage unit name in the form of addr:<subimg_uname>
      Load device from filesystem (FAT by default) (Xilinx only)
        loadfs [dev] [address] [image size] [blocksize] <interface>
              [<dev[:part]>] <filename>
       
      Gem.e000b000:0 is connected to Gem.e000b000.  Reconnecting to Gem.e000b000
      Gem.e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
      Gem.e000b000: No link.
      Gem.e000b000:0 is connected to Gem.e000b000.  Reconnecting to Gem.e000b000
      Gem.e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
      Gem.e000b000: No link.
      Gem.e000b000:0 is connected to Gem.e000b000.  Reconnecting to Gem.e000b000
      Gem.e000b000 Waiting for PHY auto negotiation to complete......... TIMEOUT !
      Gem.e000b000: No link.
      Wrong Image Format for bootm command
      ERROR: can't get kernel image!
      zynq-uboot> 
       
      The bolded text above has got me wondering why is that it is saying loading from tftp despite i have setup jumpers to boot from sd card? I went to the zynq-common.h bootfile in uboot-digilent-dev-master-next and noticed that if it boots from sd_card the following needs to be done:
       
       
        sdboot=if mmcinfo; then " \
        "run uenvboot; " \
        "echo Copying Linux from SD to RAM... && " \
        "fatload mmc 0 0x3000000 ${kernel_image} && " \
        "fatload mmc 0 0x2A00000 ${devicetree_image} && " \
        "bootm 0x3000000 0x2000000 0x2A00000; " \
        "fi\0" \
         
        so something like copying linux from sd to ram should come up.  Can someone help me with this? I also wanted to know what exactly is being done in the uboot. Has the pl been initialized?
       
        • Additional Info I found with printenv
          andrewmine
          zynq-uboot> printenv
          baudrate=115200
          bitstream_image=system.bit.bin
          boot_image=BOOT.bin
          boot_size=0xF00000
          bootcmd=run $modeboot
          bootdelay=3
          bootenv=uEnv.txt
          devicetree_image=devicetree.dtb
          devicetree_load_address=0x2000000
          devicetree_size=0x20000
          dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0
          dfu_mmc_info=set dfu_alt_info ${kernel_image} fat 0 1\\;${devicetree_image} fat 0 1\\;${ramdisk_image} fat 0 1
          dfu_ram=run dfu_ram_info && dfu 0 ram 0
          dfu_ram_info=set dfu_alt_info ${kernel_image} ram 0x3000000 0x500000\\;${devicetree_image} ram 0x2A00000 0x20000\\;${ramdisk_image} ram 0x2000000 0x600000
          ethact=Gem.e000b000
          ethaddr=00:0a:35:00:01:22
          fdt_high=0x20000000
          importbootenv=echo Importing environment from SD ...; env import -t ${loadbootenv_addr} $filesize
          initrd_high=0x20000000
          ipaddr=192.168.1.4
          jtagboot=echo TFTPing Linux to RAM... && tftpboot ${kernel_load_address} ${kernel_image} && tftpboot ${devicetree_load_address} ${devicetree_image} && tftpboot ${ramdisk_load_address} ${ramdisk_image} && bootm $}
          kernel_image=uImage
          kernel_load_address=0x2080000
          kernel_size=0x500000
          loadbit_addr=0x100000
          loadbootenv=load mmc 0 ${loadbootenv_addr} ${bootenv}
          loadbootenv_addr=0x2000000
          mmc_loadbit=echo Loading bitstream from SD/MMC/eMMC to RAM.. && mmcinfo && load mmc 0 ${loadbit_addr} ${bitstream_image} && fpga load 0 ${loadbit_addr} ${filesize}
          modeboot=sdboot
          nandboot=echo Copying Linux from NAND flash to RAM... && nand read ${kernel_load_address} 0x100000 ${kernel_size} && nand read ${devicetree_load_address} 0x600000 ${devicetree_size} && echo Copying ramdisk... &&}
          norboot=echo Copying Linux from NOR flash to RAM... && cp.b 0xE2100000 ${kernel_load_address} ${kernel_size} && cp.b 0xE2600000 ${devicetree_load_address} ${devicetree_size} && echo Copying ramdisk... && cp.b 0x}
          preboot=if test $modeboot = sdboot && env run sd_uEnvtxt_existence_test; then if env run loadbootenv; then env run importbootenv; fi; fi; 
          qspiboot=echo Copying Linux from QSPI flash to RAM... && sf probe 0 0 0 && sf read ${kernel_load_address} 0x100000 ${kernel_size} && sf read ${devicetree_load_address} 0x600000 ${devicetree_size} && echo Copying}
          ramdisk_image=uramdisk.image.gz
          ramdisk_load_address=0x4000000
          ramdisk_size=0x5E0000
          rsa_jtagboot=echo TFTPing Image to RAM... && tftpboot 0x100000 ${boot_image} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
          rsa_nandboot=echo Copying Image from NAND flash to RAM... && nand read 0x100000 0x0 ${boot_size} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
          rsa_norboot=echo Copying Image from NOR flash to RAM... && cp.b 0xE2100000 0x100000 ${boot_size} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
          rsa_qspiboot=echo Copying Image from QSPI flash to RAM... && sf probe 0 0 0 && sf read 0x100000 0x0 ${boot_size} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_addr}
          rsa_sdboot=echo Copying Image from SD to RAM... && load mmc 0 0x100000 ${boot_image} && zynqrsa 0x100000 && bootm ${kernel_load_address} ${ramdisk_load_address} ${devicetree_load_address}
          sd_uEnvtxt_existence_test=test -e mmc 0 /uEnv.txt
          sdboot=echo Configure PL and booting Linux from TFTP...;mmcinfo;fpga info 0;tftpboot 0x1000000 system.bin;fpga load 0 0x1000000 3dbafc;tftpboot 0x3000000 ${kernel_image};tftpboot 0x2A00000 ${devicetree_image};tf0
          serverip=192.168.1.20
          stderr=serial
          stdin=serial
          stdout=serial
          thor_mmc=run dfu_mmc_info && thordown 0 mmc 0
          thor_ram=run dfu_ram_info && thordown 0 ram 0
          uenvboot=if run loadbootenv; then echo Loaded environment from ${bootenv}; run importbootenv; fi; if test -n $uenvcmd; then echo Running uenvcmd ...; run uenvcmd; fi
          usbboot=if usb start; then run uenvboot; echo Copying Linux from USB to RAM... && load usb 0 ${kernel_load_address} ${kernel_image} && load usb 0 ${devicetree_load_address} ${devicetree_image} && load usb 0 ${rai
           
          Environment size: 4778/131068 bytes
           
          • Hello Andrewmine,
            jafoste4

            Hello Andrewmine,

            Take a look at this link http://www.wiki.xilinx.com/Linux 

            Go throught the "System Software Development" steps near the bottom of the screen which details how to build kernel on your system.

            Let me know how that works.

            --Josh

              • Hi
                andrewmine

                Hi

                I have not been able to access that link at all. It says to create an account and I have created the account the day you posted and still haven't been approved yet. I am not sure. However, I have gone through a similar tutorial and reached this stage.

                 

                Currently, when I am printing the print env it shows as follows:

                 

                sdboot=echo Configure PL and booting Linux from TFTP...;mmcinfo;fpga info 0;tftpboot 0x1000000 system.bin;fpga load 0 0x1000000 3dbafc;tftpboot 0x3000000 ${kernel_image};tftpboot 0x2A00000 ${devicetree_image};tf0
                 
                 
                which is what the problem is I guess. At the zynq-uboot terminal, when I manually type in the commands :
                 
                  fatload mmc 0 0x3000000 uImage
                  fatload mmc 0 0x2A00000 devicetree.dtb 
                  bootm 0x3000000 - 0x2A00000
                   
                  It works. So my question is why has uboot compiled in such a way and how do I fix it. I have even tried created a uEnv.txt but it is not working as well.
                   
              • Hello Andrewmine,
                jafoste4

                Hello Andrewmine,

                It appears I posted the wrong link. Here it is http://www.wiki.xilinx.com/Linux , and I also updated the link above.

                --Josh

                • Hi
                  100trigger

                  Hello andrewmine,

                  I have the same problem on picozed board did you solved it?

                  Regards,

                  -Trigger

                    • Hi
                      andrewmine

                      Hi

                       

                      I was not able to solve it. So now I manually input the commands and it works. 

                       

                      At zynq-uboot> 

                      Manually Use these comamnds

                       
                      fatload mmc 0 0x3000000 uImage
                      fatload mmc 0 0x2A00000 devicetree.dtb
                      bootm 0x3000000 - 0x2A00000
                    • another solution
                      casey.mcmullen.ice-aec

                      I had the same problem with my microzed board. Doing "fatload,fatload,bootm" at the zynq boot prompt also worked for me, but that's not a full solution.

                       

                      Found a solution here: https://forums.xilinx.com/t5/Embedded-Linux/Kernel-Boot-Failing-on-Zynq-in-U-Boot/td-p/703136

                      It says, make sure your SD clock speed is 50 MHz and not 25 MHz. Mine was indeed set to 25, rebuilding at 50 MHz solved it and now my board boots just fine unassisted.

                      • Re: Booting/InstallingLinux on Zedboard
                        prasannakotrappa

                        Hi,

                         

                        I have the similar error and not able to resolve it, I am using zedboard, and I want to use my PL DDR instead of PS DDR, hence i changed the DDR address to 0x40000000 and I can see my DDR address using bd command,

                         

                        Zynq> bd

                         

                        arch_number = 0x00000000

                        boot_params = 0x00000000

                        DRAM bank = 0x00000000

                        -> start = 0x40000000

                        -> size = 0x10000000

                        baudrate = 115200 bps

                        TLB addr = 0x4fff0000

                        relocaddr = 0x4ff2f000

                        reloc off = 0x4bf2f000

                        irq_sp = 0x4eb09130

                        sp start = 0x4eb09120

                        ARM frequency = 666 MHz

                        DSP frequency = 0 MHz

                        DDR frequency = 533 MHz

                        Early malloc usage: 5f8 / 800

                        fdt_blob = 0x4eb09148

                        arch_number = 0x00000000

                        boot_params = 0x00000000

                        DRAM bank = 0x00000000

                        -> start = 0x40000000

                        -> size = 0x10000000

                        baudrate = 115200 bps

                        TLB addr = 0x4fff0000

                        relocaddr = 0x4ff2f000

                        reloc off = 0x4bf2f000

                        irq_sp = 0x4eb09130

                        sp start = 0x4eb09120

                        ARM frequency = 666 MHz

                        DSP frequency = 0 MHz

                        DDR frequency = 533 MHz

                        Early malloc usage: 5f8 / 800

                        fdt_blob = 0x4eb09148

                         

                        my printenv:

                         

                        dfu_mmc=run dfu_mmc_info && dfu 0 mmc 0

                        dfu_mmc_info=setenv dfu_alt_info ${kernel_image} fat 0 1\\;${devicetree_image} fat 0 1\\;${ramdisk_image} fat 0 1

                        dfu_ram=run dfu_ram_info && dfu 0 ram 0

                        dfu_ram_info=setenv dfu_alt_info ${kernel_image} ram 0x3000000 0x500000\\;${devicetree_image} ram 0x2A00000 0x20000\\;${ramdisk_image} ram 0x2000000 0x600000

                        distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done

                        efi_dtb_prefixes=/ /dtb/ /dtb/current/

                        ethaddr=00:0a:35:00:1e:53

                        fdt_addr_r=0x1f00000

                        fdt_high=0x20000000

                        fdtaddr=41420454

                        fdtcontroladdr=4eb09148

                        fileaddr=41000000

                        filesize=af8e88

                        initrd_high=0x20000000

                        kernel_addr_r=0x2000000

                         

                        But in autoboot, when I run the below command, I get below error,

                         

                        Wrong Image Format for bootm command

                        ERROR: can't get kernel image!

                         

                        Commands I executed:

                         

                        fatload mmc 0 0x3000000 uImage

                        fatload mmc 0 0x2A00000 devicetree.dtb

                        bootm 0x3000000 0x2A00000

                         

                        How to solve this issue?

                         

                        Regards,

                        Prasanna