Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fpga-load.ko fails with "Cannot find manager node" #2

Closed
osresearch opened this issue Jun 20, 2018 · 26 comments
Closed

fpga-load.ko fails with "Cannot find manager node" #2

osresearch opened this issue Jun 20, 2018 · 26 comments

Comments

@osresearch
Copy link
Contributor

osresearch commented Jun 20, 2018

Since I don't have the quick start firmare image due to issue #1, I've tried building the dev environment on a stock debian BBB image. To get to the point of being able to try the fpga-load.ko I had to:

  • update to 4.14 to get the fpga manager support and installed kernel headers
  • build fpga-mgr.ko and ice-spi.ko as out-of-tree modules and insmod'ed them
  • compile the DTS/BW-ICE40CapeV2-00A0.dts into a dtbo and installed it with the cape manager
  • fixup the paths in bw-prog.sh

When fpga-load.ko is insmod'ed by the script, it fails with "Cannot find manager node" and exits without loading the bitfile.

@osresearch
Copy link
Contributor Author

If I rebuild the initramfs after copying the dtbo files into /lib/firmware, the BBB won't boot with the cape attached:

cd BeagleWire/DTS
for file in *.dts; do
  dtc -O dtb -o $(basename $file).dtbo -b 0 -@ $file
done
sudo cp *.dtbo /lib/firmware
sudo update-initramfs -u -k $(uname -r)
sudo reboot

The symptom is that the User LED 0 flashes pulse, pulse, pause. I can't reach the serial console with the cape installed, so I can't see what uboot or the kernel is printing.

@mwelling
Copy link
Collaborator

Beagleboard has shifted to using U-Boot for applying the devicetree overlays. Sadly bootloader access is stunted by the spec so a U-boot or early boot failure is difficult to debug. You have to rely on the /boot/uenv.txt and a convoluted default environment in U-Boot. You might be able to pin clips to get a hold of the UART under the cape but utmost care should be taken when separating the boards. I would tack wires to the bottom of the header. Luckily since you have to use an uSD part you can plug it into your PC for updates or reverts.

https://forum.digikey.com/t/all-beaglebone-varients-u-boot-overlays/26

Not sure why the initrams thing made it puke but the debug console will give you some hints. Bust out the soldering iron. :)

@osresearch
Copy link
Contributor Author

Booting with the image.tar.xz results in the same FPGA manager node error. I note in the dmesg that the overlay doesn't load:

[    2.217992] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,00C0,1618BBBK0F74'                                                                               
[    2.225323] bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4                                                                   
[    2.281025] bone_capemgr bone_capemgr: slot #0: 'BeagleBone BeagleWireCape,00A0,beagleboard.org,BW-ICE40Cape'                                                
[    2.317442] bone_capemgr bone_capemgr: slot #1: No cape found                
[    2.349595] bone_capemgr bone_capemgr: slot #2: No cape found                
[    2.381745] bone_capemgr bone_capemgr: slot #3: No cape found                
[    2.387763] bone_capemgr bone_capemgr: initialized OK.                       
[    2.393132] bone_capemgr bone_capemgr: loader: failed to load slot-0 BW-ICE40Cape:00A0 (prio 0)

Perhaps something is not properly configured on my cape?

@mwelling
Copy link
Collaborator

mwelling commented Jun 20, 2018

Perhaps the overlay file is not up to date and loaded in the proper location.

Here is what it looks like on the uSD I have here:

debian@arm:~$ ls /lib/firmware/BW-ICE40Cape-00A0.dtbo -l
-rw-r--r-- 1 debian debian 2861 May 24 17:04 /lib/firmware/BW-ICE40Cape-00A0.dtbo
debian@arm:~$ md5sum /lib/firmware/BW-ICE40Cape-00A0.dtbo
cffead70bd1ef11064b49f170c042a7c  /lib/firmware/BW-ICE40Cape-00A0.dtbo

@osresearch
Copy link
Contributor Author

