Hello guys,
I have a beaglebone black and I am tying to enable the following:
-
i2c1 so it can work with a ISL1209 RTC , using pins P9_17 and P9_18
-
spi1 so it can work with a CY15B104QN FRAM, using pins P9_28, P9_29, P9_30, P9_31
I am trying to work with yocto scarthgap (with kirkstone it was ok - the i2c part - but something changed I suppose).
Here is my setup:
bblayers.conf
POKY_BBLAYERS_CONF_VERSION = "2"
BBPATH = "${TOPDIR}"
BBFILES ?= ""
BSPDIR := "${@os.path.abspath(os.path.dirname(d.getVar('FILE', True)) + '/../..')}"
BBLAYERS ?= " \
${BSPDIR}/poky/meta \
${BSPDIR}/poky/meta-poky \
${BSPDIR}/poky/meta-yocto-bsp \
${BSPDIR}/meta-ti/meta-ti-bsp \
${BSPDIR}/meta-ti/meta-ti-extras \
${BSPDIR}/meta-arago/meta-arago-demos \
${BSPDIR}/meta-arago/meta-arago-distro \
${BSPDIR}/meta-arago/meta-arago-extras \
${BSPDIR}/meta-arago/meta-arago-test \
${BSPDIR}/meta-openembedded/meta-oe \
${BSPDIR}/meta-openembedded/meta-multimedia \
${BSPDIR}/meta-openembedded/meta-networking \
${BSPDIR}/meta-openembedded/meta-python \
${BSPDIR}/meta-openembedded/meta-filesystems \
${BSPDIR}/meta-arm/meta-arm \
${BSPDIR}/meta-arm/meta-arm-bsp \
${BSPDIR}/meta-arm/meta-arm-toolchain \
${BSPDIR}/meta-arm/meta-arm-systemready \
${BSPDIR}/meta-qt5 \
${BSPDIR}/meta-custom \
"
In my local.conf I’ve set MACHINE ?= "beaglebone-yocto"
My meta-custom has the following:
recipes-kernel/linux/linux-bb%.bbappend
PR = "r0"
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI:append = " \
file://custom-config.cfg \
file://enable_i2c1.dtsi \
file://enable-spi-cy15.dtsi \
"
do_configure:append() {
cp ${WORKDIR}/enable_i2c1.dtsi ${B}/source/arch/${ARCH}/boot/dts
cp ${WORKDIR}/enable-spi-cy15.dtsi ${B}/source/arch/${ARCH}/boot/dts
echo '#include "enable_i2c1.dtsi"' >> ${B}/source/arch/${ARCH}/boot/dts/am335x-boneblack.dts
echo '#include "enable-spi-cy15.dtsi"' >> ${B}/source/arch/${ARCH}/boot/dts/am335x-boneblack.dts
}
do_compile:append() {
# Ensure the custom .config file is used
yes '' | make oldconfig
}
custom-config.cfg
CONFIG_EXPERT=y
CONFIG_CONFIGFS_FS=y
CONFIG_OVERLAY_FS=y
CONFIG_RFKILL_GPIO=y
CONFIG_MTD_SPI_NOR=y
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
CONFIG_MTD_SPI_NOR_SWP_DISABLE_ON_VOLATILE=y
CONFIG_OF_DYNAMIC=y
CONFIG_OF_RESOLVE=y
CONFIG_OF_OVERLAY=y
CONFIG_TOUCHSCREEN_ADS7846=n
CONFIG_RFKILL_INPUT=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_SPI_DEBUG=y
CONFIG_SPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SPI_MUX=y
CONFIG_SPI_SPIDEV=y
CONFIG_SPI_LOOPBACK_TEST=m
CONFIG_SPI_SLAVE=y
CONFIG_SPI_SLAVE_TIME=y
CONFIG_SPI_SLAVE_SYSTEM_CONTROL=y
CONFIG_SPI_DYNAMIC=y
CONFIG_PPS=y
CONFIG_GPIO_SYSFS=y
CONFIG_RTC_DRV_ISL1208=y
CONFIG_MULTIPLEXER=y
CONFIG_JFFS2_FS=y
CONFIG_JFFS2_FS_DEBUG=0
CONFIG_JFFS2_FS_WRITEBUFFER=y
CONFIG_JFFS2_ZLIB=y
CONFIG_JFFS2_RTIME=y
CONFIG_UBIFS_FS=y
CONFIG_UBIFS_FS_ADVANCED_COMPR=y
CONFIG_UBIFS_FS_LZO=y
CONFIG_UBIFS_FS_ZLIB=y
CONFIG_UBIFS_FS_ZSTD=y
CONFIG_UBIFS_ATIME_SUPPORT=y
CONFIG_UBIFS_FS_XATTR=y
CONFIG_UBIFS_FS_SECURITY=y
CONFIG_CRYPTO_LZO=y
CONFIG_CRYPTO_ZSTD=y
enable_i2c1.dtsi
&am33xx_pinmux {
/* I2C-1: My i2c and muxing it for my needs */
my_i2c1_pins: my_i2c1_pins {
pinctrl-single,pins = < /* My device: i2c addr 0x22, 0x23 */
AM33XX_IOPAD(0x95c, PIN_INPUT | MUX_MODE2) /* (A16)/(Pin 50) spi0_cs0.I2C1_SCL */
AM33XX_IOPAD(0x958, PIN_INPUT | MUX_MODE2) /* (B16)/(Pin 49) spi0_d1.I2C1_SDA */
>;
};
};
&i2c1 { /* My i2c device 0x22, 0x23 */
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&my_i2c1_pins>;
clock-frequency = <100000>;
rtc@6f {
compatible = "isil,isl1208";
reg = <0x6f>;
};
};
enable-spi-cy15.dtsi
&am33xx_pinmux {
my_spi1_pins: pinmux_my_spi1_pins {
pinctrl-single,pins = <
AM33XX_IOPAD(0x990, PIN_INPUT_PULLUP | MUX_MODE3) /* spi1_sclk */
AM33XX_IOPAD(0x994, PIN_INPUT_PULLUP | MUX_MODE3) /* spi1_d0 */
AM33XX_IOPAD(0x998, PIN_OUTPUT_PULLUP | MUX_MODE3) /* spi1_d1 */
AM33XX_IOPAD(0x99C, PIN_OUTPUT_PULLUP | MUX_MODE3) /* spi1_cs0 */
>;
};
};
&spi1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&my_spi1_pins>;
spi-max-frequency = <24000000>;
spidev@0 {
compatible = "spidev";
reg = <0>;
spi-max-frequency = <24000000>;
};
spidev@1 {
compatible = "spidev";
reg = <1>;
spi-max-frequency = <24000000>;
};
};
recipes-core/images/core-custom-beaglebone.bb
inherit core-image
# Include the core-image-minimal recipe
require recipes-core/images/core-image-minimal.bb
CORE_IMAGE_EXTRA_INSTALL += " kernel-modules"
IMAGE_INSTALL += " nano libgpiod"
IMAGE_INSTALL += " sysfsutils i2c-tools spitools config-pin"
IMAGE_INSTALL += " libgpiod-tools libgpiod-dev"
And now some outputs from the board:
root@beaglebone-yocto:~# dmesg | grep i2c
[ 2.114915] i2c_dev: i2c /dev entries driver
[ 2.229480] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[ 2.266352] platform 4830e000.lcdc: Fixed dependency cycle(s) with /ocp/interconnect@44c00000/segment@200000/target-module@b000/i2c@0/tda19988@70
[ 3.457405] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
root@beaglebone-yocto:~# dmesg | grep spi
root@beaglebone-yocto:~# i2cdetect -l
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-2 i2c OMAP I2C adapter I2C adapter
root@beaglebone-yocto:~# ls -l /dev/spi*
ls: cannot access '/dev/spi*': No such file or directory
root@beaglebone-yocto:~# cat /proc/mtd
dev: size erasesize name
root@beaglebone-yocto:~# uname -a
Linux beaglebone-yocto 6.6.21-yocto-standard #1 PREEMPT Tue Mar 19 16:42:51 UTC 2024 armv7l GNU/Linux
I would really appreciate some help from you guys