在种草了很多天之后,最近终于在淘宝下单了友善 nanoPi R5S。

选择友善 nanoPi R5S 有两点主要理由:

1. 自带 EMMC 存储,可以使用 RockChip 提供的 MaskRom 模式直接连线烧系统,不依赖 TF 卡(我觉得 TF 卡太累赘了,买普通的又慢又不稳定,对于我这种新手来说,多一个配件就多一个问题);

2. 带一个 M.2 M-Key 的插槽,方便我后续加存储存一些家庭照片(不需要什么扩展板、连线,直接在 CNC 铝壳里,很利索)。

我的主力电脑是一台 MBP(Apple M1 Pro),因此在下单前选配件的时候,我犹豫是否需要 USB-A 到 USB-A 连接线,要这个线的话,我还得买一个USB-A 到 Type-C 的转接。能不能直接使用手头就有的 USB-A 到 USB-C 线呢?基本买手机、充电器都会带一根,家里已经到处都是了。

遂咨询客服。

- “能不能用现在很常见的 USB-A 到 USB-C 的线直连 MBP?”

- “线可以,MacOS 不提供支持”

意思就是线是行的,但是用 MacOS 的话店家不提供支持。

不甘结束的我,接下来查到了这个:Install Rockchip flashing tools

由它来到了 RockChip 在 GitHub 开源的 rkdeveloptool 仓库:https://github.com/rockchip-linux/rkdeveloptool

啊哈,看来把它在 Mac 上编译一下,就和 Windows 上一样了,就可以直连 MaskRom 的 R5S,烧系统捣鼓起来……

按照 Install Rockchip flashing tools 的指引,开始尝试本地编译 rkdeveloptool

brew install automake autoconf libusb
git clone git@github.com:rockchip-linux/rkdeveloptool.git
cd rkdeveloptool
autoreconf -i
./configure
make

在最后 make的时候,报错了:

查看代码
 g++ -DHAVE_CONFIG_H -I. -I./cfg  -Wall -Werror -Wextra -Wreturn-type -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -I/opt/homebrew/Cellar/libusb/1.0.26/include/libusb-1.0   -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cpp
main.cpp:74:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
sprintf(szText, "Test Device total %lld, current %lld", totalValue, currentValue);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
main.cpp:78:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
sprintf(szText, "Lowerformat Device total %lld, current %lld", totalValue, currentValue);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
main.cpp:82:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
sprintf(szText, "Download Image total %lldK, current %lldK", totalValue/1024, currentValue/1024);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
main.cpp:86:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
sprintf(szText, "Check Image total %lldK, current %lldK", totalValue/1024, currentValue/1024);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
main.cpp:90:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
sprintf(szText, "Tag Bad Block total %lld, current %lld", totalValue, currentValue);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
main.cpp:94:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
sprintf(szText, "Test Block total %lld, current %lld", totalValue, currentValue);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
main.cpp:98:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
sprintf(szText, "Erase Flash total %lld, current %lld", totalValue, currentValue);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
main.cpp:102:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
sprintf(szText, "Erase System partition total %lld, current %lld", totalValue, currentValue);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
main.cpp:106:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
sprintf(szText, "<LocationID=%x> Erase Userdata partition total %lld, current %lld", deviceLayer, totalValue, currentValue);
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
main.cpp:3306:2: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
sprintf(szProgramProcPath, "/proc/%d/exe", getpid());
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
10 errors generated.
make[1]: *** [main.o] Error 1
make: *** [all-recursive] Error 1

看起来是 sprintf 方法已经废弃了,建议使用 snprintf 替代。嗯,,作为新手还是先不改代码了,先查一下这个问题怎么绕过。

在项目仓库找到一个 Issus #75,移除 Makefile.am 里的 -Werror,然后重新执行:

autoreconf -i
./configure
make

项目根目录出现了 rkdeveloptool 可执行程序,执行:

rkdeveloptool -v

输出

rkdeveloptool ver 1.32

成功了,

现在,就等着 R5S 到货了。

最新文章

  1. 当我谈 &quot;加班有罪&quot; 我在谈什么?
  2. JavaScript代码模块化的正规方法
  3. EF外键关联
  4. FFMpeg ver 20160213-git-588e2e3 滤镜中英文对照
  5. (转自http://www.blogjava.net/moxie/archive/2006/10/20/76375.html)WebWork深入浅出
  6. 超级楼梯[HDU2041]
  7. CentOS6 更改Mysql数据库的数据存放位置
  8. 直播源格式转换教程——rtmp/rtsp/http/m3u8!!
  9. AWS ElastiCache 使用笔记
  10. Redis的PHP操作手册(自用)
  11. C#操作Office.word(二)
  12. php 遍历文件夹及文件,获取文件名和文件路径存入数据库中
  13. IOS中的单例设计模式
  14. 【原】spring boot添加cros全局过滤器
  15. Web Service进阶(六)SOAPBinding绑定方式异常 is not found. Have you run APT to generate them
  16. baiduMap &amp; MapV 简单demo
  17. FNMP
  18. 【BZOJ】 4810: [Ynoi2017]由乃的玉米田
  19. 文本框JTextField,密码框JPasswordField
  20. The Little Prince-12/01

热门文章

  1. C. 连锁商店(状压dp)
  2. 想开发DAYU200,我教你
  3. java学习之Cookie与Session
  4. MongoDB 数据库的学习
  5. 删除redis对应key的缓存
  6. Go语言核心36讲14
  7. 【Java并发006】使用层面:Lock锁机制全解析
  8. 对Java Web中WEB-INF目录的理解以及访问方法
  9. CAP 7.0 版本发布通告 - 支持延迟消息,性能炸了?
  10. integer 拆箱装箱以及范围