当前位置: 首页 > news >正文

20251015荣品的PRO-RK3566开发板在buildroot下解决驱动编译异常的问题

20251015荣品的PRO-RK3566开发板在buildroot下解决驱动编译异常的问题
2025/10/15 17:43


缘起:在飞凌OK3588-C的Linux R4【Linux5.10.66+ Qt5.15.2】上使用订制版本的OV5645这颗摄像头。
由于屏蔽了众多的I2C读写,众多的变量ret就没有使用了!。
没有想到搬家到荣品的PRO-RK3566的Linux上编译不过!
【Buildroot的内核版本5.10.198】

解决方法:在kernel的Makefile文件中加入-Wno-error忽略这个错误!
【当然,你也可以一个一个的干掉没有使用的ret等变量了!】

Y:\PRO-BOX-rk3568source20250911\kernel\Makefile
KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
           -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
           -Werror=implicit-function-declaration -Werror=implicit-int \
           -Werror=return-type -Wno-format-security \
           -std=gnu89 \
           -Wno-error \
           -w 


  CC      fs/utimes.o
  CC      drivers/input/touchscreen/atmel_mxt_ts.o
  CC      drivers/usb/gadget/function/storage_common.o
drivers/media/i2c/ov5645.c: In function 'ov5645_write_reg':
drivers/media/i2c/ov5645.c:652:6: error: unused variable 'ret' [-Werror=unused-variable]
  652 |  int ret;
      |      ^~~
drivers/media/i2c/ov5645.c:651:5: error: unused variable 'regbuf' [-Werror=unused-variable]
  651 |  u8 regbuf[3];
      |     ^~~~~~
drivers/media/i2c/ov5645.c: In function 'ov5645_read_reg':
drivers/media/i2c/ov5645.c:673:6: error: unused variable 'ret' [-Werror=unused-variable]
  673 |  int ret;
      |      ^~~
drivers/media/i2c/ov5645.c:672:5: error: unused variable 'regbuf' [-Werror=unused-variable]
  672 |  u8 regbuf[2];
      |     ^~~~~~
drivers/media/i2c/ov5645.c: In function 'ov5645_set_aec_mode':
drivers/media/i2c/ov5645.c:700:6: error: unused variable 'ret' [-Werror=unused-variable]
  700 |  int ret;
      |      ^~~
drivers/media/i2c/ov5645.c: In function 'ov5645_set_agc_mode':
drivers/media/i2c/ov5645.c:723:6: error: unused variable 'ret' [-Werror=unused-variable]
  723 |  int ret;
      |      ^~~
drivers/media/i2c/ov5645.c: In function 'ov5645_set_register_array':
drivers/media/i2c/ov5645.c:749:5: error: unused variable 'tmp' [-Werror=unused-variable]
  749 |  u8 tmp;
      |     ^~~
drivers/media/i2c/ov5645.c:748:6: error: unused variable 'ret' [-Werror=unused-variable]
  748 |  int ret;
      |      ^~~
drivers/media/i2c/ov5645.c:747:15: error: unused variable 'i' [-Werror=unused-variable]
  747 |  unsigned int i;
      |               ^
drivers/media/i2c/ov5645.c: In function 'ov5645_set_saturation':
drivers/media/i2c/ov5645.c:877:6: error: unused variable 'ret' [-Werror=unused-variable]
  877 |  int ret;
      |      ^~~
drivers/media/i2c/ov5645.c:876:6: error: unused variable 'reg_value' [-Werror=unused-variable]
  876 |  u32 reg_value = (value * 0x10) + 0x40;
      |      ^~~~~~~~~
drivers/media/i2c/ov5645.c: In function 'ov5645_set_hflip':
drivers/media/i2c/ov5645.c:893:6: error: unused variable 'ret' [-Werror=unused-variable]
  893 |  int ret;
      |      ^~~
drivers/media/i2c/ov5645.c:892:5: error: unused variable 'val' [-Werror=unused-variable]
  892 |  u8 val = ov5645->timing_tc_reg21;
      |     ^~~
drivers/media/i2c/ov5645.c: In function 'ov5645_set_vflip':
drivers/media/i2c/ov5645.c:914:6: error: unused variable 'ret' [-Werror=unused-variable]
  914 |  int ret;
      |      ^~~
drivers/media/i2c/ov5645.c:913:5: error: unused variable 'val' [-Werror=unused-variable]
  913 |  u8 val = ov5645->timing_tc_reg20;
      |     ^~~
drivers/media/i2c/ov5645.c: In function 'ov5645_set_test_pattern':
drivers/media/i2c/ov5645.c:934:5: error: unused variable 'val' [-Werror=unused-variable]
  934 |  u8 val = 0;
      |     ^~~
