can't load overlay - echo: write error: No such file or directory

3,044 views
Skip to first unread message

pushu...@gmail.com

unread,
Jan 22, 2014, 11:23:25 AM1/22/14
to beagl...@googlegroups.com
BBB Board running Angstrom v2012.12 and Linux beaglebone 3.8.13 #1 SMP Tue Jun 18 02:11:09 EDT 2013 armv7l GNU/Linux

Trying to run command "echo <overlay> > $SLOTS" results in error "-su: echo: write error: No such file or directory"

I can "cat $SLOTS" (/sys/devices/bone_capemgr.8/slots) just fine. I am root and root has rw on that file..

I'm trying to get my own overlay working for a very simple no-eeprom cape which has a DS1307 (which works fine, btw) and which will have an HD47780 LCD. I have a number of pre-built overlays in /lib/firmware and none of them will load.

An example from dmesg:
[ 330.631832] bone-capemgr bone_capemgr.8: failed to load firmware 'cape-bone-adafru-00A0.dtbo'
[ 490.071059] bone-capemgr bone_capemgr.8: part_number 'cape-bone-adafruit-lcd-00A0', version 'N/A'
[ 490.071138] bone-capemgr bone_capemgr.8: slot #11: generic override
[ 490.071157] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 11
[ 490.071175] bone-capemgr bone_capemgr.8: slot #11: 'Override Board Name,00A0,Override Manuf,cape-bone-adafru'
[ 490.071277] bone-capemgr bone_capemgr.8: slot #11: Requesting part number/version based 'cape-bone-adafru-00A0.dtbo
[ 490.071296] bone-capemgr bone_capemgr.8: slot #11: Requesting firmware 'cape-bone-adafru-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 490.080114] bone-capemgr bone_capemgr.8: failed to load firmware 'cape-bone-adafru-00A0.dtbo'

