I have the AVNET ZUBoard working with PYNQ and eMMC:
- to boot from and run on AVNET eMMC module
- also using the axi_intc component and an INT signal in FPGA a overlay - works now
Enable eMMC in ZUBoard PYNQ image
The official ZUBoard PYNQ image, download via:
https://www.pynq.io/boards.html
does NOT support SD0 (as mmc1, mmcblk1), needed for eMMC!
You have to checkout the ZUBoard PYNQ GitHub project and build a MODIFIED version (on Linux):
https://github.com/Avnet/ZUBoard_1CG-PYNQ
Remark: do not forget to install the BDF files for the ZUBoard after installing Vivado (not mentioned there as a mandatory step to do)
Steps to do
- setup a Linux system (or Ubuntu VM on Windows) as required:
go really with the right/mentioned Vivado, Petalinux tool and Linux versions (otherwise the build process is broken or must be modified)
Remark:
it can take up to TWO DAYS just to setup a VM, the tools, the Git repositories and to build the original PYNQ image!
BTW:
I could not generate the custom overlay: it results in errors to generate the "ZUBoard_1CGOverlay":
- I assume, the BDF files are not matching, they do not find some user I/O pins:
- you can comment this step in the "buildzu.sh" script (the overlay is not really needed for booting)
- forget the generated image: it will not work for eMMC, anyway - check if all is correct by building the "original" ZUBoard PYNQ image (and test it) - before we modify the build source
- Download the latest ZUBoard BSP, a link can be found here:
https://www.hackster.io/tom-curran/zuboard-boot-linux-from-emmc-5d9447 - Now: add a device tree node in file:
~/ZUBoard_1CG-PYNQ/ZUBoard_1CG/petalinux_bsp/meta-user/recipes-bsp/device-tree/files/system-user.dtsi
Add the node and aliases for mmc0, mmc1 and node sdhci0.
Remark: SD0 is for eMMC (8bit interface, it appears as mmcblk1), SD1 is SD Card (default, as mmcblk0) - If you would compile now - and it goes well:
it is not yet enough!
During boot it will complain with something about:
mmc1 cannot be connected to PM manager domain, domain9, error -13
Reason:
The BSP file used during build as "zuboard_1cg.bsp" is too old and does not have anything for SD0:
check the file psu_init.c as different versions of the BSP files and you will see:
- original BSP does not enable anything for SD0 (needed for eMMC, sdhci0)
- newer BSP (e.g. used for the Petalinux projects to demo eMMC) has much more config for SD0 (power, SD0 itself, MDIO_PINs...) - Change to the newer BSP:
modify script buildzu.sh (and ZUBoard_1CG.spec) to use the newer BSP - Potentially, you have to patch also some other directories to use the newer psu_init.c - and other files! - in other
directories where these files are used (e.g. .../petalinux_project/project-spec/hw-description/) - build the PYNQ again with buildzu.sh:
hope it will go through and generate a new ZUBoard_1CG-3.0.1.img - flash this image to a SD card (16GB or larger!), e.g. via Etcher (on Windows, dd on Linux)
- Boot it, test it...:
it should now see the eMMC (when it is connected), as mmcblk1 (SD card is mmcblk0)
OK, almost done... Now you have a ZUBoard PYNQ image which runs on/from SD card but sees also the (optional) eMMC module (if connected).
You might think: "OK, let me image eMMC with the same one".
Technically yes, but:
- you have to modify the bootargs when booting such an (identical) image from eMMC (otherwise it does not work).
- see at the end how to set the bootargs for booting and running from eMMC.
Flash my image for ZUBoard PYNQ with eMMC
If you want to save time (instead to setup, build, modify, rebuild... the ZUBoard PYNQ image - it is "painful", very time consuming...,
a new build after all installed properly takes still 2..3 hours!),
you can try to download and flash my generated, modified ZUBoard PYNQ image with eMMC support:
http://www.tjaekel.com/ZUBoard_1CG_emmc.zip
ATT: there is a virus warning! (no idea why)
Now:
- unzip the file so that you get the "ZUBoard_1CG_emmc.img"
- flash this to a SD card (16GB)
- boot this image, and check if you see also mmcblk1
- if so, now you can image the eMMC module:
- copy the file "ZUBoard_1CG_emmc.img" to your SD card (so that you have it as a separate file)
- if mmcblk1 partitions are there and mounted: unmount (they are potentially not mounted on an unformatted eMMC module)
- flash this copied file "ZUBoard_1CG_emmc.img" to the eMMC module (which is mmcblk1)
- afterwards, you might want to resize/enlarge the file system (it will flash eMMC so that it has just 9GB of user space, instead of approx. 29GB usable)
Change the BOOT switches (to eMMC: ON - OFF - OFF - ON), boot from eMMC now, but hit immediately any key on UART to interrupt to boot process!
You have to modify the bootargs!
- we have to tell the bootloader that it also should mount and use the rootfs from eMMC (mmcblk1p2)
- So, we have to set the u-boot bootargs.
If u-boot has paused, change the bootargs:
setenv bootargs "console=ttyPS0,115200 earlycon clk_ignore_unused uio_pdrv_generic.of_id=generic-uio root=/dev/mmcblk1p2 rw rootwait cma=512M"
saveenv
boot
Now, watch the boot (from mmc0): it should end up in a similar boot log (dmesg), ending up on the PYNQ user command line.
Check via:
lsblk
if you see now that mmcblk0 (the SD card) and mmcblk1 (eMMC) are there, potentially already mounted.
Even if not mounted - try to mount one or the other and check if you can see the files on it.
Now, you should be fine to use eMMC (running from it, having user space on it, e.g. for your Python scripts, overlays, SD card
now available as optional memory storage...).
BTW:
In the bootargs the option "uio_pdrv_generic.of_id=generic-uio" is important.
If you forget to add this:
- you cannot use axi_intc, interrupt signals in your custom overlay (but an y overlay without interrupts and w/o axi_intc should be fine)
- it will complain with "missing UIO", "I/O error interrupt 121" etc,
So, even flashing the same image working for SD card needs a different and correct bootargs for the u-boot!
Next to enable
So, my eMMC works now on ZUBoard PYNQ with eMMC module.
The next step would be to add - in a similar way - also the SSD/M.2 module, with the 256GB memory module on it.
I hope, in the BSP (and psu_init.c) is already the support for it, just the device-tree nodes missing and to add.
Please, add eMMC and SSD/M.2 to ZUBoard PYNQ image
(build an image for official download with eMMC)
It would be great, if anybody, AVNET, AVNET-TRIA, ... could update the AVNET GitHub for PYNQ image build and
publish an updated PYNQ image file for this ZUBoard.
It would be great, if ZUBoard PYNQ image supports directly the (optional) eMMC and SSD/M.2 modules
(without a need to modify and build the PYNQ GitHub).
Thank you.