【发布时间】:2023-03-21 10:27:01
【问题描述】:
我正在尝试使用 Yocto Project 构建最小的树莓派零映像。我对 C 不熟悉,但我想知道为什么在编译“ws2811.c”期间会出现这个(微不足道的)错误,我可以在另一个带有 raspbian OS 的 raspberry pi 2 上成功构建(整个库)而没有任何错误。感谢您的每一个提示和帮助!
存储库:
https://github.com/jgarff/rpi_ws281x
我的配方在尝试构建根(存储库)位置“scons”时卡住了:
sudo scons
Bitbake 编译配方任务输出:
| DEBUG: Executing python function externalsrc_compile_prefunc
| NOTE: python-ws2812: compiling from external source tree /home/astor/Documents/poky/rpi-build/workspace/sources/python-ws2812
| DEBUG: Python function externalsrc_compile_prefunc finished
| DEBUG: Executing shell function do_compile
| scons: Reading SConscript files ...
| scons: done reading SConscript files.
| scons: Building targets ...
| CC ws2811.o
| ws2811.c: In function 'setup_pwm':
| ws2811.c:289:23: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
| dma_cb->dest_ad = (uint32_t)&((pwm_t *)PWM_PERIPH_PHYS)->fif1;
| ^
| cc1: all warnings being treated as errors
| scons: *** [ws2811.o] Error 1
| scons: building terminated because of errors.
| WARNING: /home/astor/Documents/poky/rpi-build/tmp/work/arm1176jzfshf-vfp-poky-linux-gnueabi/python-ws2812/1.0+git999-r0/temp/run.do_compile.11838:1 exit 2 from 'scons'
| ERROR: Function failed: do_compile (log file is located at /home/astor/Documents/poky/rpi-build/tmp/work/arm1176jzfshf-vfp-poky-linux-gnueabi/python-ws2812/1.0+git999-r0/temp/log.do_compile.11838)
这看起来像我的食谱:
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=9dcf340793a1d73c5211edc8238767dc"
SRC_URI = "git://github.com/richardghirst/rpi_ws281x.git;protocol=https"
PV = "1.0+git${SRCPV}"
SRCREV = "39afaac5f2b8b307d7d7b5f2f790fbb6759bda5e"
S = "${WORKDIR}/git"
DEPENDS = "swig-native"
inherit scons setuptools
do_compile_prepend() {
cd ${S}/
scons
${PYTHON} ${S}/python/setup.py install
}
【问题讨论】:
标签: raspberry-pi yocto bitbake