Is it failing due to lack of an eeprom? My LCD project is using code from here:
LCD library:
http://www.nunoalves.com/open_source/?p=152
(git repo https://github.com/nunoalves/BeagleBone_IO_lib)

It looks like in the code (which fails on asserting GPIO pins) tries to set up the pins itself. Should an overlay even be needed?

I have plenty of unix experience but not so much BBB-specific, so bear with any obvious oversights on my part please.




smith.wi...@gmail.com

unread,
Jan 22, 2014, 1:03:30 PM1/22/14
to beagl...@googlegroups.com, pushu...@gmail.com
On Wednesday, January 22, 2014 11:23:25 AM UTC-5, pushu...@gmail.com wrote:
BBB Board running Angstrom v2012.12 and Linux beaglebone 3.8.13 #1 SMP Tue Jun 18 02:11:09 EDT 2013 armv7l GNU/Linux

Trying to run command "echo <overlay> > $SLOTS" results in error "-su: echo: write error: No such file or directory"

What's in 'overlay' -- is this the overlay file itself or does it contain the name of the overlay?  You should be echoing the overlay name into $SLOTS; take a look here:


Could also be a conflict, you might need to add the following to uEnv in the boot partition (you'll need to mount /dev/mmcblk0p1 into /mnt to access this):

optargs=capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN


I can "cat $SLOTS" (/sys/devices/bone_capemgr.8/slots) just fine. I am root and root has rw on that file..

I'm trying to get my own overlay working for a very simple no-eeprom cape which has a DS1307 (which works fine, btw) and which will have an HD47780 LCD. I have a number of pre-built overlays in /lib/firmware and none of them will load.

An example from dmesg:
[ 330.631832] bone-capemgr bone_capemgr.8: failed to load firmware 'cape-bone-adafru-00A0.dtbo'
[ 490.071059] bone-capemgr bone_capemgr.8: part_number 'cape-bone-adafruit-lcd-00A0', version 'N/A'
[ 490.071138] bone-capemgr bone_capemgr.8: slot #11: generic override
[ 490.071157] bone-capemgr bone_capemgr.8: bone: Using override eeprom data at slot 11
[ 490.071175] bone-capemgr bone_capemgr.8: slot #11: 'Override Board Name,00A0,Override Manuf,cape-bone-adafru'
[ 490.071277] bone-capemgr bone_capemgr.8: slot #11: Requesting part number/version based 'cape-bone-adafru-00A0.dtbo
[ 490.071296] bone-capemgr bone_capemgr.8: slot #11: Requesting firmware 'cape-bone-adafru-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[ 490.080114] bone-capemgr bone_capemgr.8: failed to load firmware 'cape-bone-adafru-00A0.dtbo'

Is it failing due to lack of an eeprom?

No, the EEPROM just enables "auto detection" of your cape, you put the part#/revision and it'll try to load it.  However, there are issues, if you don't compile the overlay into the kernel, then the boot stalls for 60 seconds because the eMMC overlay gets loaded *after* the EEPROM ones and of course, the rootfs isn't available until then.

Check your filenames here, the part # seems to be cape-bone-adafruit-lcd, but it's looking for cape-bone-adafru.  Also, take another look at dmesg, after the 60 second stall, the eMMC overlay is loaded and rootfs mounted, I think it tries again.

You could also try explicitly adding it to uEnv.txt:

optargs=capemgr.enable_partno=my-overlay

 
My LCD project is using code from here:
LCD library:
http://www.nunoalves.com/open_source/?p=152
(git repo https://github.com/nunoalves/BeagleBone_IO_lib)

It looks like in the code (which fails on asserting GPIO pins) tries to set up the pins itself. Should an overlay even be needed?

Yes, you'll likely need an overlay unless the pins you are using are already configured by default (e.g. I2C2).

Hope this helps,


-W

pushu...@gmail.com

unread,
Jan 23, 2014, 10:34:32 AM1/23/14
to beagl...@googlegroups.com, pushu...@gmail.com
<overlay> is the name of the part number in the .dts - which brings up a mistake I was making, assuming the file name would match the part name. Once I fixed that, I was able to load (and unload) one of the supplied dtbo files.

Here's my stuff:
BB-BONE-LCD-01-00A1.dts
root@beaglebone:/lib/firmware# cat BB-BONE-LCD-01-00A1.dts
/*
* Copyright (C) 2013 Matt Ranostay <mran...@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/

/dts-v1/;
/plugin/;

//Connect a HD44780 compatible screen to the beaglebone using the
//follwing connections:
//P8_16 ==> DB7
//P8_15 ==> DB6
//P8_14 ==> DB5
//P8_13 ==> DB4
//P8_12 ==> RS
//P8_11 ==> E

/ {
        compatible
= "ti,beaglebone", "ti,beaglebone-black";
        part
-number = "BB-BONE-LCD-01";
        version
= "00A0";

       
/* state the resources this cape uses */
        exclusive
-use =
               
/* the pin header uses */
               
"P8.16",       /* LCD: DB7 */
               
"P8.15",       /* LCD: DB6 */
               
"P8.13",       /* LCD: DB5 */
               
"P8.13",       /* LCD: DB4 */
               
"P8.12",       /* LCD: RS */
               
"P8.11";       /* LCD: E */


        fragment@0
{
                target
= <&am33xx_pinmux>;
                __overlay__
{

                        bone_hd47780_lcd_pins
: pinmux_bone_adafruit_lcd_pins {
                                pinctrl
-single,pins = <
                                       
0x038 0x17      /* GPIO1_14, OUTPUT_PULLUP | MODE7 */
                                       
0x03c 0x17      /* GPIO1_15, OUTPUT_PULLUP | MODE7 */
                                       
0x028 0x17      /* GPIO0_26, OUTPUT_PULLUP | MODE7 */
                                       
0x024 0x17      /* EHRPWM2B, OUTPUT_PULLUP | MODE7 */
                                       
0x030 0x17      /* GPIO1_12, OUTPUT_PULLUP | MODE7 */
                                       
0x034 0x17      /* GPIO1_13, OUTPUT_PULLUP | MODE7 */
                               
>;
                       
};

               
};
       
};

};

Here's one which loads and unloads fine:
root@beaglebone:/lib/firmware# cat bone_pwm_P8_13-00A0.dts
/*
 * Copyright (C) 2013 CircuitCo
 * Copyright (C) 2013 Texas Instruments
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

/dts-v1/;
/plugin/;

/ {
        compatible
= "ti,beaglebone", "ti,beaglebone-black";

       
/* identification */
        part
-number = "bone_pwm_P8_13";
        version
= "00A0";

       
/* state the resources this cape uses */
        exclusive
-use =
               
/* the pin header uses */
               
"P8.13",                /* pwm: ehrpwm2B */
               
/* the hardware IP uses */
               
"ehrpwm2B";

        fragment@0
{
                target
= <&am33xx_pinmux>;
                __overlay__
{
                        pwm_P8_13
: pinmux_pwm_P8_13_pins {
                                pinctrl
-single,pins = <0x024  0x4>; /* P8_13 (ZCZ ball T10) | MODE 4 */
                       
};
               
};
       
};

        fragment@1
{
                target
= <&ocp>;
                __overlay__
{
                        pwm_test_P8_13
{
                                compatible      
= "pwm_test";
                                pwms            
= <&ehrpwm2 1 500000 1>;
                                pwm
-names       = "PWM_P8_13";

                                pinctrl
-names   = "default";
                                pinctrl
-0       = <&pwm_P8_13>;

                                enabled        
= <1>;
                                duty            
= <0>;
                                status          
= "okay";
                       
};
               
};
       
};
};

pushu...@gmail.com

unread,
Jan 23, 2014, 1:36:03 PM1/23/14
to beagl...@googlegroups.com, pushu...@gmail.com
I got an overlay working:
beaglebone:~/boneDeviceTree-master/overlay$ cat hd44780.dts
/*
* Copyright (C) 2012 Texas Instruments Incorporated - http://www.ti.com/

*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Purpose License Version 2 as

* published by the Free Software Foundation
*
* Original from: github.com/jadonk/validation-scripts/blob/master/test-capemgr/
*
* Modified by Derek Molloy for the example on www.derekmolloy.ie
* that maps GPIO pins for the example
*/


/dts-v1/;
/plugin/;

/{
       compatible
= "ti,beaglebone", "ti,beaglebone-black";

       part
-number = "hd44780";
       version
= "00A0";


       fragment@0
{
             target
= <&am33xx_pinmux>;

             __overlay__
{

                  pinctrl_hd44780
: hd44780_pins {
                        pinctrl
-single,pins = <
                                       
0x038 0x17
                                       
0x03c 0x17
                                       
0x028 0x17
                                       
0x024 0x17
                                       
0x030 0x17
                                       
0x034 0x17
                       
>;

                 
};
             
};
       
};

       fragment@1
{
                target
= <&ocp>;
                __overlay__
{

                        test_helper
: helper {
                                compatible
= "bone-pinmux-helper";
                                pinctrl
-names = "default";
                                pinctrl
-0 = <&pinctrl_hd44780>;
                                status
= "okay";
                       
};
               
};
       
};
};

Hasn't solved my problem with the LCD code, however.

Reply all
Reply to author
Forward
0 new messages