[Petalinux] Petalinux Basic

wedo soluton Petalinux 교육 내용 요약 1st

Petalinux Basic

petalinux 정의

기본 명령어 및 Design Flow

상세 내용은 교제의 Petalinux Tool : Design FlowLAB2 참조

  1. 프로젝트 생성

    • petalinux-create -t {type} -n {name} –template {기초 템플릿}
    1
    
    petalinux-create -t project -n test_prj --template zynqMP
    
  2. 프로젝트 설정 : Hardware Description 및 boot, rootfs, kernel

    • petalinux-config 또는 petalinux-config -c {rootfs/kernel/device-tree/u-boot}
    1
    2
    
    cd test_prj
    petalinux-config --get-hw-description={xsa file} --silentconfig
    
  3. 프로젝트 빌드

    • petalinux-build 또는 petalinux-build -c {rootfs/kernel/device-tree/u-boot}
    • 생성되는 파일은 하기와 같다
      • boot.scr: A u-boot boot script
      • image.ub: U-boot wrapped Linux kernel image
      • rootfs.tar.gz: Compressed root file system tar ball
      • 그외 Pakage를 위한 파일
    1
    
    petalinux-build
    
  4. 프로젝트 패키징

    • .BIN 또는 .MCS 생성 ( = fsbl + ssbl + pmu + bitstream)
    • .BIN 은 다음과 내용을 포함한다.
    • Platform Loader and Manager (PLM)
    • PS Management (PSM) firmware
    • Platform Device Image (PDI)
    • ARM trusted firmware
    • u-boot
    • Device tree blob
    1
    
    petalinux-package --boot --fsbl zynqmp_fsbl.elf --u-boot u-boot.elf --pmufw pmufw.elf --fpga system.bit
    
  5. 부트

    • SD카드에 이미지 복사(BOOT.BIN, Image, rootfs.cpio.gz.u-boot, boot.scr) 후 보드 부팅
    • qemu로 에뮬레이션 가능
    1
    
    petalinux-boot --qemu --kernel
    
    • TFTP를 위한 Jtag 부트
    1
    
    petalinux-boot --jtag --prebuilt 2 --hw_server-url tcp:127.0.0.1:3121
    

Application development

상세 내용은 교제의 p133 Petalinux Application DevelopmentLAB3 참조

  1. Petalinux의 project가 생성된 상태에서 petalinux-create를 사용하여 app을 생성

    • project-spec/meta-user/recipes-apps/{app_name}에서 생성된 파일(bb 및 source) 확인 가능
    1
    
    petalinux-create -t apps --name helloworld --template c
    
  2. source 및 makefile을 생성 또는 복사한다.

    • project-spec/meta-user/recipes-apps/{app_name}/file에서 수정한다.
  3. Yocto Recipe file를 수정한다.

    • project-spec/meta-user/recipes-apps/{app_name}{app_name}.bb파일에 관련파일을 등록한다.
  4. root filesystem에 등록한다.

    • petalinux-config -c rootfs 수행 후 apps 메뉴에서 등록
  5. build 후 /usr/bin에서 app을 확인 가능하다.

프로젝트 설정

상세 내용은 교제의 p150 Customizing the project 참조 petalinux-config를 이용하여 하기 설정이 가능하다

  1. firmware version 정보
  2. root filesystem 종류 : INITRD, INITRAMFS JFFS2, UBI/UBIFS, NFS, EXT4(SD/eMMC…)
  3. U-boot 이미지 저장 위치 : bootenv 조절을 통해 Jtag/DDR, QSPI, NAND의 image offset을 조정할 수 있다.
  4. Primary Flash(QSPI?)의 파티션 조절 가능
  5. File system package를 조절하여 Kernel image size 및 Root file system 이미지 사이즈를 줄일 수 있다.
  6. TFTP 부팅을 위한 pre-built 이미지 위치를 설정할 수 있다
  7. NFS 또는 SD card를 통한 Root file system 로딩을 설정 할 수 있다.

Root file system customize

상세 내용은 교제의 p212 Customizing the Root File System 참조

  1. custom applications, libraries, module을 추가하거나 생성 가능
  2. pre-compiled applications, libraries, module을 추가하거나 생성 가능
  3. YOCTO layer, recipes 또는 package 추가 가능
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy