On Tue, Jun 20, 2017 at 8:49 AM, Nathan Rossi <[email protected]> wrote:
> On 21 June 2017 at 01:34, Rich Wilson <[email protected]> wrote: > > > > > > On Tue, Jun 20, 2017 at 6:27 AM, Nathan Rossi <[email protected]> > > wrote: > >> > >> On 20 June 2017 at 03:29, Rich Wilson <[email protected]> wrote: > >> > Thank you for your response, Nathan. > >> > Top posting is supposed to be bad. So scroll way down to the bottom! > >> > And I may have discovered a big hint, see the end of my response. > >> > > >> > On Sun, Jun 18, 2017 at 11:54 PM, Nathan Rossi < > [email protected]> > >> > wrote: > >> >> > >> >> On 19 June 2017 at 15:59, Rich Wilson <[email protected]> wrote: > >> >> > I have tried to follow the directions in meta-xilinx to build > >> >> > microzed-zynq7, and the results aren't booting (from micro-SD). > >> >> > Boot results: > >> >> > ===================================================== > >> >> > U-Boot SPL 2017.01 (Jun 17 2017 - 07:44:02) > >> >> > mmc boot > >> >> > Trying to boot from MMC1reading system.dtb > >> >> > spl_load_image_fat_os: error reading image system.dtb, err - -1 > >> >> > reading u-boot.img > >> >> > reading u-boot.img > >> >> > > >> >> > > >> >> > U-Boot 2017.01 (Jun 17 2017 - 07:44:02 -0700) > >> >> > > >> >> > Model: Zynq MicroZED Board > >> >> > Board: Xilinx Zynq > >> >> > DRAM: ECC disabled 1 GiB > >> >> > MMC: sdhci@e0100000: 0 > >> >> > SF: Detected s25fl128s_64k with page size 256 Bytes, erase size 64 > >> >> > KiB, > >> >> > total 1B > >> >> > *** Warning - bad CRC, using default environment > >> >> > > >> >> > In: serial@e0001000 > >> >> > Out: serial@e0001000 > >> >> > Err: serial@e0001000 > >> >> > Model: Zynq MicroZED Board > >> >> > Board: Xilinx Zynq > >> >> > Net: ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id > >> >> > > >> >> > Warning: ethernet@e000b000 (eth0) using random MAC address - > >> >> > 92:62:5b:ad:43:d0 > >> >> > eth0: ethernet@e000b000 > >> >> > ** Bad device size - mmc 0 ** > >> >> > Checking if uenvcmd is set ... > >> >> > Hit any key to stop autoboot: 0 > >> >> > Copying FIT from SD to RAM... > >> >> > ** Bad device size - mmc 0 ** > >> >> > >> >> Your issue appears to be here, for some reason U-Boot is failing to > >> >> access the SD card. Are you able to use the mmcinfo and fatls > commands > >> >> in U-Boot to list and or manually load the images from your SD card? > >> >> > >> >> If not then there might be an issue with the card or with how you > have > >> >> set up the partitions/etc. > >> >> > >> >> OE can generate an image with partition table/etc setup such that it > >> >> can be directly dd'd to the disk. To enable that up just add the > >> >> following to your local.conf: > >> >> > >> >> IMAGE_FSTYPES_append = " wic" > >> >> WKS_FILES = "sdimage-bootpart.wks" > >> >> > >> >> Re-run your image build and the output image will be > >> >> "core-image-minimal.wic". > >> >> > >> >> > Zynq> > >> >> > ==================================================== > >> >> > Bitbake: > >> >> > rw@linux-pbup:~/poky/build> bitbake core-image-minimal > >> >> > Parsing recipes: 100% |##########################################| > >> >> > Time: > >> >> > 0:00:33 > >> >> > Parsing of 871 .bb files complete (0 cached, 871 parsed). 1342 > >> >> > targets, > >> >> > 80 > >> >> > skipped, 0 masked, 0 errors. > >> >> > NOTE: Resolving any missing task queue dependencies > >> >> > > >> >> > Build Configuration: > >> >> > BB_VERSION = "1.34.0" > >> >> > BUILD_SYS = "x86_64-linux" > >> >> > NATIVELSBSTRING = "universal-4.8" > >> >> > TARGET_SYS = "arm-poky-linux-gnueabi" > >> >> > MACHINE = "microzed-zynq7" > >> >> > DISTRO = "poky" > >> >> > DISTRO_VERSION = "2.3" > >> >> > TUNE_FEATURES = "arm armv7a vfp thumb neon callconvention-hard > >> >> > cortexa9" > >> >> > TARGET_FPU = "hard" > >> >> > meta > >> >> > meta-poky > >> >> > meta-yocto-bsp = "pyro:f01b909a266498853e6b3f10e6b39f > 2d95148129" > >> >> > meta-xilinx = "pyro:2371ecf0a0ad37cb775d4c09e89a1e > 70ab8f347a" > >> >> > meta-webserver = "pyro:5e82995148a2844c6f483ae5ddd143 > 8d87ea9fb7" > >> >> > ==================================================== > >> >> > Contents of boot partition (and you can see where I copied the > files > >> >> > from): > >> >> > > >> >> > linux-pbup:/home/rw/poky/build/tmp/deploy/images/microzed-zynq7 # > ls > >> >> > /mnt > >> >> > boot.bin > microzed-zynq7.dtb > >> >> > uEnv.txt > >> >> > core-image-minimal-microzed-zynq7.cpio.gz.u-boot u-boot.img > >> >> > uImage > >> >> > ======================================================= > >> >> > contents of uEnv.txt, which seemed to be equivalent to the > directions > >> >> > (or > >> >> > do I need to replace the ${...} constructs? I don't think it's > >> >> > getting > >> >> > that > >> >> > far :) ) > >> >> > > >> >> > kernel_image=uImage > >> >> > devicetree_image=microzed-zynq7.dtb > >> >> > bootargs=console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait > >> >> > earlyprintk > >> >> > loadkernel=fatload mmc 0 ${kernel_load_address} ${kernel_image} > >> >> > loaddtb=fatload mmc 0 ${devicetree_load_address} > ${devicetree_image} > >> >> > bootkernel=run loadkernel && run loaddtb && bootm > >> >> > ${kernel_load_address} > >> >> > - > >> >> > ${devicetree_ > >> >> > load_address} > >> >> > uenvcmd=run bootkernel > >> >> > ============================================================== > >> >> > Potential screwup by me: When I first bitbaked, meta-xilinx was at > >> >> > the master branch. After checking out pyro, I rebaked, but > >> >> > it didn't do anything. I removed /build/tmp, and the bitbake > >> >> > was pretty fast. Same result. > >> >> > >> >> It looks like your build is fine, and pryo/master point at the same > >> >> commit at the moment so there should be no differences. Also no need > >> >> to modify the generated uEnv.txt. > >> >> > >> >> Regards, > >> >> Nathan > >> > > >> > > >> > I added the requested lines to local.conf and bitbaked. The first > time I > >> > tried this, > >> > it got stuck for over 10 minutes, guile do_compile IIRC, with over 99% > >> > user > >> > CPU time. That didn't seem right, so CTRL/C and tried again. Succeeded > >> > very quickly. Here's the evidence: > >> > > >> > Keyboard Interrupt, closing down... > >> > > >> > > >> > Second Keyboard Interrupt, stopping... > >> > > >> > Execution was interrupted, returning a non-zero exit code. > >> > NOTE: Sending SIGTERM to remaining 1 tasks > >> > Traceback (most recent call last): > >> > File "/home/rw/poky/bitbake/bin/bitbake", line 48, in <module> > >> > cookerdata.CookerConfiguration())) > >> > File "/home/rw/poky/bitbake/lib/bb/main.py", line 470, in > bitbake_main > >> > server_connection.terminate() > >> > File "/home/rw/poky/bitbake/lib/bb/server/process.py", line 231, in > >> > terminate > >> > self.procserver.join(0.1) > >> > File "/usr/lib64/python3.4/multiprocessing/process.py", line 121, > in > >> > join > >> > res = self._popen.wait(timeout) > >> > File "/usr/lib64/python3.4/multiprocessing/popen_fork.py", line > 51, in > >> > wait > >> > if not wait([self.sentinel], timeout): > >> > File "/usr/lib64/python3.4/multiprocessing/connection.py", line > 926, > >> > in > >> > wait > >> > ready = selector.select(timeout) > >> > File "/usr/lib64/python3.4/selectors.py", line 367, in select > >> > fd_event_list = self._poll.poll(timeout) > >> > KeyboardInterrupt > >> > > >> > > >> > And after the appropriate dd, here is the result: > >> > > >> > U-Boot SPL 2017.01 (Jun 19 2017 - 00:20:53) > >> > mmc boot > >> > Trying to boot from MMC1reading system.dtb > >> > spl_load_image_fat_os: error reading image system.dtb, err - -1 > >> > reading u-boot.img > >> > reading u-boot.img > >> > > >> > > >> > U-Boot 2017.01 (Jun 19 2017 - 00:20:53 -0700) > >> > > >> > Model: Zynq MicroZED Board > >> > Board: Xilinx Zynq > >> > DRAM: ECC disabled 1 GiB > >> > MMC: sdhci@e0100000: 0 > >> > SF: Detected s25fl128s_64k with page size 256 Bytes, erase size 64 > KiB, > >> > total 1B > >> > *** Warning - bad CRC, using default environment > >> > > >> > In: serial@e0001000 > >> > Out: serial@e0001000 > >> > Err: serial@e0001000 > >> > Model: Zynq MicroZED Board > >> > Board: Xilinx Zynq > >> > Net: ZYNQ GEM: e000b000, phyaddr 0, interface rgmii-id > >> > > >> > Warning: ethernet@e000b000 (eth0) using random MAC address - > >> > 92:62:5b:ad:43:d0 > >> > eth0: ethernet@e000b000 > >> > ** Bad device size - mmc 0 ** > >> > Checking if uenvcmd is set ... > >> > Hit any key to stop autoboot: 0 > >> > Copying FIT from SD to RAM... > >> > ** Bad device size - mmc 0 ** > >> > Zynq> mmcinfo > >> > Device: sdhci@e0100000 > >> > Manufacturer ID: 3 > >> > OEM: 5344 > >> > Name: SL16G > >> > Tran Speed: 50000000 > >> > Rd Block Len: 512 > >> > SD version 3.0 > >> > High Capacity: Yes > >> > Capacity: 14.8 GiB > >> > Bus Width: 4-bit > >> > Erase Group Size: 512 Bytes > >> > Zynq> fatls mmc 0 > >> > 69424 boot.bin > >> > 21929 microzed-zynq7.dtb > >> > 465013 u-boot.img > >> > 417 uenv.txt > >> > 3597520 uimage > >> > > >> > 5 file(s), 0 dir(s) > >> > > >> > Zynq> > >> > > >> > > >> > Now an interesting experiment. I typed three commands from > >> > uenvcmd=fatload mmc 0 0x3000000 ${kernel_image} && fatload mmc 0 > >> > 0x2A00000 > >> > ${devicetree_image} && bootm 0x3000000 - 0x2A00000 > >> > > >> > and the kernel took off. But couldn't find root, no surprise. > >> > > >> > AHA! This might be a big hint what is going on: > >> > (after a reboot) > >> > > >> > Zynq> fatls mmc 0 > >> > ** Bad device size - mmc 0 ** > >> > Zynq> mmcinfo > >> > Device: sdhci@e0100000 > >> > Manufacturer ID: 3 > >> > OEM: 5344 > >> > Name: SL16G > >> > Tran Speed: 50000000 > >> > Rd Block Len: 512 > >> > SD version 3.0 > >> > High Capacity: Yes > >> > Capacity: 14.8 GiB > >> > Bus Width: 4-bit > >> > Erase Group Size: 512 Bytes > >> > Zynq> fatls mmc 0 > >> > 69424 boot.bin > >> > 21929 microzed-zynq7.dtb > >> > 465013 u-boot.img > >> > 417 uenv.txt > >> > 3597520 uimage > >> > > >> > 5 file(s), 0 dir(s) > >> > > >> > Zynq> > >> > >> I was able to reproduce (on a Zybo) the "Bad device size" that is > >> printed first (which is when u-boot tries to process preboot). However > >> I needed to use a different/slower? card to make it happen. And I was > >> only able to reproduce it in u-boot v2017.01 and not v2017.05 (which > >> is in oe-core master). > >> > >> Would you be able to test u-boot v2017.05 and see if you can reproduce > it > >> there? > >> > >> > >> If you can still reproduce your issue there, the following patch might > >> be needed to force u-boot to rescan the mmc devices before attempting > >> to load the preboot config. The follow commit for meta-xilinx should > >> work for u-boot v2017.01 and v2017.05 (on pyro or master). > >> > >> > >> https://github.com/nathanrossi/meta-xilinx/commit/ > 20ae90016aaacec9569c1cb34a60552231fe733d > >> > >> You will probably also need this patch to get the autoboot working > >> properly, since mainline u-boot doesn't set all the variables used by > >> default. > >> > >> > >> https://github.com/nathanrossi/meta-xilinx/commit/ > 6472328917c240d1ad03561f038a6fe2de8bb382 > >> > >> Regards, > >> Nathan > > > > > > > > Can you give me a hint where I should look for instructions on how to do > > this? > > Or I could spend all day combing the documentation and trying various > > experiments :) > > > > (to demonstrate my confusion: Do I fiddle with > > meta-xilinx/recipes-bsp/u-boot? > > meta/recipes-bsp/u-boot? Or is there some magic I can do in local.conf? > or > > bblayers.conf?) > > (and if I need to apply the patch, ...? I would be tempted to just find > the > > file and > > edit it. But that's probably not correct.) > > To test u-boot 2017.05, just checkout master of poky and meta-xilinx, > and run the build. It is the default version of u-boot in master. > > For testing the changes mentioned for u-boot use this remote+branch of > meta-xilinx (https://github.com/nathanrossi/meta-xilinx/tree/nrossi/wip), > it has the two commits mentioned applied on top of master/pyro. You > can use this branch to test against pyro or master, and switch poky > between pyro/master to test the different versions of u-boot. > > The commits mentioned already have the patch and setup to apply to the > u-boot source, so no need to fiddle around getting that setup. > > You should only need to checkout different versions of the layers, > build and try booting them. > > Regards, > Nathan > Progress report: Switching to branch 'master' solved the first problem, it's now able to access mmc 0. The second problem was more tenacious. I pulled the link you gave me above, but it left me in branch nrossi/next, which didn't have the patches. After I got the right branch, bitbake did get the patch into uEnv.txt, but uEnv.txt didn't make it into the .wic file. Dependency failure? linux-pbup:/home/rw/poky/build/tmp/deploy/images/microzed-zynq7 # diff uEnv.txt /mnt/uEnv.txt 3d2 < kernel_load_address=0x2080000 5d3 < devicetree_load_address=0x2000000 linux-pbup:/home/rw/poky/build/tmp/deploy/images/microzed-zynq7 # cp uEnv.txt /mnt After the manual copy, I'm now booting! Thank you for your help, Nathan. -- Rich Wilson [email protected]
-- _______________________________________________ meta-xilinx mailing list [email protected] https://lists.yoctoproject.org/listinfo/meta-xilinx
