完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
本帖最后由 jackeyt 于 2018-10-17 23:31 编辑 本系列帖子是为试用Nano PC T4开发板的帖子连载篇,以下为目录:
前面提到,RK3399是一个性能比较强大的CPU,所以其他在程序开发过程中,也为我们提供了极大的便捷,下面就是脑洞大开的做法,使用RK3399给自己编译内核,代码,以及开发程序的过程。 一、首先,先来检查下编译工具链:
结果如下:
可以发现其实板子上的gcc就是对应于:aarch64-linux-gnu-gcc
二、编译RK3399 Linux内核 首先安装git工具等(我刷入的FriendlyDesktop里面已经有了):
接下来,下载友善提供的T4 3399的内核代码:
切换目录:
配置:
编译:
(简选)编译过程如下: root@NanoPC-T4:/home/pi/t4_develop/t4_kernel# make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- nanopi4-images -j12 CC crypto/crc32.mod.o CC crypto/cts.mod.o CC crypto/michael_mic.mod.o CC crypto/xor.mod.o CC crypto/xts.mod.o CC drivers/i2c/busses/i2c-cros-ec-tunnel.mod.o CC drivers/gpu/arm/mali400/mali/mali.mod.o CC drivers/input/keyboard/cros_ec_keyb.mod.o CC drivers/input/touchscreen/elants_i2c.mod.o CC drivers/input/mouse/cyapatp.mod.o CC drivers/input/touchscreen/atmel_mxt_ts.mod.o CC drivers/input/mouse/elan_i2c.mod.o CC drivers/input/touchscreen/u***touchscreen.mod.o CC drivers/mfd/cros_ec.mod.o CC drivers/mfd/cros_ec_spi.mod.o CC drivers/net/ppp/bsd_comp.mod.o CC drivers/net/ppp/ppp_async.mod.o CC drivers/net/ppp/ppp_deflate.mod.o CC drivers/net/ppp/ppp_mppe.mod.o CC drivers/net/ppp/ppp_synctty.mod.o CC drivers/net/ppp/pppoe.mod.o CC drivers/net/ppp/pppolac.mod.o CC drivers/net/ppp/pppopns.mod.o CC drivers/net/ppp/pppox.mod.o CC drivers/net/u***/r8152.mod.o CC drivers/net/u***/rtl8150.mod.o CC drivers/net/wireless/at76c50x-u***.mod.o CC drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.mod.o CC drivers/net/wireless/hostap/hostap.mod.o CC drivers/net/wireless/brcm80211/brcmutil/brcmutil.mod.o CC drivers/net/wireless/libertas_tf/libertas_tf.mod.o CC drivers/net/wireless/mediatek/mt7601u/mt7601u.mod.o CC drivers/net/wireless/mwifiex/mwifiex.mod.o CC drivers/net/wireless/mwifiex/mwifiex_sdio.mod.o CC drivers/net/wireless/p54/p54common.mod.o CC drivers/net/wireless/p54/p54u***.mod.o CC drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.mod.o CC drivers/net/wireless/rndis_wlan.mod.o CC drivers/net/wireless/rockchip_wlan/rtl8188eu/8188eu.mod.o CC drivers/net/wireless/rt2x00/rt2500u***.mod.o CC drivers/net/wireless/rt2x00/rt2800lib.mod.o CC drivers/net/wireless/rt2x00/rt2800u***.mod.o CC drivers/net/wireless/rt2x00/rt2x00lib.mod.o CC drivers/net/wireless/rt2x00/rt2x00u***.mod.o CC drivers/net/wireless/rt2x00/rt73u***.mod.o CC drivers/net/wireless/zd1201.mod.o CC drivers/net/wireless/zd1211rw/zd1211rw.mod.o CC fs/btrfs/btrfs.mod.o CC fs/cifs/cifs.mod.o CC fs/crypto/fscrypto.mod.o CC fs/f2fs/f2fs.mod.o CC fs/nfsd/nfsd.mod.o CC fs/ntfs/ntfs.mod.o CC fs/xfs/xfs.mod.o CC lib/raid6/raid6_pq.mod.o CC lib/zlib_deflate/zlib_deflate.mod.o CC net/sunrpc/auth_gss/rpcsec_gss_krb5.mod.o CC net/wireless/lib80211.mod.o CC net/wireless/lib80211_crypt_ccmp.mod.o CC net/wireless/lib80211_crypt_tkip.mod.o CC net/wireless/lib80211_crypt_wep.mod.o CC security/keys/encrypted-keys/encrypted-keys.mod.o CC sound/core/seq/snd-seq-midi-event.mod.o CC sound/core/seq/snd-seq-midi.mod.o CC sound/core/snd-hwdep.mod.o CC sound/core/snd-rawmidi.mod.o CC sound/soc/codecs/snd-soc-es8316.mod.o CC sound/soc/codecs/snd-soc-max98090.mod.o CC sound/soc/codecs/snd-soc-rk3308.mod.o CC sound/soc/codecs/snd-soc-rk3328.mod.o CC sound/soc/codecs/snd-soc-rk817.mod.o CC sound/soc/codecs/snd-soc-rt5616.mod.o CC sound/soc/rockchip/snd-soc-rockchip-max98090.mod.o CC sound/u***/6fire/snd-u***-6fire.mod.o CC sound/u***/caiaq/snd-u***-caiaq.mod.o CC sound/u***/hiface/snd-u***-hiface.mod.o CC sound/u***/misc/snd-ua101.mod.o CC sound/u***/snd-u***-audio.mod.o CC sound/u***/snd-u***midi-lib.mod.o LD [M] crypto/crc32.ko LD [M] crypto/cts.ko LD [M] crypto/michael_mic.ko LD [M] crypto/xts.ko LD [M] crypto/xor.ko LD [M] drivers/gpu/arm/mali400/mali/mali.ko LD [M] drivers/i2c/busses/i2c-cros-ec-tunnel.ko LD [M] drivers/input/keyboard/cros_ec_keyb.ko LD [M] drivers/input/mouse/elan_i2c.ko LD [M] drivers/input/mouse/cyapatp.ko LD [M] drivers/input/touchscreen/atmel_mxt_ts.ko LD [M] drivers/input/touchscreen/elants_i2c.ko LD [M] drivers/input/touchscreen/u***touchscreen.ko LD [M] drivers/mfd/cros_ec_spi.ko LD [M] drivers/mfd/cros_ec.ko LD [M] drivers/net/ppp/bsd_comp.ko LD [M] drivers/net/ppp/ppp_async.ko LD [M] drivers/net/ppp/ppp_deflate.ko LD [M] drivers/net/ppp/ppp_mppe.ko LD [M] drivers/net/ppp/ppp_synctty.ko LD [M] drivers/net/ppp/pppoe.ko LD [M] drivers/net/ppp/pppolac.ko LD [M] drivers/net/ppp/pppopns.ko LD [M] drivers/net/ppp/pppox.ko LD [M] drivers/net/u***/r8152.ko LD [M] drivers/net/u***/rtl8150.ko LD [M] drivers/net/wireless/at76c50x-u***.ko LD [M] drivers/net/wireless/brcm80211/brcmfmac/brcmfmac.ko LD [M] drivers/net/wireless/brcm80211/brcmutil/brcmutil.ko LD [M] drivers/net/wireless/hostap/hostap.ko LD [M] drivers/net/wireless/libertas_tf/libertas_tf.ko LD [M] drivers/net/wireless/mediatek/mt7601u/mt7601u.ko LD [M] drivers/net/wireless/mwifiex/mwifiex.ko LD [M] drivers/net/wireless/mwifiex/mwifiex_sdio.ko LD [M] drivers/net/wireless/p54/p54common.ko LD [M] drivers/net/wireless/p54/p54u***.ko LD [M] drivers/net/wireless/rndis_wlan.ko LD [M] drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.ko LD [M] drivers/net/wireless/rockchip_wlan/rtl8188eu/8188eu.ko LD [M] drivers/net/wireless/rt2x00/rt2500u***.ko LD [M] drivers/net/wireless/rt2x00/rt2800lib.ko LD [M] drivers/net/wireless/rt2x00/rt2800u***.ko LD [M] drivers/net/wireless/rt2x00/rt2x00lib.ko LD [M] drivers/net/wireless/rt2x00/rt2x00u***.ko LD [M] drivers/net/wireless/rt2x00/rt73u***.ko LD [M] drivers/net/wireless/zd1201.ko LD [M] drivers/net/wireless/zd1211rw/zd1211rw.ko LD [M] fs/btrfs/btrfs.ko LD [M] fs/cifs/cifs.ko LD [M] fs/crypto/fscrypto.ko LD [M] fs/nfsd/nfsd.ko LD [M] fs/f2fs/f2fs.ko LD [M] fs/ntfs/ntfs.ko LD [M] fs/xfs/xfs.ko LD [M] lib/zlib_deflate/zlib_deflate.ko LD [M] lib/raid6/raid6_pq.ko LD [M] net/sunrpc/auth_gss/rpcsec_gss_krb5.ko LD [M] net/wireless/lib80211.ko LD [M] net/wireless/lib80211_crypt_ccmp.ko LD [M] net/wireless/lib80211_crypt_tkip.ko LD [M] security/keys/encrypted-keys/encrypted-keys.ko LD [M] net/wireless/lib80211_crypt_wep.ko LD [M] sound/core/seq/snd-seq-midi-event.ko LD [M] sound/core/seq/snd-seq-midi.ko LD [M] sound/core/snd-hwdep.ko LD [M] sound/core/snd-rawmidi.ko LD [M] sound/soc/codecs/snd-soc-rk3308.ko LD [M] sound/soc/codecs/snd-soc-es8316.ko LD [M] sound/soc/codecs/snd-soc-max98090.ko LD [M] sound/soc/codecs/snd-soc-rk3328.ko LD [M] sound/soc/codecs/snd-soc-rk817.ko LD [M] sound/soc/codecs/snd-soc-rt5616.ko LD [M] sound/soc/rockchip/snd-soc-rockchip-max98090.ko LD [M] sound/u***/6fire/snd-u***-6fire.ko LD [M] sound/u***/caiaq/snd-u***-caiaq.ko LD [M] sound/u***/hiface/snd-u***-hiface.ko LD [M] sound/u***/snd-u***midi-lib.ko LD [M] sound/u***/misc/snd-ua101.ko LD [M] sound/u***/snd-u***-audio.ko Pack to resource.img successed! Image: resource.img (with rockchip/rk3399-nanopi4-rev*.dtb logo.bmp logo_kernel.bmp) is ready 从最后的输出语句里面可以看出,resource.img打包成功了,是由设备树、logo.bmp logo_kernel.bmp组成的,所以这个resource.img是接下来开发所必要的,因为我们修改的设备树等信息就是从这里面打包的。 二、点亮LED 2.1、硬件准备 首先,我们通过友善的WIKI 资料 ,确认有哪些可以 使用的你GPIO口,这里我们随便 取个IO口:GPIO1_A0(3V) 将该IO口接上,LED与一个限流电阻,串接到地。 其次,我们需要来编写 我们的设备 树节点。 我们可以参考板子运行的例子:
我们明白,设备树的语法 是一种十分自然,附合人类阅读习惯的一种语法,因此,我们可以 看到, 参考中的例子中的LED是接到了GPIO0 13,我们通过原理图可以发现:硬件上该LED是接到了:GPIO0_B5, 如下图所示: 那么,GPIO0_B5是如何转换成了GPIO0 13呢?我们可以 通过datasheet发现: B5对应为GPIO0组中的第13个位置 (从0开始编号)。 那么,对应于我们上面所选的:GPIO1_A0(3V) 那就对应为gpio1 0 那因此,我们的设备树节点可参考上面所说的,写成如下:
|
|
相关推荐
|
|
只有小组成员才能发言,加入小组>>
371个成员聚集在这个小组
加入小组NanoPi m3适合刷什么系统,刚接触玩,我刷了一个比较卡
5494 浏览 1 评论
7207 浏览 1 评论
4798 浏览 1 评论
【NanoPC-T4试用体验】4、手把手教你从单片机移植驱动到ARM Linux上
7786 浏览 1 评论
【NanoPC-T4试用体验】NanoPC-T4控制步进电机
24621 浏览 1 评论
NanoPi m3适合刷什么系统,刚接触玩,我刷了一个比较卡
5494浏览 1评论
455浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 00:10 , Processed in 0.692629 second(s), Total 72, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号