drivers/media/i2c/ov5645.c: In function 'ov5645_set_awb':
drivers/media/i2c/ov5645.c:958:5: error: unused variable 'val' [-Werror=unused-variable]
  958 |  u8 val = 0;
      |     ^~~
drivers/media/i2c/ov5645.c: In function 'ov5645_probe':
drivers/media/i2c/ov5645.c:1488:19: error: unused variable 'chip_id_low' [-Werror=unused-variable]
 1488 |  u8 chip_id_high, chip_id_low;
      |                   ^~~~~~~~~~~
drivers/media/i2c/ov5645.c:1488:5: error: unused variable 'chip_id_high' [-Werror=unused-variable]
 1488 |  u8 chip_id_high, chip_id_low;
      |     ^~~~~~~~~~~~
At top level:
drivers/media/i2c/ov5645.c:805:13: error: 'ov5645_set_power_off' defined but not used [-Werror=unused-function]
  805 | static void ov5645_set_power_off(struct ov5645 *ov5645)
      |             ^~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov5645.c:774:12: error: 'ov5645_set_power_on' defined but not used [-Werror=unused-function]
  774 | static int ov5645_set_power_on(struct ov5645 *ov5645)
      |            ^~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov5645.c:743:12: error: 'ov5645_set_register_array' defined but not used [-Werror=unused-function]
  743 | static int ov5645_set_register_array(struct ov5645 *ov5645,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/media/i2c/ov5645.c:670:12: error: 'ov5645_read_reg' defined but not used [-Werror=unused-function]
  670 | static int ov5645_read_reg(struct ov5645 *ov5645, u16 reg, u8 *val)
      |            ^~~~~~~~~~~~~~~
drivers/media/i2c/ov5645.c:649:12: error: 'ov5645_write_reg' defined but not used [-Werror=unused-function]
  649 | static int ov5645_write_reg(struct ov5645 *ov5645, u16 reg, u8 val)
      |            ^~~~~~~~~~~~~~~~

cc1: all warnings being treated as errors
make[4]: *** [scripts/Makefile.build:273:drivers/media/i2c/ov5645.o] 错误 1
make[3]: *** [scripts/Makefile.build:516:drivers/media/i2c] 错误 2
make[3]: *** 正在等待未完成的任务....
  AR      drivers/media/cec/i2c/built-in.a
  CC      drivers/input/touchscreen/ilitek/ilitek_report.o
  CC      drivers/gpu/arm/midgard/backend/gpu/mali_kbase_pm_ca_fixed.o
  CC      drivers/gpu/drm/drm_flip_work.o
  CC      drivers/net/usb/zaurus.o
  CC      drivers/net/Space.o
  CC      drivers/net/ethernet/stmicro/stmmac/stmmac_tc.o


  CC [M]  drivers/media/dvb-frontends/ascot2e.o
  CC [M]  drivers/media/dvb-frontends/helene.o
  CC [M]  drivers/media/dvb-frontends/zd1301_demod.o
  CC [M]  drivers/media/dvb-frontends/cxd2099.o
  LD [M]  drivers/media/dvb-frontends/stb0899.o
  LD [M]  drivers/media/dvb-frontends/drxd.o
  LD [M]  drivers/media/dvb-frontends/stv0900.o
  LD [M]  drivers/media/dvb-frontends/cxd2820r.o
  LD [M]  drivers/media/dvb-frontends/drxk.o
make[2]: *** [scripts/Makefile.build:516:drivers/media] 错误 2
make[1]: *** [Makefile:1929:drivers] 错误 2
make: *** [arch/arm64/Makefile:214: rk356x/pro-rk3566.img] Error 2
make: Leaving directory '/home/jinhualong/PRO-BOX-rk3568source20250911/kernel'
ERROR: Running /home/jinhualong/PRO-BOX-rk3568source20250911/device/rockchip/common/scripts/mk-kernel.sh - run_command failed!
ERROR: exit code 2 from line 36:
    $@
ERROR: call stack:
    build-helper: run_command(36)
    mk-kernel.sh: do_build(61)
    mk-kernel.sh: build_hook(259)
    mk-kernel.sh: main(340)
ERROR: Running /home/jinhualong/PRO-BOX-rk3568source20250911/device/rockchip/common/build-hooks/99-all.sh - build_all failed!
ERROR: exit code 2 from line 20:
    "$RK_SCRIPTS_DIR/mk-kernel.sh"
ERROR: call stack:
    99-all.sh: build_all(20)
    99-all.sh: build_hook(127)
    build-helper: try_func(63)
    build-helper: try_hook(95)
    build-helper: source(175)
    99-all.sh: main(138)
ERROR: Running /home/jinhualong/PRO-BOX-rk3568source20250911/device/rockchip/common/build-hooks/99-all.sh - try_func build_hook all failed!
ERROR: exit code 2 from line 67:
    build_hook
ERROR: call stack:
    build-helper: try_func(67)
    build-helper: try_hook(95)
    build-helper: source(175)
    99-all.sh: main(138)
ERROR: Running ./build.sh - run_hooks build all failed!
ERROR: exit code 2 from line 256:
    /home/jinhualong/PRO-BOX-rk3568source20250911/device/rockchip/common/build-hooks/99-all.sh build all
ERROR: call stack:
    build.sh: run_hooks(256)
    build.sh: run_build_hooks(275)
    build.sh: main(649)
    build.sh: main(660)
ERROR: Running ./build.sh - run_build_hooks build all failed!
ERROR: exit code 2 from line 278:
    build
ERROR: call stack:
    build.sh: run_build_hooks(278)
    build.sh: main(649)
    build.sh: main(660)
jinhualong@jinhualong-LEGION-REN7000K-26IRX:~/PRO-BOX-rk3568source20250911$ 

Y:\PRO-BOX-rk3568source20250911\kernel\Makefile

KBUILD_AFLAGS   := -D__ASSEMBLY__ -fno-PIE
KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
           -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
           -Werror=implicit-function-declaration -Werror=implicit-int \
           -Werror=return-type -Wno-format-security \
           -std=gnu89
KBUILD_CPPFLAGS := -D__KERNEL__
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS_MODULE  := -DMODULE
KBUILD_CFLAGS_MODULE  := -DMODULE
KBUILD_LDFLAGS_MODULE :=
KBUILD_LDFLAGS :=
CLANG_FLAGS :=

修改为:

KBUILD_AFLAGS   := -D__ASSEMBLY__ -fno-PIE
KBUILD_CFLAGS   := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
           -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
           -Werror=implicit-function-declaration -Werror=implicit-int \
           -Werror=return-type -Wno-format-security \
           -std=gnu89 \
           -Wno-error \
           -w 

KBUILD_CPPFLAGS := -D__KERNEL__
KBUILD_AFLAGS_KERNEL :=
KBUILD_CFLAGS_KERNEL :=
KBUILD_AFLAGS_MODULE  := -DMODULE
KBUILD_CFLAGS_MODULE  := -DMODULE
KBUILD_LDFLAGS_MODULE :=
KBUILD_LDFLAGS :=
CLANG_FLAGS :=


http://www.dtcms.com/a/486281.html

相关文章:

  • pytest 库用法示例:Python 测试框架的高效实践
  • 公司接到网站中文域名到期在云服务器打建网站
  • 为什么做的网站预览出来什么都没有wordpress开发西瓜
  • uniapp使用音频录音功能
  • 【Linux运维】 Prometheus + Grafana + Alertmanager 监控系统部署指南(CentOS Ubuntu 通用版)
  • 目标检测核心知识与技术
  • 【免费源码】使用YOLOv11和OCSort进行多类别目标跟踪。(基于ncnn框架,c++实现)
  • 学习:uniapp全栈微信小程序vue3后台(31)
  • 微信小程序开发实战指南(三)-- Webview访问总结
  • 公司自建网站加盟装修公司哪家好
  • 哪个软件做网站好如何制作橡皮泥 简单
  • DDE方式下Delphi7程序间及与VB6程序的数据交换
  • 网络安全等级保护要求(10+4 层面)记忆总结
  • 活字格AI智能体:重塑企业级自动化与智能交互新范式
  • 【通信网络安全主题】第六届计算机通信与网络安全国际学术会议(CCNS 2025)
  • 海商网做网站价格自己做的网站怎么添加采集模块
  • vscode使用翻译插件分享
  • Web通信技术:Comet(服务器推送)详解
  • 互联网营销网站建设玩具租赁网站开发与实现论文
  • 为什么格林公式二重积分一侧的被积函数是两项相减
  • 成都网站建设软件石家庄模板网站
  • 【实战-12】flink版本表
  • ‌MyBatis-Plus 的 LambdaQueryWrapper 可以实现 OR 条件查询‌
  • 带你了解STM32:SPI通信(硬件部分)
  • CentOS下安装配置JDK24和tomcat11
  • springboot mybatisplus 配置SQL日志,但是没有日志输出
  • Windows下安装配置JDK24和tomcat11
  • 建个大型网站要多少钱房产信息网网站
  • 贵阳建站公司做的不错的h5高端网站
  • 实践 3:Vim 编辑器的使用