当前位置:网站首页>【NanoPi2试用体验】裸机第一步
【NanoPi2试用体验】裸机第一步
2022-06-23 08:58:00 【七月流星.】
前几天看了看4418的数据手册,现在准备开始裸机学习,友善的wiki自然是最好的选择吧,然而我就是弄不出,找了第三方的一篇微博,然后才迈出了第一步。
官方教程也非常简单,可是是我姿势不对,大家也可以看看
克隆Matrix配件代码仓库
$ git clone https://github.com/friendlyARM/matrix.git
编译测试程序
进入Matrix代码仓库,切换到nanopi2分支
$ cd matrix$ git checkout nanopi2编译Matrix配件代码
$ make CROSS_COMPILE=arm-linux- clean $ make CROSS_COMPILE=arm-linux- $ make CROSS_COMPILE=arm-linux- install注意:请确保你的主机PC当前使用的交叉编译器为NanoPi 2配套的arm-linux-gcc-4.9.3。
编译成功后库文件位于install/lib目录下,而测试程序则位于install/usr/bin目录下,模块Matrix-Button对应的测试程序为matrix-button。
运行测试程序
将带有Debian系统的SD卡插入一台运行Linux的电脑,可以挂载SD卡上的boot和rootfs分区。
假设rootfs分区的挂载路径为/media/rootfs,执行以下命令将Matrix的硬件驱动、库文件和测试程序拷贝到NanoPi 2的文件系统上。
$ cp modules /media/rootfs/ -r $ cp install/lib/* /media/rootfs/lib/ -d $ cp install/usr/bin/* /media/rootfs/usr/bin/这些我是都没有问题
将SD卡重新插入NanoPi 2,上电启动,在Debian的shell终端中执行以下命令加载硬件驱动。
$ cd /modules$ insmod matrix_gpio_int.ko运行模块Matrix-Button的测试程序。
$ matrix-button第一遍试,command not found
回去翻了翻输入过的命令,发现cp时多了个空格,然后我再把空格删了重新copy一遍,但这次说 什么什么太短了? 不太记得了,忘记截图了。我想是不是可能之前命令误操作了,于是格了重刷系统。这次连cp时都出现了错误,未找到此目录,我看了一下,原来的rootfs变成了rootfs_,我改了之后又烧写一遍,依旧不可以……
刚好我也看到一篇文章,http://weibo.com/p/1001603914482173772682 ,感觉写的不错,友善的微博也转过,于是先把sd卡用SDFormat 工作彻底格式化,再把友善给的nanopi2-debian-sd4g-wifiap.img中的0x200-0x8200的内容拷贝到sd卡中:
打开sd卡:
这个是友善的img文件
alt+G定位到0x200位置,右击,选块起始:
再定位到0x8200位置,选择 选块结束。
右击-编辑-复制选块-十六进制数值:
切换到sd卡页面,定位到0x200,选择编辑:
最后,保存。打开串口,上电,出现如下字样:
原因来自第三方:
SD卡地址偏移量0x200之前(也就是block0)是SD卡信息,不要修改, [0x200-0x400)是NSIH(iROM程序会识别的CPU配置信息和其他信息), [0x400-0x8000)是2ndboot.bin的所存放的地方, [0x8000-0x8200)是第二个NISH, 接下来的地方是uboot,不过我们不是去启动操作系统,而是跑裸机,所以没复制uboot部分。 为什么使用WinHex工具制作:用这个工具可以比较清晰知道各种文件实际存放的地址位置,更深入一点操作和体验。S5P4418的启动过程,我觉得挺适合初学者或对启动过程比较模糊的人。
边栏推荐
- How thingjs enables low threshold 3D visualization development
- 528. Random Pick with Weight
- 【学习资源】理解数学和热爱数学
- 297. Serialize and Deserialize Binary Tree
- MySQL fault case | mysqldump: couldn't execute 'select column_ NAME
- 438. Find All Anagrams in a String
- Unique paths for leetcode topic resolution
- Best time to buy and sell stock II
- Leetcode topic analysis count primes
- Optimize your gradle module with a clean architecture
猜你喜欢

Custom tags - JSP tag enhancements

通用分页(1)

Quartz Crystal Drive Level Calculation

【活动报名】SOFAStack × CSDN 联合举办开源系列 Meetup ,6 月 24 日火热开启

The fourth online workshop review

Custom tag - JSP tag Foundation

Linux Mysql安装

173. Binary Search Tree Iterator

Le rapport d'analyse de l'industrie chinoise des bases de données a été publié en juin. Le vent intelligent se lève, les colonnes se régénèrent

“教练,我想打篮球“ —— 给做系统的同学们准备的 AI 学习系列小册
随机推荐
Balls and cows of leetcode topic analysis
C#之Lambda不得不说的用法
Part of speech family
A method of realizing video call and interactive live broadcast in small programs
636. Exclusive Time of Functions
Happy number of leetcode topic analysis
5、 Project management
[qnx hypervisor 2.2 user manual]5.6.1 silent device during guest shutdown
MySQL故障案例 | ERROR 1071 (42000): Specified key was too long
Comprehensive analysis of news capture
65. Valid Number
6月《中國數據庫行業分析報告》發布!智能風起,列存更生
瞄准海外宠物市场,「Grasphand 」做了一款独立于手机的智能追踪产品 | 早期项目
2022.6.22-----leetcode.513
Map (set) operation in go language
173. Binary Search Tree Iterator
[cloud native | kubernetes] kubernetes principle and installation (II)
Point cloud library PCL from introduction to mastery Chapter 10
Vue3表单页面利用keep-alive缓存数据的一种思路
Optimize your gradle module with a clean architecture