테스트 환경
- Ubuntu 18.04
- AM62A-SK
- 08_06_00_45 Processor SDK
DFU 모드를 구성하기 위해 부팅 스위치를 구성
부팅 스위치를 설정하려면 아래 이미지 확인
DRD(2.0) USB-C 포트를 통해 보드에 전원이 공급되면 USB 장치로 확인이 가능하다.
[ 7950.884467] usb 1-6.1: new high-speed USB device number 54 using xhci_hcd
[ 7950.989172] usb 1-6.1: New USB device found, idVendor=0451, idProduct=6165, bcdDevice= 2.00
[ 7950.989173] usb 1-6.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7950.989174] usb 1-6.1: Product: AM62a DFU
[ 7950.989175] usb 1-6.1: Manufacturer: Texas Instruments, Inc.
[ 7950.989175] usb 1-6.1: SerialNumber: 01.00.00.00
그 외에도 dfu-util을 사용하여 검색할 수 있습니다 .
*dfu-util이 설치되어 있지 않다면 아래 명령어로 설치한다
sudo apt install dfu-util
$ sudo dfu-util -l
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
Found DFU: [0451:6165] ver=0200, devnum=55, cfg=1, intf=0, path="1-6.1", alt=1, name="SocId", serial="01.00.00.00"
Found DFU: [0451:6165] ver=0200, devnum=55, cfg=1, intf=0, path="1-6.1", alt=0, name="bootloader", serial="01.00.00.00"
dfu 작업을 진행하기 전 "am62x_evm_a53_defconfig" 대신에 "am62ax_evm_r5_usbdfu_defconfig" 구성 파일을 사용하여 부트로더 이미지를 빌드
Rules.make에서 다음 변경이 필요
UBOOT_MACHINE_R5=am62x_evm_r5_usbdfu_defconfig
이 후 u-boot 빌드를 진행
make u-boot
make sysfw-image
빌드 후 다음 명령을 사용하여 tiboot3.bin을 업로드
$ sudo dfu-util -R -a bootloader -D <path>tiboot3.bin
업로드 성공 시 다음 부팅 로그가 나오게 된다.
U-Boot SPL 2021.01-00001-g01ec1fd168-dirty (Feb 22 2024 - 12:16:14 +0900)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
am62a_init: board_init_f done
SPL initial stack usage: 13568 bytes
am62a_init: spl_boot_device: devstat = 0x53 bootmedia = 0xa bootindex = 0
Trying to boot from DFU
그 다음 tispl.bin 및 u-boot.img 파일을 업로드 진행
먼저 부트로더가 파일을 업로드할 수 있는 두 개의 새로운 섹션을 제공했는지 확인할 수 있다.
$ sudo dfu-util -l
dfu-util 0.9
Found DFU: [0451:6165] ver=0223, devnum=71, cfg=1, intf=0, path="1-6.1", alt=1, name="u-boot.img", serial="UNKNOWN"
Found DFU: [0451:6165] ver=0223, devnum=71, cfg=1, intf=0, path="1-6.1", alt=0, name="tispl.bin", serial="UNKNOWN"
아래 단계를 수행하여 파일을 업로드 진행
$ sudo dfu-util -R -a tispl.bin -D <path>/tispl.bin
$ sudo dfu-util -R -a u-boot.img -D <path>u-boot.img
이제 U-Boot가 시작된다.
U-Boot SPL 2021.01-00001-g01ec1fd168-dirty (Feb 22 2024 - 12:13:54 +0900)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
SPL initial stack usage: 13392 bytes
Trying to boot from DFU
################################################DOWNLOAD ... OK
Ctrl+C to exit ...
################################################DOWNLOAD ... OK
Ctrl+C to exit ...
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
Warning: Detected image signing certificate on GP device. Skipping certificate to prevent boot failure. This will fail if the image was also encrypted
am62a_init: spl_boot_device: devstat = 0x53 bootmedia = 0xa bootindex = 0
am62a_init: spl_boot_device: devstat = 0x53 bootmedia = 0xa bootindex = 0
init_env from device 10 not supported!
Starting ATF on ARM64 core...
NOTICE: BL31: v2.8(release):2023.05-51-gd133e0550e-dirty
NOTICE: BL31: Built : 10:45:24, Jul 11 2023
I/TC:
I/TC: OP-TEE version: 2023.05-51-gd133e0550e-dev (gcc version 11.4.0 (Buildroot 2023.05-51-gd133e0550e-dirty)) #1 Tue Jul 11 08:45:19 UTC 2023 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check <https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html>
I/TC: Primary CPU initializing
I/TC: SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
I/TC: HUK Initialized
I/TC: Primary CPU switching to normal world boot
NOTICE: BL31: v2.8(release):v2.8-226-g2fcd408bb3-dirty
NOTICE: BL31: Built : 11:09:43, Feb 27 2023
U-Boot SPL 2021.01-00001-g01ec1fd168-dirty (Feb 22 2024 - 12:16:01 +0900)
SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
am62a_init: board_init_f done
am62a_init: spl_boot_device: devstat = 0x53 bootmedia = 0xa bootindex = 0
Trying to boot from DFU
####DOWNLOAD ... OK
Ctrl+C to exit ...
U-Boot 2021.01-00001-g01ec1fd168-dirty (Feb 22 2024 - 12:16:01 +0900)
SoC: AM62AX SR1.0 HS-FS
Model: Texas Instruments AM62A7 SK
EEPROM not available at 0x50, trying to read at 0x51
Board: AM62A-SKEVM rev E3
DRAM: 4 GiB
MMC: mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from MMC... OK
In: serial@2800000
Out: serial@2800000
Err: serial@2800000
Net: eth0: ethernet@8000000port@1
Hit any key to stop autoboot: 0
MMC: no card present
SD/MMC found on device 1
MMC: no card present
MMC: no card present
MMC: no card present
MMC: no card present
MMC: no card present
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
No FDT memory address configured. Please configure
the FDT address via "fdt addr <address>" command.
Aborting!
Bad Linux ARM64 Image magic!
=>
eMMC 플래시에 파일을 업로드 하기 전 emmc 에 rootfs 를 넣기 위해서는 사용자 파티션을 먼저 ext4 파일 시스템으로 포맷한 다음 rootfs를 작성
U-Boot에서는 파티션을 ext4로 포맷이 불가능 하기 때문에 커널로 부팅하고 ext4로 포맷한 후 사용자 파티션에 rootfs를 써야 함
tisdk-base-image-am62xx-evm.tar.xz를 사용하여 <rootfs.ext4>를 준비
$ cd <path-ti-psdk>/filesystem
$ dd if=/dev/null of=tisdk-base.ext4 bs=1M seek=300
$ mkfs.ext4 -F tisdk-base.ext4
$ mkdir mnt_fs
$ sudo mount -t ext4 tisdk-base.ext4 mnt_fs
$ cd mnt_fs
$ sudo tar xvf ../tisdk-base-image-am62xx-evm.tar.xz
$ cd ..
$ sudo umount mnt_fs
eMMC 플래시에 파일을 업로드할 수 있도록 U-Boot를 구성
=> env set dfu_alt_info ${dfu_alt_info_emmc}
=> dfu 0 mmc 0
eMMC 장치는 일반적으로 파티션 테이블 없이 배송됩니다. 우리는 U-Boot의 GPT 지원을 활용하여 eMMC에 GPT 파티션 테이블을 작성합니다. 이 경우 호스트에서 uuidgen 프로그램을 사용하여 디스크와 각 파티션에 사용되는 UUID를 생성
$ uuidgen
...첫 번째 UUID...
$ uuidgen
...두 번째 UUID...
파티션 변수는 해당 변수의 존재에 의존하므로 uuid_gpt_disk 및 uuid_gpt_rootfs 변수를 설정
=> env set uuid_gpt_disk ...첫 번째 UUID...
=> env set uuid_gpt_rootf ...두 번째 UUID...
rootfs 파티션에 성공적으로 쓰려면 파티션 테이블이 필요
U-Boot 내에서 gpt 명령을 사용하여 수행 가능
그렇게 하려면 아래 명령어 실행
=> gpt write mmc 0 $partitions
파티션을 완전히 사용하려면 재부팅이 필요할 수 있습니다. 다음 명령을 실행하여 파티션을 확인할 수 있다.
=> gpt verify mmc 0 $partitions
Verify GPT: success!
다음 명령을 사용하여 파티션 테이블을 검사할 수도 있다.
=> mmc part
Partition Map for MMC device 0 -- Partition Type: EFI
Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00001000 0x03b47fde "rootfs"
attrs: 0x0000000000000000
type: ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
guid: d2100992-4658-47c2-b09c-682824ad4aee
이제 아래 명령어를 통해 U-Boot에서 DFU 모드를 활성화하고 dfu-util을 사용하여 필요한 모든 파일을 업로드할 수 있다.
=> env set dfu_alt_info ${dfu_alt_info_emmc}
=> dfu 0 mmc 0
$ sudo dfu-util -a tiboot3.bin.raw -D <path>/tiboot3/bin
$ sudo dfu-util -a tispl.bin.raw -D <path>/tispl.bin
$ sudo dfu-util -a u-boot.img.raw -D <path>/u-boot.img
$ sudo dfu-util -R -a rootfs -D <path>/rootfs.ext4
모든 파일을 성공적으로 업로드한 후 rootfs의 내용을 확인하여 rootfs가 채워졌는지 확인할 수 있다.
=> ls mmc 0
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 16384 lost+found
<SYM> 7 bin
<DIR> 4096 boot
<DIR> 4096 dev
...
마지막으로 eMMC에서 부팅하도록 U-Boot를 구성
=> env set mmcdev 0
=> env set bootpart 0
=> mmc partconf 0 1 1 1
=> mmc bootbus 0 2 0 0
=> saveenv
이제 부팅 명령을 실행할 수 있으며 U-Boot는 eMMC에서 Linux 커널을 로드하여 운영 체제를 시작하기 위해서는eMMC 부팅을 위해 아래와 같이 부팅 스위치를 구성해야 eMMC에서 보드를 시작할 수 있다.
참고 :
'TI > AM62A' 카테고리의 다른 글
[09] AM62A-SK ROBOTICS SDK (0) | 2024.03.21 |
---|---|
[09] AM62A - SDCard 이미지 만들기 (0) | 2024.03.01 |
[09] AM62A-SK Processor SDK Build (0) | 2024.03.01 |
[08] AM62A-SK Processor SDK Build (0) | 2024.02.15 |
[08] AM62A - SDCard 이미지 만들기 (0) | 2024.02.15 |