1.参考资料
官方指导资料:https://mangopi.cc/tiny200
DFrobot入门指导:https://wiki.dfrobot.com.cn/_SKU_DFR0780_MangoPi-R3
荔枝派Nano指导:http://nano.lichee.pro/
不得不说官方入门介绍还没第三方的全。
目前主要基于aodzip的代码具体链接如下,
https://github.com/aodzip/buildroot-tiny200/
2.整起
2.1 常用指令
- 部分编译指令
修改dts后,如何编译生效
rm ./output/images/*.dtb
make linux-clean-for-rebuild
make linux -j8
make
或者直接脚本
./helper/rebuild-kernel.sh
配置菜单
所有被支持的make命令可以通过make help打印出来:
make clean (清理编译输出文件)
make distclean (不仅清理编译输出,还清理dl目录以及config文件,慎用)
make toolchain (编译一份适应目标cpu的工具链)
make menuconfig (配置软件包菜单)
make busybox-menuconfig (busybox软件包配置)
make uboot-menuconfig (uboot软件包配置)
make linux-menuconfig (linux软件包配置)
make -j4 (4线程编译)
2) uboot指令
mtd erase spi-nand0 //擦除整个nand flash()
dfu 0 mtd spi-nand0 //dfu 下载nand
2.1 Q群直接下载工程
nand下载失败,
Copying data from PC to DFU device
Download [======================== ] 99% 133750784 bytes failed!
state(10) = dfuERROR, status(14) = Something went wrong, but the device does not know what it was
can't detach
Resetting USB to switch back to runtime mode
sdcade下载成功并运行
2.2 git下载编译
下载:git clone https://github.com/mangopi-sbc/buildroot-mangopi-r
默认设备树为nor,需要修改设备树:
注意:默认dts编译出来的是nor版本,如需要nand版本,需要在55行后边加disabled
55 spi-max-frequency = <50000000>;
56 status = "disabled";
同时再将93行的注释掉
93 //status = "disabled";
./board/widora/mangopi/r1/devicetree/linux/devicetree.dts
./board/widora/mangopi/r1/devicetree/uboot/suniv-f1c100s-generic.dts
./board/widora/mangopi/r2/devicetree/linux/devicetree.dts
./board/widora/mangopi/r2/devicetree/uboot/suniv-f1c100s-generic.dts
./board/widora/mangopi/r3/devicetree/linux/devicetree.dts
./board/widora/mangopi/r3/devicetree/uboot/suniv-f1c100s-generic.dts
修改dts后,如何编译生效
rm ./output/images/*.dtb
make linux-clean-for-rebuild
make linux -j8
make
User@DESKTOP-P79JNC3 F:\development_board\mangopi\mpi-R-tools
$ dfu-util.exe -R -a all -D sysimage-nand.img
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/
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 1f3a:1010
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 4096
Copying data from PC to DFU device
Download [=========================] 100% 131072000 bytes
Download done.
state(7) = dfuMANIFEST, status(0) = No error condition is present
state(2) = dfuIDLE, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
失败,文件系统无法挂载,原因待确定
3.开始折腾
3.1 alsa-utils 开启测试
3.2 nand flash加ubi格式开启
* Memory Technology Device (MTD) suppor
│ Symbol: MTD_RAW_NAND [=n] │
│ Type : tristate │
│ Prompt: Raw/Parallel NAND Device Support │
│ Location: │
│ -> Device Drivers │
│ (1) -> Memory Technology Device (MTD) support (MTD [=y]) │
│ Defined at drivers/mtd/nand/raw/Kconfig:13 │
│ Depends on: MTD [=y] │
│ Selects: MTD_NAND_CORE [=y] && MTD_NAND_ECC_SW_HAMMING [=n]
Symbol: MTD_NAND_BRCMNAND [=n] │
│ Type : tristate │
│ Prompt: Broadcom STB NAND controller │
│ Location: │
│ -> Device Drivers │
│ -> Memory Technology Device (MTD) support (MTD [=y]) │
│ (8) -> Raw/Parallel NAND Device Support (MTD_RAW_NAND [=n]) │
│ Defined at drivers/mtd/nand/raw/Kconfig:234 │
│ Depends on: MTD [=y] && MTD_RAW_NAND [=n] && (ARM [=y] || ARM64 || MIPS || COMPILE_TEST [=n]) && HAS_IOMEM [=y]
│ <*> UBIFS file system support │ │
│ │ [*] Advanced compression options │ │
│ │ [*] LZO compression support (NEW) │ │
│ │ [*] ZLIB compression support (NEW) │ │
│ │ [*] ZSTD compression support (NEW) │ │
│ │ [ ] Access time support │ │
│ │ [*] UBIFS XATTR support │ │
│ │ [*] UBIFS Security Labels │ │
│ │ [ ] UBIFS authentication support
3.3 ov2640
fswebcam -d /dev/video0 -S 3 -p UYVY test19.bmp
开始拍照
设置图像格式
media-ctl --set-v4l2 ‘“ov2640 0-0030”:0[fmt:YUYV8_2X8/640x480]’
拍照测试
fswebcam -d /dev/video0 --no-banner -r 640x480 -S 10 1.jpg