之前文章介紹了如何下載并從SD卡加載文件系統,提到過可以從EMMC引導系統,本篇將為您介紹如何把文件系統燒到EMMC,并從EMMC加載。
接之前操作,系統已經從SD卡正常啟動(本文方案需要借助SD卡):
Version: 3.0.3
smarc-rzg2l login: root
Last login: Sun Sep 20 1003 UTC 2020
root@smarc-rzg2l:~#
已經可以接上網線,并借助網路(如ssh服務)把相關文件拷貝到SD卡,為后邊做準備。
需要的文件如下:
root@smarc-rzg2l:~# ls
Image-r9a07g044l2-smarc.dtb Image-smarc-rzg2l.bin core-image-qt-smarc-rzg2l.tar.bz2
EMMC創建分區:
左右滑動查看完整內容
root@smarc-rzg2l:~# fdisk /dev/mmcblk0 Welcome to fdisk (util-linux 2.35.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): o Created a new DOS disklabel with disk identifier 0xf23e9318. Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): (Push the enter key) Using default response p. Partition number (1-4, default 1): (Push the enter key) First sector (2048-124321791, default 2048): (Push the enter key) Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-124321791, default 124321791): +500M Created a new partition 1 of type 'Linux' and of size 500 MiB. Command (m for help): n Partition type p primary (1 primary, 0 extended, 3 free) e extended (container for logical partitions) Select (default p): (Push the enter key) Using default response p. Partition number (2-4, default 2): (Push the enter key) First sector (1026048-124321791, default 1026048): (Push the enter key) Last sector, +/-sectors or +/-size{K,M,G,T,P} (1026048-124321791, default 124321791): (Push the enter key) Created a new partition 2 of type 'Linux' and of size 58.8 GiB. Command (m for help): p Disk /dev/mmcblk0: 59.29 GiB, 63652757504 bytes, 124321792 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xf23e9318 Device Boot Start End Sectors Size Id Type /dev/mmcblk0p1 2048 1026047 1024000 500M 83 Linux /dev/mmcblk0p2 1026048 124321791 123295744 58.8G 83 Linux Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. root@smarc-rzg2l:~#
格式化EMMC:
左右滑動查看完整內容
root@smarc-rzg2l:~# mkfs.ext4 /dev/mmcblk0p1 mke2fs 1.45.7 (28-Jan-2021) Discarding device blocks: done Creating filesystem with 512000 1k blocks and 128016 inodes Filesystem UUID: cd3a51a9-ef38-4399-888e-9773fcc41ecc Superblock backups stored on blocks: 8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409 Allocating group tables: done Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done root@smarc-rzg2l:~# mkfs.ext4 /dev/mmcblk0p2 mke2fs 1.45.7 (28-Jan-2021) Discarding device blocks: done Creating filesystem with 15411968 4k blocks and 3858432 inodes Filesystem UUID: 07d98391-d70c-4eed-a3af-4227a7460a32 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424 Allocating group tables: done Writing inode tables: done Creating journal (65536 blocks): done Writing superblocks and filesystem accounting information: done root@smarc-rzg2l:~#
掛載EMMC,拷貝內核、設備樹、文件系統:
左右滑動查看完整內容
root@smarc-rzg2l:~# mount /dev/mmcblk0p1 /mnt/ root@smarc-rzg2l:~# cp Image-smarc-rzg2l.bin /mnt/ root@smarc-rzg2l:~# cp Image-r9a07g044l2-smarc.dtb /mnt/ root@smarc-rzg2l:~# umount /dev/mmcblk0p1 root@smarc-rzg2l:~# mount /dev/mmcblk0p2 /mnt/ root@smarc-rzg2l:~# tar xf core-image-qt-smarc-rzg2l.tar.bz2 -C /mnt/ root@smarc-rzg2l:~# umount /dev/mmcblk0p2
關機,設置開發板SW11/SW1撥碼開關模式:
重啟開發板,設置環境變量:
左右滑動查看完整內容
NOTICE: BL2: v2.7(release):203c783-dirty NOTICE: BL2: Built : 06:57:02, Nov 10 2022 NOTICE: BL2: eMMC boot from partition 1 NOTICE: BL2: Load dst=0x1f840 src=(p:1)0x20000(256) len=0x10(1) NOTICE: BL2: eMMC boot from partition 1 NOTICE: BL2: Load dst=0x1f9a0 src=(p:1)0x20010(256) len=0x28(1) NOTICE: BL2: eMMC boot from partition 1 NOTICE: BL2: Load dst=0x44000000 src=(p:1)0x20090(256) len=0x6069(49) NOTICE: BL2: eMMC boot from partition 1 NOTICE: BL2: Load dst=0x1f840 src=(p:1)0x20000(256) len=0x10(1) NOTICE: BL2: eMMC boot from partition 1 NOTICE: BL2: Load dst=0x1f9a0 src=(p:1)0x20010(256) len=0x28(1) NOTICE: BL2: Load dst=0x1f9a0 src=(p:1)0x20038(256) len=0x28(1) NOTICE: BL2: eMMC boot from partition 1 NOTICE: BL2: Load dst=0x50000000 src=(p:1)0x26100(304) len=0xb0238(1410) NOTICE: BL2: Booting BL31 NOTICE: BL31: v2.7(release):203c783-dirty NOTICE: BL31: Built : 06:57:02, Nov 10 2022 U-Boot 2021.10 (Mar 15 2023 - 07:34:17 +0000) CPU: Renesas Electronics K rev 2.1 Model: smarc-rzg2l DRAM: 1.9 GiB WDT: watchdog@0000000012800800 WDT: Started with servicing (60s timeout) MMC: sd@11c00000: 0, sd@11c10000: 1 Loading Environment from MMC... OK In: serial@1004b800 Out: serial@1004b800 Err: serial@1004b800 U-boot WDT started! Net: Error: ethernet@11c20000 address not set. No ethernet found. Hit any key to stop autoboot: 0 Hit any key to stop autoboot: 0 => env default -a ## Resetting to default environment => setenv bootargs 'root=/dev/mmcblk0p2 rootwait' => setenv bootcmd 'mmc dev 1; ext4load mmc 0:1 0x48080000 Image-smarc-rzg2l.bin; ext4load mmc 0:1 0x48000000 Image-r9a07g044l2-smarc.dtb; booti 0x48080000 - 0x48000000' => saveenv Saving Environment to MMC... Writing to MMC(0)... OK
重啟開發板,從emmc成功加載:
BSP: RZG2L/RZG2L-SMARC-EVK/3.0.3 LSI: RZG2L Version: 3.0.3 smarc-rzg2l login: root Last login: Mon Sep 18 02:29:32 UTC 2023 root@smarc-rzg2l:~# df -h Filesystem Size Used Avail Use% Mounted on /dev/root 58G 1.2G 54G 3% / devtmpfs 740M 0 740M 0% /dev tmpfs 933M 0 933M 0% /dev/shm tmpfs 933M 9.7M 924M 2% /run tmpfs 933M 0 933M 0% /sys/fs/cgroup tmpfs 933M 0 933M 0% /tmp tmpfs 933M 28K 933M 1% /var/volatile tmpfs 187M 0 187M 0% /run/user/0 root@smarc-rzg2l:~#
審核編輯:湯梓紅
-
SD卡
+關注
關注
2文章
565瀏覽量
63902 -
文件系統
+關注
關注
0文章
284瀏覽量
19911 -
開發板
+關注
關注
25文章
5050瀏覽量
97471 -
emmc
+關注
關注
7文章
216瀏覽量
52743
原文標題:RZ/G2L開發板EMMC啟動
文章出處:【微信號:瑞薩MCU小百科,微信公眾號:瑞薩MCU小百科】歡迎添加關注!文章轉載請注明出處。
發布評論請先 登錄
相關推薦
評論