[BBB] fails to load RoboticsCape-00A0 device tree at boot.

This forum is for supported devices using an ARMv7 Texas Instruments (TI) SoC.

[BBB] fails to load RoboticsCape-00A0 device tree at boot.

Postby yershov » Thu Oct 22, 2020 8:39 pm

Following closely the posts https://archlinuxarm.org/forum/viewtopic.php?f=48&t=14464 and https://archlinuxarm.org/forum/viewtopic.php?f=23&t=12635, I attempted to load /lib/firmware/RoboticsCape-00A0.dtbo on boot. Yes, I just bought robotics cape for my project.

First, I modified /boot/boot.txt as follows:
$this->bbcode_second_pass_code('', '
# After modifying, run ./mkscr

if test -n ${distro_bootpart}; then setenv bootpart ${distro_bootpart}; else setenv bootpart 1; fi
part uuid ${devtype} ${devnum}:${bootpart} uuid

setenv bootargs "console=tty0 console=${console} root=PARTUUID=${uuid} rw rootwait"

if load ${devtype} ${devnum}:${bootpart} ${kernel_addr_r} /boot/zImage; then
gpio set 54
echo fdt: ${fdtfile}
if load ${devtype} ${devnum}:${bootpart} ${fdt_addr_r} /boot/dtbs/${fdtfile}; then
gpio set 55
#############################
# Customize Device Tree #
#############################
fdt addr ${fdtaddr} # without this line nothing are loaded
fdt resize 0x60000 # need space for loading dtbo file
# disable HDMI
load ${devtype} ${devnum}:${bootpart} ${rdaddr} /lib/firmware/BB-NHDMI-TDA998x-00A0.dtbo
fdt apply ${rdaddr} # need after every dtbo to apply
# load robotics cape overlay
load ${devtype} ${devnum}:${bootpart} ${rdaddr} /lib/firmware/RoboticsCape-00A0.dtbo
fdt apply ${rdaddr}
#############################
# End of customizations #
#############################
if load ${devtype} ${devnum}:${bootpart} ${ramdisk_addr_r} /boot/initramfs-linux.img; then
gpio set 56
bootz ${kernel_addr_r} ${ramdisk_addr_r}:${filesize} ${fdt_addr_r};
else
gpio set 56
bootz ${kernel_addr_r} - ${fdt_addr_r};
fi;
fi;
fi
')
After which I ran ./mkscr

This process worked with many overlays that enabled SPI, I2C1, and other capabilities. However, it is stuck in boot process when using RoboticsCape overlay. I've tried disabling HDMI manually with the same results. I've tried compiling overlay from https://github.com/RobertCNelson/bb.org-overlays, and got the same results.

Using J1 console debugger I get the following messages during boot if Ethernet cable is attached to BBB:
$this->bbcode_second_pass_code('', '
s
U-Boot SPL 2017.07-1 (Sep 02 2017 - 21:04:29)
Trying to boot from MMC1


U-Boot 2017.07-1 (Sep 02 2017 - 21:04:29 +0000) Arch Linux ARM

CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

<ethaddr> not set. Validating first E-fuse MAC
Net: cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
gpio: pin 54 (gpio 54) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 56 (gpio 56) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** File not found boot.scr **
** Unrecognized filesystem type **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
2581 bytes read in 35 ms (71.3 KiB/s)
## Executing script at 80000000
5796864 bytes read in 399 ms (13.9 MiB/s)
gpio: pin 54 (gpio 54) value is 1
fdt: am335x-boneblack.dtb
87396 bytes read in 56 ms (1.5 MiB/s)
gpio: pin 55 (gpio 55) value is 1
2878 bytes read in 4163 ms (0 Bytes/s)
7834 bytes read in 2000 ms (2.9 KiB/s)
fdt_overlay_apply(): FDT_ERR_NOTFOUND
8000998 bytes read in 529 ms (14.4 MiB/s)
gpio: pin 56 (gpio 56) value is 1
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
SCRIPT FAILED: continuing...
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
starting USB...
USB0: Port not available.
link up on port 0, speed 100, full duplex
BOOTP broadcast 1
data abort
pc : [<9ff87976>] lr : [<00008bc7>]
reloc pc : [<80835976>] lr : [<e08b6bc7>]
sp : 9df318d8 ip : 00000000 fp : 9ffed7c8
r10: 9ffed310 r9 : 9df31ed8 r8 : 0000000e
r7 : 9ffef654 r6 : 9ffef65c r5 : 00000000 r4 : 9ffed80e
r3 : 00060101 r2 : 00000008 r1 : 9ffed7ce r0 : 0000000e
Flags: nzCv IRQs off FIQs on Mode SVC_32
Resetting CPU ...

resetting ...
')
The BBB reboots repeating the process...

Without Ethernet cable the messages are slightly different after failing to load device tree overlay:
$this->bbcode_second_pass_code('', '
s
U-Boot SPL 2017.07-1 (Sep 02 2017 - 21:04:29)
Trying to boot from MMC1


U-Boot 2017.07-1 (Sep 02 2017 - 21:04:29 +0000) Arch Linux ARM

CPU : AM335X-GP rev 2.1
I2C: ready
DRAM: 512 MiB
No match for driver 'omap_hsmmc'
No match for driver 'omap_hsmmc'
Some drivers were not found
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
Using default environment

<ethaddr> not set. Validating first E-fuse MAC
Net: cpsw, usb_ether
Press SPACE to abort autoboot in 2 seconds
gpio: pin 54 (gpio 54) value is 0
gpio: pin 55 (gpio 55) value is 0
gpio: pin 56 (gpio 56) value is 0
gpio: pin 53 (gpio 53) value is 1
switch to partitions #0, OK
mmc0 is current device
SD/MMC found on device 0
** File not found boot.scr **
** Unrecognized filesystem type **
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot script /boot/boot.scr
2581 bytes read in 35 ms (71.3 KiB/s)
## Executing script at 80000000
5796864 bytes read in 399 ms (13.9 MiB/s)
gpio: pin 54 (gpio 54) value is 1
fdt: am335x-boneblack.dtb
87396 bytes read in 55 ms (1.5 MiB/s)
gpio: pin 55 (gpio 55) value is 1
2878 bytes read in 4163 ms (0 Bytes/s)
7834 bytes read in 2000 ms (2.9 KiB/s)
fdt_overlay_apply(): FDT_ERR_NOTFOUND
8000998 bytes read in 529 ms (14.4 MiB/s)
gpio: pin 56 (gpio 56) value is 1
ERROR: Did not find a cmdline Flattened Device Tree
Could not find a valid device tree
SCRIPT FAILED: continuing...
switch to partitions #0, OK
mmc1(part 0) is current device
Scanning mmc 1:1...
starting USB...
USB0: Port not available.
cpsw Waiting for PHY auto negotiation to complete......... TIMEOUT !
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 90:59:af:95:c7:8b
HOST MAC de:ad:be:af:00:00
RNDIS ready
ERROR: The remote end did not respond in time.
at drivers/usb/gadget/ether.c:2430/_usb_eth_init()
missing environment variable: pxeuuid
Retrieving file: pxelinux.cfg/01-90-59-af-95-c7-8b
cpsw Waiting for PHY auto negotiation to complete......... TIMEOUT !
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 90:59:af:95:c7:8b
HOST MAC de:ad:be:af:00:00
RNDIS ready
ERROR: The remote end did not respond in time.
at drivers/usb/gadget/ether.c:2430/_usb_eth_init()
Retrieving file: pxelinux.cfg/00000000
cpsw Waiting for PHY auto negotiation to complete......... TIMEOUT !
using musb-hdrc, OUT ep1out IN ep1in STATUS ep2in
MAC 90:59:af:95:c7:8b
HOST MAC de:ad:be:af:00:00
RNDIS ready
ERROR: The remote end did not respond in time.
at drivers/usb/gadget/ether.c:2430/_usb_eth_init()
Retrieving file: pxelinux.cfg/0000000
')
The last part keeps repeating in the infinite loop.

Apologies for spamming the debug messages, I just don't understand what is relevant in this situation. Any help or pointers will be greatly appreciated!
yershov
 
Posts: 7
Joined: Thu Apr 30, 2015 1:55 pm

Re: [BBB] fails to load RoboticsCape-00A0 device tree at boo

Postby Zeno » Mon Oct 26, 2020 3:58 pm

Hello,
got over your post, seems I could have some suggestions:
1) RoboticsCape overlay could definitely be used with kernels 4.16 and older, taking this https://github.com/RobertCNelson/bb.org ... e-00A0.dts as a reference, there is old (kernel 4.16<) style pruss device node. If you use latest ArchlinuxArm kernels (you probably do so because I see mkscr style boot), be aware that there is no more pruss hwmod so the overlay won't work. With a little bit more of hacking (as discussed here viewtopic.php?f=48&t=14558) it is possible to make old style PRUs operable.

2) ***EDIT: My mistake, looked trough my device and seems bone-pinmux-helper is still available, so maybe the only problem could be old style pruss.

3) Regarding the FDT_ERR_NOTFOUND error, it is thrown probably while applying robocape overlay, when some phandle is not found or something does not match with main device tree? This is probably the origin of error for latest kernel and your case as well
***EDIT2: source of error is uboot, so the proper source is here: https://gitlab.denx.de/u-boot/u-boot/-/ ... lay.c#L376 as ArchlinuxArm uses uboot-beaglebone version 2017.07-1.

So from this, I think that robocape overlay is not easily compatible/usable on recent ArchlinuxArm. If you insist on using robocape on ArchlinuxArm, you will probably need to use pruss tweak (mentioned above), and then also adapt/update robotics cape overlay accordingly to the actual am335x-boneblack.dtb base tree. Best way to do so might be to decompile am335x-boneblack.dtb, take a look at the proper hierarchy and adapt the robocape overlay to comply with it, finally compile it back and try.
Hope this helps a bit and have a nice day.
Zeno
Zeno
 
Posts: 14
Joined: Wed May 03, 2017 5:00 pm


Return to Texas Instruments (TI)

Who is online

Users browsing this forum: No registered users and 2 guests