News:

Attention: For security reasons,please choose a user name *different* from your login name.
Also make sure to choose a secure password and change it regularly.

Main Menu

problem in creating my own linux project from scratch with zynqberry

Started by mage, March 18, 2018, 12:42:02 PM

Previous topic - Next topic

mage

I have run "te0726-zynqberrydemo2-vivado_2017.1-build_03_20170705132647" on zynqberry successfully.
And the I want to creat my own linux project from scratch.

(1)create vivado project using "vivado_create_project_guimode.cmd" containing in the  "te0726-zynqberrydemo2-vivado_2017.1-build_03_20170705132647".
(2)implement the design and export HDF file.
(3)Set PetaLinux Working Environment.
(4)Create a New Project
(5)Import Hardware Configuration (see UG1144):
    Export Hardware Definition File (*.hdf) from the Vivado Project into the PetaLinux root folder "<plnx-proj-root>":
        change to PetaLinux root folder:
        Run:$ petalinux-config --get-hw-description
(6)Open \project-spec\configs\config, and make the following changes:
SUBSYSTEM_MEMORY_PS7_DDR_0_BANKLESS_SIZE [=0x1F700000]
SUBSYSTEM_ROOTFS_SD [=y]

(7)Run:$ petalinux-build
(8)copy 'mkdebian.sh' to the root directory of Petalinux project
Run:$sudo ./mkdebian.sh
the output of the terminal was shown below:
zkf@ubuntu:~/zynqberry/test$ sudo ./mkdebian.sh
[sudo] password for zkf:
1792+0 records in
1792+0 records out
1879048192 bytes (1.9 GB, 1.8 GiB) copied, 3.48734 s, 539 MB/s
++ Setting up device: /dev/loop0
Warning: The resulting partition is not properly aligned for best performance.
Warning: The resulting partition is not properly aligned for best performance.
mkfs.fat 3.0.28 (2015-05-16)
unable to get drive geometry, using default 255/63
Auto-selecting FAT32 for large filesystem
/dev/loop0p2 has 255 heads and 63 sectors per track,
hidden sectors 0x0000;
logical sector size is 512,
using 0xf8 media descriptor, with 3607515 sectors;
drive number 0x80;
filesystem has 2 32-bit FATs and 8 sectors per cluster.
FAT size is 3517 sectors, and provides 450056 clusters.
There are 32 reserved sectors.
Volume ID is 8a67826e, no volume label.
mke2fs 1.42.13 (17-May-2015)
Discarding device blocks: done                           
Creating filesystem with 27344 1k blocks and 6848 inodes
Filesystem UUID: aa5a1594-d18f-4da8-842b-98e2ffc5176e
Superblock backups stored on blocks:
   8193, 24577

Allocating group tables: done                           
Writing inode tables: done                           
Creating journal (1024 blocks): done
Writing superblocks and filesystem accounting information: done

W: Cannot check Release signature; keyring file not available /usr/share/keyrings/debian-archive-keyring.gpg
I: Retrieving InRelease
I: Failed to retrieve InRelease
I: Retrieving Release
I: Retrieving Packages
I: Validating Packages
E: Couldn't download dists/jessie/main/binary-armhf/Packages
cp: cannot create regular file '/tmp/ROOT/etc/': Not a directory
cp: cannot create regular file '/tmp/ROOT/usr/bin/': No such file or directory
cp: cannot stat './build/linux/rootfs/targetroot/lib/modules/4.0.0-xilinx/': No such file or directory
./mkdebian.sh: line 74: /tmp/ROOT/etc/modules: No such file or directory
chroot: failed to run command '/bin/bash': No such file or directory
rm: cannot remove '/tmp/ROOT/etc/resolv.conf': No such file or directory
rm: cannot remove '/tmp/ROOT/usr/bin/qemu-arm-static': No such file or directory

(9)Program the flash using \te0726-zynqberrydemo2-vivado_2017.1-build_03_20170705132647\zynqberrydemo2\prebuilt\boot_images\te0726_m\u-boot\BOOT.BIN
(10)Write the generated 'te0726-debian.img' in step 8 to SD card using Win32DiskImager.
(11)copy the 'image.ub' contained in \images\linux in the FAT32 partition of SD card.
(12)Insert the SD card into zynqberry, the serial console showed as follws:

