Code Monkey home page Code Monkey logo

petalinux-scripts's Introduction

PetaLinux Scripts

Xilinx Petalinux scripts for building, deploying, debugging etc..

PetaLinux Cheat-Sheet

This following cheat-sheet includes common commands used in PetaLinux based projects.

Installation

chmod 755 ./petalinux-v2022.2-final-installer.run
sudo chmod 755 ./petalinux-v2022.2-final-installer.run 
./petalinux-v2022.2-final-installer.run --dir ~/../petalinux/2022.2/
source ../../../../petalinux/2022.2/settings.sh

Packaging

petalinux-package --boot --u-boot ./images/linux/u-boot.elf
petalinux-package --boot --fsbl zynqmp_fsbl.elf  --pmufw pmufw.elf --atf bl31.elf --u-boot u-boot.elf

Configuration

petalinux-config --get-hw-description=/../zc102_demo_wrapper.xsa

Building

petalinux-build -x package
petalinux-build -c kernel

Cleaning

petalinux-build -x mrproper

Root File System Configuration

petalinux-config -c rootfs
petalinux-config -c uboot

Project Creation

petalinux-create -t project  -s ../xilinx-zcu102-v2022.2-10141622.bsp 

Writing Root File System to SD Card

dd bs=8192 status=progress  if=~/../rootfs.ext4  of=/dev/sdc2

Fix umount Errors

fsck /dev/sde2

Minicom Example

minicom  -D /dev/ttyUSBX -b 115200

Device Tree Decompilation into DTS

dtc -I dtb -O dts system.dtb -o /tmp/tmp.dts

Bootgen.bif Example

the_ROM_image:
{
	[bootloader, destination_cpu=a53-0] zynqmp_fsbl.elf
	[pmufw_image] pmufw.elf
	[destination_device=pl] pre-built/linux/implementation/download.bit
	[destination_cpu=a53-0, exception_level=el-3, trustzone] bl31.elf
	[destination_cpu=a53-0, load=0x00100000] system.dtb
	[destination_cpu=a53-0, exception_level=el-2] u-boot.elf
}

Debugging Kernel

petalinux-boot --jtag --u-boot --fpga --bitstream system.bit

Boot Kernel in U-Boot

> pxe get
> pxe boot

QSPI Flash Boot

Make sure the TFTP server is up and the images are located in /srv/tfpboot directory.

# Initialize SPI flash
sf probe 0 0 0

# Erase SPI flash (for a 128MiB flash size)
sf erase 0 0x8000000

# Write BOOT.BIN into Flash
tfpboot 0x80000 BOOT.BIN
sf write 0x80000 0x0 <0xfile_size>

# Write image.ub into Flash
tfpboot 0x80000 image.ub
sf write 0x80000 <0ximage_flash_address> <0xfile_size>

# Write boot.scr into Flash
tfpboot 0x80000 boot.scr
sf write 0x80000 <0xboot_scr_flash_address> <0xfile_size>

# Reset board in QSPI mode

Example for u-boot.txt

# Set environment variables
setenv bootargs console=ttyPS0,115200 earlyprintk root=/dev/mmcblk0p2 rw rootwait

# Load the image from QSPI flash into memory
sf probe 0; sf read ${loadaddr} 0x100000 0x800000

# Boot the image
bootm ${loadaddr}

How to Create a boot.scr File from the boot.txt

mkimage -C none -A arm -T script -d boot.txt boot.scr

petalinux-scripts's People

Contributors

bspguy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.