Hi I’m trying to make a custom overlay for BBB and I can’t compile it, I get syntax error so I just copy BB-BONE-4D7N-01-00A1.dts
debian@BeagleBone:~$ dtc -O dtb -o BB-BONE-TEST-00A1.dtbo -b 0 -@ BB-BONE-TEST-00A1.dts
Error: BB-BONE-TEST-00A1.dts:12.1-9 syntax error
FATAL ERROR: Unable to parse input tree
I’m using
debian@BeagleBone:~$ uname -a
Linux BeagleBone 5.10.168-ti-r72 #1bullseye SMP PREEMPT Sat Sep 30 03:37:21 UTC 2023 armv7l GNU/Linux
debian@BeagleBone:~$ dtc -v
Version: DTC 1.6.0
I don´t understand why syntax error, can someone help me here, thanks
I’d suggest you pull the entire tree instead, from here:
BeagleBoard.org / BeagleBoard-DeviceTrees · GitLab
That way, all you need to do is make.
2 Likes
It is looking for include files and dtc does not do that. It is preprocessed with cpp then onto dtc.
You can expand out the macros so all you have is hex values. Then you can drop the #includes.
Or do as @lranders says, that is the simplest. Just be careful the cpp is breaking on 22.04 when it is looking many layers deep of #includes. If you add an #include you could run into trouble.
On the first run use one of the known and working overlays to validate you have everything set up properly.
You do have the correct dtc string, that will work without any includes.
Post what you are trying to compile.
1 Like
Thanks I could compile it with the makefile in /opt/source/bb.org-overlays but its not working as expected, I just want to config gpio pins,
*/
/dts-v1/;
/plugin/;
#include <dt-bindings/board/am335x-bbw-bbb-base.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
/ {
fragment@0 {
target-path = "/";
__overlay__ {
chosen {
overlays {
BB-PIN-CONFIG-00A0 = __TIMESTAMP__;
};
};
};
};
/* Free up the pins used by the cape from the pinmux helpers */
fragment@1 {
target = <&ocp>;
__overlay__ {
P8_10_pinmux { status = "disabled"; }; /* Disable existing pinmux for P8_14 */
P8_07_pinmux { status = "disabled"; }; /* Disable existing pinmux for P8_15 */
};
};
/* Apply custom pin configuration */
fragment@2 {
target = <&am33xx_pinmux>;
__overlay__ {
bb_pin_config_pins: pinmux_bb_pin_config_pins {
pinctrl-single,pins = <
BONE_P8_10 (PIN_INPUT_PULLUP | MUX_MODE7) /* P8_14 as GPIO with pull-up */
BONE_P8_07 (PIN_INPUT | MUX_MODE7) /* P8_15 as GPIO with no pull */
>;
};
};
};
fragment@3 {
target = <&ocp>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&bb_pin_config_pins>;
};
};
};
with show-pins I can see that " (pinmux_P8_08_default_pin)" at the end dissapear but no change on the pull-up
P8.07 36 fast rx up 7 gpio 2.02 hi >> P8_07
P8.10 38 fast rx down 7 gpio 2.04 << hi P8_10
this is the uEnv.txt
#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0
uname_r=5.10.168-ti-r72
#uuid=
#dtb=
###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###
###Overide capes with eeprom
uboot_overlay_addr0=/lib/firmware/BB-BONE-4D7N-01-00A1.dtbo
uboot_overlay_addr1=/lib/firmware/BB-PIN-CONFIG-00A0.dtbo
#uboot_overlay_addr2=<file2>.dtbo
#uboot_overlay_addr3=<file3>.dtbo
###
###Additional custom capes
#uboot_overlay_addr4=<file4>.dtbo
#uboot_overlay_addr5=<file5>.dtbo
#uboot_overlay_addr6=<file6>.dtbo
#uboot_overlay_addr7=<file7>.dtbo
###
###Custom Cape
#dtb_overlay=<file8>.dtbo
###
###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#disable_uboot_overlay_emmc=1
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1
disable_uboot_overlay_wireless=1
#disable_uboot_overlay_adc=1
###
###Cape Universal Enable
enable_uboot_cape_universal=1
###
###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###
###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###
console=ttyS0,115200n8
cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet
#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet video=HDMI-A-1:1024x768@60e
#Use an overlayfs on top of a read-only root filesystem:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet overlayroot=tmpfs
##enable Generic eMMC Flasher:
#cmdline=init=/usr/sbin/init-beagle-flasher
what am I doing wrong?
You will need to monitor the linux port to see if it is actually loading. Just because it compiled does not mean it was bootable. I use gtkterm and log the boot process then look for the FDT it will show if the overlay loaded or not.
Are you sure those pins are not already active?
debian@BeagleBone:~$ sudo beagle-version
[sudo] password for debian:
eeprom:[A335BNLT000C1942BBBG0226]
model:[TI_AM335x_BeagleBone_Black]
dogtag:[BeagleBoard.org Debian Bullseye Minimal Image 2023-10-07]
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot SPL 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot SPL 2022.04-ge0d31da5 (Aug 04 2023 - 18:48:26 +0000)]:[location: dd MBR]
UBOOT: Booted Device-Tree:[am335x-boneblack-uboot-univ.dts]
UBOOT: Loaded Overlay:[BB-ADC-00A0.kernel]
UBOOT: Loaded Overlay:[BB-BONE-4D7N-01-00A1]
UBOOT: Loaded Overlay:[BB-BONE-eMMC1-01-00A0.kernel]
UBOOT: Loaded Overlay:[BB-PIN-CONFIG-00A0]
I’m not sure, Sorry I’m starting with BBB can you help me