본문 바로가기
카테고리 없음

Petalinux

by YJHTPII 2023. 1. 10.
반응형

https://slayernoone.tistory.com/entry/20163-%EC%84%A4%EC%B9%98

 

petalinux 정리

1. petalinux 확인shlee@xilinxdev:~$ echo $PETALINUX/opt/petalinuxshlee@xilinxdev:~$ 2.프로젝트 생성shlee@xilinxdev:~$ petalinux-create -t project -s /opt/petalinux/Xilinx-ZC706-v2016.3-final.bsp INFO: Create project: INFO: Projects: INFO: * Xilinx-

slayernoone.tistory.com

 

 

1. petalinux 확인
shlee@xilinxdev:~$ echo $PETALINUX
/opt/petalinux
shlee@xilinxdev:~$ 
 
 
2.프로젝트 생성
shlee@xilinxdev:~$ petalinux-create -t project -s /opt/petalinux/Xilinx-ZC706-v2016.3-final.bsp 
INFO: Create project: 
INFO: Projects: 
INFO:   * Xilinx-ZC706-2016.3
INFO: has been successfully installed to /home/shlee/
INFO: New project successfully created in /home/shlee/
 
 
 
3. 전체 빌드
shlee@xilinxdev:~/Xilinx-ZC706-2016.3$ petalinux-build
INFO: Checking component...
INFO: Generating make files and build linux
INFO: Generating make files for the subcomponents of linux
...
...
 
 
4. 커널 빌드
shlee@xilinxdev:~/Xilinx-ZC706-2016.3$ petalinux-build -c kernel
INFO: Checking component...
INFO: Generating make files and build linux/kernel
INFO: Generating make files for the subcomponents of linux/kernel
INFO: Building linux/kernel
[INFO ] build linux/kernel
...
 
shlee@xilinxdev:~/Xilinx-ZC706-2016.3$ petalinux-build -x package
INFO: Checking component...
INFO: Generating make files and build linux
INFO: Generating make files for the subcomponents of linux
INFO: Building linux
[INFO ] package rootfs.cpio to /home/shlee/Xilinx-ZC706-2016.3/images/linux
[INFO ] Update and install vmlinux image
...
 
 
5. 모듈 추가
shlee@xilinxdev:~/Xilinx-ZC706-2016.3$ petalinux-create -t modules --name axi-gpio --enable 
 
~/Xilinx-ZC706-2016.3/components/modules/axi-gpio가 생성되어있음
 
모듈 컴파일
shlee@xilinxdev:~/Xilinx-ZC706-2016.3$ petalinux-build -c rootfs/axi-gpio -x install
 
 
6.  패키지 생성
shlee@xilinxdev:~/Xilinx-ZC706-2016.3$ petalinux-build -x package
 
 
7. image.ub 생성
shlee@xilinxdev:~/Xilinx-ZC706-2016.3$ petalinux-package --image
 
 
8. scp 파일전송
scp axi-gpio.ko root@192.168.0.52:/home/root 
 
 

9. u-boot 빌드

$ petalinux-build -c u-boot

 

 

10. u-boot 패키지 (BOOT.BIN 만들기)

$ petalinux-package --boot --fsbl pre-built/linux/images/zynq_fsbl.elf --fpga pre-built/linux/implementation/download.bit --uboot --force -o images/linux/BOOT.BIN

 

 

11. u-boot에서 BOOT.BIN QSPI에 Writing 하기

U-Boot-PetaLinux> setenv ipaddr 192.168.0.125;setenv serverip 192.168.0.43; tftpboot 0x1000000 BOOT.BIN;sf probe 0 0 0;sf erase 0x0 0x1000000;sf write 0x1000000 0x0 0xffffff;reset

 
 

12. u-boot에서 네트웍으로 리눅스 부팅

U-Boot-PetaLinux> setenv ipaddr 192.168.0.125;setenv serverip 192.168.0.43;tftpboot 0x8000000 image.ub;bootm 0x8000000

 

 

13. u-boot에 I2C 추가

 

~/build/Xilinx-ZC706-2016.3/subsystems/linux/configs/u-boot/platform-auto.h 파일

 

#define CONFIG_SYS_I2C_ZYNQ

 

/* I2C */

#if defined(CONFIG_SYS_I2C_ZYNQ)

 

# define CONFIG_ZYNQ_I2C0

# define CONFIG_SYS_I2C

# define CONFIG_CMD_I2C

# define CONFIG_SYS_I2C_ZYNQ_SPEED              100000

# define CONFIG_SYS_I2C_ZYNQ_SLAVE              0

#endif

 

 

14. u-boot 에 새로운 fsbl 적용하기

 

#!/bin/bash

petalinux-build -c u-boot

petalinux-package --boot --fsbl /home/shlee/shlee_zc706/shlee_zc706.sdk/shlee_zc706_fsbl/Debug/shlee_zc706_fsbl.elf --fpga /home/shlee/shlee_zc706/shlee_zc706.runs/impl_1/designz_main_wrapper.bit --uboot --force -o images/linux/BOOT.BIN

 

반응형

댓글