Running update_kernel.sh crashes logi_loader.

With the help from this forum I successfully created a node application that displays tweets on an AdaFruit 32x32 LED matrix display. The code base is from Glen Akins tutorial found here: http://bikerglen.com/projects/lighting/led-panel-1up.

All is well, except now I am trying to go wireless on the Beaglebone. Everything works great with the logibone_r1_ubuntu_v4.img image (downloaded from here http://valentfx.com/doc/logi-image/logibone), but with this image, the Wi-Fi drivers seem to be outdated. After booting, it sometimes works, sometimes it doesn't.

AdaFruit has a tutorial (https://learn.adafruit.com/setting-up-wifi-with-beaglebone-black?view=all), they recommend updating the kernel. So I did. After this the logi_loader fails. It is clearly repeatable.

To put things short. Everything is working fine, but after this command

$ cd /opt/scripts/tools && sudo ./update_kernel.sh && sudo reboot

the logi_loader fails, and I can´t upload the beagle01.bit file needed to make the Logi-bone work. The code on Github in file serial_fpga_loader.c, tries to open the device "/dev/spidev1.0", but this doesn't exist on my working image.

I have tried all the images here without success (http://valentfx.com/doc/logi-image/logibone). 

Well, my question is: is there any way to upgrade the WiFi drivers without breaking Logi-bone compatability?

Comments

  • Hi,

    after updating the kernel, can you do a uname -a to check your kernel version ? After rebooting your board can you also do a "sudo /sys/devices/bone_capemgr*/slots" to see if the cape device tree configuration is loaded properly ?

    Latest Ubuntu and Debian images are compatible with the logibone out of the box so you should no have any problem ...

    Regards,

    Jonathan Piat
  • edited November 2014

    Again, Thank You for a quick reply! I updated the kernel and here are the results.


    $ uname -a

    Linux arm 3.8.13-bone62 #1 SMP Sat Jul 26 08:29:47 UTC 2014 armv7l armv7l armv7l GNU/Linux


    $ cat /sys/devices/bone_capemgr.9/slots

     1: 55:PF--- 

     2: 56:PF--- 

     3: 57:PF--- 

     4: ff:P-O-- Bone-LT-eMMC-2G,00A0,Texas Instrument,BB-BONE-EMMC-2G

     5: ff:P-O-- Bone-Black-HDMI,00A0,Texas Instrument,BB-BONELT-HDMI

     6: ff:P-O-- Bone-Black-HDMIN,00A0,Texas Instrument,BB-BONELT-HDMIN







     7: ff:P-O-L Override Board Name,SLOW,Override Manuf,BB-BONE-LOGIBONX


    $ logi_loader beagle01.bit

    0+1 records in

    0+1 records out



    340714 bytes (341 kB) copied, 0.0140293 s, 24.3 MB/s


    After a simple reboot, it worked since the Logibone already was loaded with the Beagle01.bit file. But after power-down/power-up, I could not get the bit file uploaded to the Logibone. Everything looks OK, but the file is never uploaded. The LEDs on the Logibone doesn't flash as they normally do.


    This is the complete source code if it is of any help. https://github.com/meg768/twitter-display.git


    /Magnus



  • I gues that you loaded the device tree file by hand, as described in glen's wiki. This is the old way to do it, and Glen's code is a bit outdated. The new loaded uses SPI to be faster and more generic and Glen's code uses the old driver version that uses bit-banging to load the FPGA. Running newer kernel with up to date version of the driver will require to re-write the "BB-BONE-LOGIBONX-SLOW.dts" file provided by glen.

    The part configuring the config interfacemux  now looks like this :

    fpga_config_pins: pinmux_fpga_config_pins {
                    pinctrl-single,pins = <
                        /* config clk and data */
                        0x190 0x33    /* P9_31 = mcasp0_aclkx.spi1_sclk                 , OUTPUT_PULLUP | MODE3 */
                        0x194 0x33    /* P9_29 = mcasp0_fsx.spi1_d0                     , INPUT_PULLUP  | MODE3 */
                        0x198 0x13    /* P9_30 = mcasp0_axr0.spi1_d1                     , OUTPUT_PULLUP | MODE3 */
                        0x19c 0x13    /* P9_28 = mcasp0_ahclkr.spi1_cs0                 , OUTPUT_PULLUP | MODE3 */
                    >;
                };


    and the fragment@2 now is :


    fragment@2 {
            target = <&spi1>;
            __overlay__ {

                #address-cells     = <1>;
                #size-cells     = <0>;
                status            = "okay";
                pinctrl-names    = "default";
                pinctrl-0        = <&fpga_config_pins>;

                spidev@1{
                    compatible           = "linux,spidev";
                    reg               = <0>;
                    spi-max-frequency = <48000000>;
                };
            };
        };

    everything else should remain the same. If you have trouble modifying this file (that is in led-panel/projects/led-panel-v01/config-scripts/) i can help.<br><br>Regards,<br><br>Jonathan Piat<br>
  • Yes, I used Glen's code and used his bit-files. When I checked the source code at https://github.com/fpga-logi/logi-tools/blob/master/logibone_loader/user_space/serial_fpga_loader.c I saw that it was writing to "/dev/spidev1.0" which the logi_loader I am using apparently doesn´t do. So something has changed.

    Is there any way you could provide me with a compiled Beagle01.bit file that is compatible with the later images of Debian or Ubuntu (found here http://valentfx.com/doc/logi-image/logibone) and also compatible with the logi-tools found on GitHub?

    I am totally new to FPGA:s. All I know is from this forum and Glen's tutorial, so bare with me... ;) 

    Regards,
    Magnus

     
  • @jpiatIt took me a while to understand what you said, since I am new to all of this. But this is what I finally did.
    • Installed the logi_ubuntu-14.04-console-armhf-2014-08-13.img image on my SD card
    • Renamed the bbb-uEnv.txt on the BOOT partition to uEnv.txt (this took me a while to figure out)
    • Added the disabling of BB-BONELT-HDMI,BB-BONE-EMMC-2G,BB-BONELT-HDMIN,BB-BONE-LOGIBONE to uEnv.txt
    • Installed the device tree compiler (dtc) since it is not included in the image
    • Made the changes you suggested to BB-BONE-LOGIBONX-SLOW.dts
    • Compiled it using dtc and fed it to  the the bone_capemgr
    And it worked! Thank You! Running a later kernel version will definitely improve my chances of getting the Wi-Fi to work.

    I am really impressed with the support in this forum! :)

    /Magnus
  • Hi,

    sorry that my answer was not clear enough, but glad you got it working. Newer version of LOGI-Bone driver is integrated in the kernel and the device tree configuration is loaded automagically if you have the proper descriptor in the on-board eeprom (logi-tools does it by itself). This is why you needed to disable BB-BONELT-HDMI,BB-BONE-EMMC-2G,BB-BONELT-HDMIN,BB-BONE-LOGIBONE (to avoid loading of default driver). There are two changes with the newest driver :

    - bitfile loading is made through SPI and thus can be performed through a user-space tool (easier to upgrade for us, faster and more versatile for you)
    - GPMC (the memory interface between the processor and FPGA) is synchronous to avoid bugs in the communication (asynchronous behavior depends on the design loaded in the FPGA)

    A good fix for glen's code would be to change the interface behavior to synchronous, so that the user don't have to deal with device tree at all and can run a stock Debian/Ubuntu with no problem. I'll dig into this, to see if i can make it happen.

    Regards,

    Jonathan Piat
Sign In or Register to comment.