Device: sdhci@e0101000
Manufacturer ID: 2
OEM: 544d
Name: SD08G
Tran Speed: 50000000
Rd Block Len: 512
SD version 2.0
High Capacity: Yes
Capacity: 7.4 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
reading image.ub
3766444 bytes read in 228 ms (15.8 MiB/s)
## Loading kernel from FIT Image at 10000000 ...
   Using 'conf@2' configuration
   Verifying Hash Integrity ... OK
   Trying 'kernel@0' kernel subimage
     Description:  Linux Kernel
     Type:         Kernel Image
     Compression:  uncompressed
     Data Start:   0x100000d4
     Data Size:    3742920 Bytes = 3.6 MiB
     Architecture: ARM
     OS:           Linux
     Load Address: 0x00008000
     Entry Point:  0x00008000
     Hash algo:    sha1
     Hash value:   a33b1108bf98d148e36d2849d3945a5af6726e8e
   Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
   Using 'conf@2' configuration
   Trying 'fdt@0' fdt subimage
     Description:  Flattened Device Tree blob
     Type:         Flat Device Tree
     Compression:  uncompressed
     Data Start:   0x10391e90
     Data Size:    22231 Bytes = 21.7 KiB
     Architecture: ARM
     Hash algo:    sha1
     Hash value:   4c40b59b32531fca144f2965ac25422d4b7794fe
   Verifying Hash Integrity ... sha1+ OK
   Booting using the fdt blob at 0x10391e90
   Loading Kernel Image ... OK
   Loading Device Tree to 07ff7000, end 07fff6d6 ... OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 4.9.0-xilinx-v2017.2 (zkf@ubuntu) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #1 SMP PREEMPT Sat Mar 17 07:12:55 PDT 2018
CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=18c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
OF: fdt:Machine model: xlnx,zynq-7000
bootconsole [earlycon0] enabled
cma: Reserved 16 MiB at 0x1e400000
Memory policy: Data cache writealloc
percpu: Embedded 14 pages/cpu @df6c6000 s25932 r8192 d23220 u57344
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 127762
Kernel command line: console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 484340K/515072K available (6144K kernel code, 202K rwdata, 1456K rodata, 1024K init, 229K bss, 14348K reserved, 16384K cma-reserved, 0K highmem)
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xdf800000 - 0xff800000   ( 512 MB)
    lowmem  : 0xc0000000 - 0xdf700000   ( 503 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .text : 0xc0008000 - 0xc0700000   (7136 kB)
      .init : 0xc0900000 - 0xc0a00000   (1024 kB)
      .data : 0xc0a00000 - 0xc0a32840   ( 203 kB)
       .bss : 0xc0a32840 - 0xc0a6bed8   ( 230 kB)
Preemptible hierarchical RCU implementation.
        Build-time adjustment of leaf fanout to 32.
        RCU restricting CPUs from NR_CPUS=4 to nr_cpu_ids=2.
RCU: Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
efuse mapped to df800000
slcr mapped to df802000
L2C: platform modifies aux control register: 0x72360000 -> 0x72760000
L2C: DT/platform modifies aux control register: 0x72360000 -> 0x72760000
L2C-310 erratum 769419 enabled
L2C-310 enabling early BRESP for Cortex-A9
L2C-310 full line of zeros enabled for Cortex-A9
L2C-310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 kB
L2C-310: CACHE_ID 0x410000c8, AUX_CTRL 0x76760001
zynq_clock_init: clkc starts at df802100
Zynq clock init
sched_clock: 64 bits at 333MHz, resolution 3ns, wraps every 4398046511103ns
clocksource: arm_global_timer: mask: 0xffffffffffffffff max_cycles: 0x4ce07af025, max_idle_ns: 440795209040 ns
Switching to timer-based delay loop, resolution 3ns
clocksource: ttc_clocksource: mask: 0xffff max_cycles: 0xffff, max_idle_ns: 537538477 ns
timer #0 at df80a000, irq=17
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 666.66 BogoMIPS (lpj=3333333)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x100000 - 0x100058
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
Brought up 2 CPUs
SMP: Total of 2 processors activated (1333.33 BogoMIPS).
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
cpuidle: using governor menu
hw-breakpoint: found 5 (+1 reserved) breakpoint and 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xdf840000
zynq-pinctrl 700.pinctrl: zynq pinctrl initialized
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
pps_core: LinuxPPS API ver. 1 registered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0.0
FPGA manager framework
fpga-region fpga-full: FPGA Region probed
Advanced Linux Sound Architecture Driver Initialized.
clocksource: Switched to clocksource arm_global_timer
NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
hw perfevents: enabled with armv7_cortex_a9 PMU driver, 7 counters available
futex hash table entries: 512 (order: 3, 32768 bytes)
workingset: timestamp_bits=30 max_order=17 bucket_order=0
jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
dma-pl330 f8003000.dmac: Loaded driver for PL330 DMAC-241330
dma-pl330 f8003000.dmac:        DBUFF-128x8bytes Num_Chans-8 Num_Peri-4 Num_Events-16
e0001000.serial: ttyPS0 at MMIO 0xe0001000 (irq = 144, base_baud = 6249999) is a xuartps
?nsole [ttyPS0] enabled
console [ttyPS0] enabled
bootconsole [earlycon0] disabled
bootconsole [earlycon0] disabled
xdevcfg f8007000.devcfg: ioremap 0xf8007000 to df828000
[drm] Initialized
brd: module loaded
loop: module loaded
libphy: Fixed MDIO Bus: probed
CAN device driver interface
e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
e0002000.usb supply vbus not found, using dummy regulator
ULPI transceiver vendor/product ID 0x0424/0x0007
Found SMSC USB3320 ULPI transceiver.
ULPI integrity check: passed.
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-i2c e0004000.i2c: 400 kHz mmio e0004000 irq 140
cdns-i2c e0005000.i2c: 400 kHz mmio e0005000 irq 141
i2c i2c-1: Added multiplexed i2c bus 2
i2c i2c-1: Added multiplexed i2c bus 3
i2c i2c-1: Added multiplexed i2c bus 4
i2c i2c-1: Added multiplexed i2c bus 5
pca954x 1-0070: registered 4 multiplexed busses for I2C mux pca9544
EDAC MC: ECC not enabled
Xilinx Zynq CpuIdle Driver started
sdhci: Secure Digital Host Controller Interface driver
sdhci: Copyright(c) Pierre Ossman
sdhci-pltfm: SDHCI platform and OF driver helper
mmc0: SDHCI controller on e0101000.sdhci [e0101000.sdhci] using DMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
NET: Registered protocol family 10
sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
NET: Registered protocol family 29
can: raw protocol (rev 20120528)
can: broadcast manager protocol (rev 20161123 t)
can: netlink gateway (rev 20130117) max_hops=1
Registering SWP/SWPB emulation handler
hctosys: unable to open rtc device (rtc0)
of_cfs_init
of_cfs_init: OK
ALSA device list:
  No soundcards found.
Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address 4f4c
mmcblk0: mmc0:4f4c SD08G 7.42 GiB
mmcblk0: p1 p2
usb 1-1: new high-speed USB device number 2 using ci_hdrc
FAT-fs (mmcblk0p2): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
VFS: Mounted root (vfat filesystem) on device 179:2.
devtmpfs: error mounting -2
Freeing unused kernel memory: 1024K (c0900000 - c0a00000)
Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.
CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-xilinx-v2017.2 #1
Hardware name: Xilinx Zynq Platform
[<c010e244>] (unwind_backtrace) from [<c010a4a4>] (show_stack+0x10/0x14)
[<c010a4a4>] (show_stack) from [<c02dc2b0>] (dump_stack+0x80/0x9c)
[<c02dc2b0>] (dump_stack) from [<c010c9f8>] (ipi_cpu_stop+0x3c/0x70)
[<c010c9f8>] (ipi_cpu_stop) from [<c010d210>] (handle_IPI+0x64/0x84)
[<c010d210>] (handle_IPI) from [<c0101420>] (gic_handle_irq+0x78/0x94)
[<c0101420>] (gic_handle_irq) from [<c010ae8c>] (__irq_svc+0x6c/0xa8)
Exception stack(0xc0a01f38 to 0xc0a01f80)
1f20:                                                       00000000 00000000
1f40: 1ed8a000 df6cb9c0 49880b08 00000000 df6cae40 00000000 4974e26e 00000000
1f60: 00000000 00000000 0000000b c0a01f88 c04afc90 c04afcb4 600f0013 ffffffff
[<c010ae8c>] (__irq_svc) from [<c04afcb4>] (cpuidle_enter_state+0xe4/0x1b0)
[<c04afcb4>] (cpuidle_enter_state) from [<c014c834>] (cpu_startup_entry+0x17c/0x19c)
[<c014c834>] (cpu_startup_entry) from [<c0900bb4>] (start_kernel+0x2f8/0x358)
---[ end Kernel panic - not syncing: No working init found.  Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.

Oleksandr Kiyenko

Hello,

at first look, there is hard to say what exactly wrong with your system
Please at first try to build example without changes and check that your petalinux installation
- have enough disk space
- have access to the internet

Best regards
Oleksandr Kiyenko

mage

Thanks for your reply.
I could confirm that the Petalinux was installed well, as I coulud complie petalinux and run sucessfully on Zedboard.

JH

Hi,
we add source code and petalinux template on the project delivery. Did you try out to generate all our sources without additional changes?

So can you try following:
br
John

mage

1. I have created Vivado project without changes and export HDF files --> do not change design.
2. I have also tried to create Petalinux project with the template, but problem occured due to the Petalinux version mismatched. There are only Petalinux project template 2017.1 on the Trenz official web, while my Petalinux is 2017.2


JH

Hi,
you should never use different versions of Vivado and Petalinux.

Maybe this is your problem. Use all 17.1. If petalinux has problem with project update, than different hdf versions can be also be a problem.

When you use our template did you run the init_config.sh before you start HDF import and build process?

Or try to update Vivado project to 2017.2 and after that try to create 2017.2 petalinux project and use settings from template step by step. With next update, we will add wiki documentation with and add changes but at the moment you must check template files for this.

br
John


mage

Hi, may be you misunderstood my mean. I never use different vesion of Vivado and Petalinux.
I updated Vivado project to 2017.2.
As my Petalinux version is 2017.2, so I can not use the Petalinux 2017.1 template directly.
How to create 2017.2 petalinux project use settings from template step by step?
Are there any documentation or guide?

JH

Did you use our FSBL template? Frame buffer settings are done there:

       
  • zynqberrydemo2\sw_lib\sw_apps\zynq_fsbl\src\fsbl_hooks.c
At the moment we have only:Wiki description like here is planned for all reference design, but this will be done step by step:We starts with the demo design when all boards has one basic design with wiki documentation.


Best regards
John