I have the same version in /lib/firmware on the SD card, although is that the version that is loaded or is the one in the initramfs used? The kernel on the SD card has the intiramfs bundled into the vmlinux file, update-initramfs can't replace any of the firmwares.

Is the +5V supply required to load the FPGA or can it be USB powered?

@mwelling
Copy link
Collaborator

I always use the USB only for testing.

@mwelling
Copy link
Collaborator

The one in /lib/firmware should be loaded.
Just just moved the file and reboot and got this:

[    2.037392] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,00C0,414BBBK0216\xffffffff'
[    2.044723] bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4
[    2.100980] bone_capemgr bone_capemgr: slot #0: 'BeagleBone BeagleWireCape,00A0,beagleboard.org,BW-ICE40Cape'
[    2.137411] bone_capemgr bone_capemgr: slot #1: No cape found
[    2.169559] bone_capemgr bone_capemgr: slot #2: No cape found
[    2.201710] bone_capemgr bone_capemgr: slot #3: No cape found
[    2.207716] bone_capemgr bone_capemgr: initialized OK.
[    2.213074] bone_capemgr bone_capemgr: loader: failed to load slot-0 BW-ICE40Cape:00A0 (prio 0)

@osresearch
Copy link
Contributor Author

  • Reading the eeprom from /sys/bus/i2c/devices/i2c-2/2-0054/eeprom works.
  • Both jumpers are installed.
  • SW4 both switches are on.
  • Nothing is connected to any of the PMOD or groove connectors
  • I'm booting from the SD card with the eb862b... image.tar.gz
  • Loading the DTBO via /sys/devices/platform/bone_capemgr/slots at runtime results in dmesg output about override for slot#4, but then returns an error code to echo with no further messages.

What else should I check?

@mwelling
Copy link
Collaborator

The dtbo should be automatically loaded on boot.
Not sure, loading a new uSD card from scratch to see if I run into similar issues.

@mwelling
Copy link
Collaborator

So I just loaded the image to a new uSD card, booted it and ran the following:

cd load-fw/
sudo ./bw-prog.sh blink.bin 

The dmesg output:

[  148.664714] fpga_load: loading out-of-tree module taints kernel.
[  148.671742] fpga_load: no symbol version for fpga_mgr_firmware_load
[  148.692882] Starting FPGA loader
[  148.701506] fpga_manager fpga0: writing blink.bin to Lattice iCE40 FPGA Manager
[  148.906380] Stopping FPGA loader

Not sure where the holdup is on your board. Lemme try the uSD card on a brand new BBB.

@mwelling
Copy link
Collaborator

Okay I am seeing the same failure as you with the new BBB.

Comparing the kernel messages the new and old BBB.

@mwelling
Copy link
Collaborator

Here is something that is different early in the boot.

On the failing BBB:
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait

On the working BBB:
[ 0.000000] Kernel command line: console=ttyO0,115200n8 bone_capemgr.uboot_capemgr_enabled=1 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait uboot_detected_capes=BW-ICE40Cape,

@mwelling
Copy link
Collaborator

Looks like the bootloader on the eMMC of new module is the culprit.

I pressed the S2 button on the new BBB while powering on and it worked.

So we have to update the bootloader on the eMMC with the new BBB.

See if pressing S2 while powering helps for you.

@mwelling
Copy link
Collaborator

Hopefully your fingers are small enough to reach under the cape to the button.

S2 is just above the uSD card.

@osresearch
Copy link
Contributor Author

It is a difficult reach, but yes, that does it! I don't have a working D1 on my board to blink, but the bitstream load appears to have worked.

@mwelling
Copy link
Collaborator

mwelling commented Jun 20, 2018

Now we just have to come up with a procedure to update the eMMC bootloader.

The easiest way would be to erase the first few sectors of the eMMC. :)

@RobertCNelson
Copy link

One quick creative way would be:

sudo dd if=/dev/mmcblk0 of=/dev/mmcblk1 bs=1M count=1

hopefully u-boot.img isn't bigger then normal, and you have the partition hole setup at 4MB..

Regards,

@RobertCNelson
Copy link

Nope, that failed..

sudo debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh | grep bootloader
[sudo] password for debian: 
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
debian@beaglebone:~$ sudo dd if=/dev/mmcblk0 of=/dev/mmcblk1 bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.119964 s, 8.7 MB/s
debian@beaglebone:~$ sudo /opt/scripts/tools/version.sh | grep bootloader
bootloader:[microSD-(push-button)]:[/dev/mmcblk0]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
bootloader:[eMMC-(default)]:[/dev/mmcblk1]:[U-Boot 2018.03-00002-gac9cce7c6a]:[location: dd MBR]
debian@beaglebone:~$ ��#

(last 3 ^ char up there is me, yanking power, removing microsd and attaching power..)

@mwelling
Copy link
Collaborator

@RobertCNelson any other ideas?

Is there a Debian way to do it?

@mwelling
Copy link
Collaborator

According to Jason Kridner:
If you boot the eMMC, there is a script under /opt/scripts. Do a 'git pull', then look in I think tools / developer for "update_bootloader.sh" and run that as root.

@sbenyamin
Copy link

I wonder if you can help me. I am seeing the same issue and holding S2 does not resolve the problem. My apologies for the duplication as I have also sent you a direct email.

I have loaded https://debian.beagleboard.org/images/bone-debian-10.3-iot-armhf-2020-04-06-4gb.img.xz onto the eMMC

and https://rcn-ee.net/rootfs/bb.org/testing/BeagleWire/BeagleWire-image.tar.xz onto the sd card

debian@arm:~/load-fw$ sudo ./bw-prog.sh blink.bin
[sudo] password for debian:
insmod: ERROR: could not insert module fpga-load.ko: No such device
rmmod: ERROR: Module fpga_load is not currently loaded

and the following dmesg:

[ 104.109535] random: 7 urandom warning(s) missed due to ratelimiting
[ 855.984598] fpga_load: loading out-of-tree module taints kernel.
[ 855.991186] fpga_load: no symbol version for fpga_mgr_firmware_load
[ 856.007041] Starting FPGA loader
[ 856.010433] Cannot find manager node

@sbenyamin
Copy link

sbenyamin commented Apr 30, 2021

Not sure if this is relevant, I have an invalid signature in dmesg
[ 2.039504] wkup_m3_ipc 44e11324.wkup_m3_ipc: CM3 Firmware Version = 0x193
[ 2.049571] bone_capemgr bone_capemgr: Baseboard: 'A335BNLT,BWA5,1721EW000155'
[ 2.056901] bone_capemgr bone_capemgr: compatible-baseboard=ti,beaglebone-black - #slots=4
[ 2.113259] bone_capemgr bone_capemgr: Invalid signature 'ffffffff' at slot 0
[ 2.120447] bone_capemgr bone_capemgr: slot #0: No cape found
[ 2.154266] bone_capemgr bone_capemgr: slot #1: No cape found
[ 2.186438] bone_capemgr bone_capemgr: slot #2: No cape found
[ 2.218587] bone_capemgr bone_capemgr: slot #3: No cape found
[ 2.224430] bone_capemgr bone_capemgr: initialized OK.
[ 2.239313] musb-hdrc musb-hdrc.1: MUSB HDRC host driver

I also have this line which does not indicate the cape was detected:
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p1 ro rootfstype=ext4 rootwait

@sbenyamin
Copy link

I found my problem. The cape eeprom was not programmed. Thanks

@pmezydlo
Copy link
Owner

pmezydlo commented May 1, 2021 via email

@sbenyamin
Copy link

sbenyamin commented May 3, 2021 via email

@ombhilare999
Copy link
Collaborator

It seems the issue was solved in this thread if not please trying following repo with given commit, also attached getting started guide for beaglewire.

Kindly try script on the following repo (Also worked in hardware with commit 26a99da )
https://github.com/BeagleWire/BeagleWire/tree/testing
Complete Getting started guide for beaglewire

Regards,
Omkar Bhilare
ombhilare999@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants