User LEDs on the BeagleBone Black Rev. C

On mainline, just a change on macro’s… Same pins..

What issue are you seeing?

Regards,

well when i make the changes to a fresh install of 5.10 it errors when i run the first make command in the 5.10-ti directory. its complaining about the changes i made .. hmm i will have to revisit and i will post errors .. for give me as my memory has fogged a bit over the last 6 years.

Good News Every One !!

seams i dint have my overlay in the right place.. so plz forgive me however i did simplify this to some notes i would like to share seams this topic has some views maybe might help others .. including older me! :slight_smile:


Moving User LEDS to P8_8;10;12;14




remap user LED's

Beaglebone Black P8 Header chart
https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP8HeaderTable.pdf
Beaglebone Black P9 Header Chart
https://github.com/derekmolloy/boneDeviceTree/blob/master/docs/BeagleboneBlackP9HeaderTable.pdf

Make Backup
sudo cp /opt/source/dtb-4.14-ti/src/arm/am335x-bone-common.dtsi /opt/source/dtb-4.14-ti/src/arm/am335x-bone-common.dtsi.backup

Edit File
sudo nano /opt/source/dtb-5.10-ti/src/arm/am335x-bone-common.dtsi


-----------------------

                led2 {
                        label = "beaglebone:green:usr0";
//                      gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
                        gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>;            /* P8_8  */
                        linux,default-trigger = "heartbeat";
                        default-state = "off";
                };

                led3 {
                        label = "beaglebone:green:usr1";
//                      gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
                        gpios = <&gpio2 4 GPIO_ACTIVE_HIGH>;            /* P8_10 */
                        linux,default-trigger = "mmc0";
                        default-state = "off";
                };

                led4 {
                        label = "beaglebone:green:usr2";
//                      gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
                        gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;           /* P8_12 */
                        linux,default-trigger = "cpu0";
                        default-state = "off";
                };

                led5 {
                        label = "beaglebone:green:usr3";
//                      gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
                        gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;           /* P8_14 */
                        linux,default-trigger = "mmc1";
                        default-state = "off";
                };

---------------------

refer to header charts for correct pinmux for the pins and make changes in the leds section as well as the pinmux section just below the leds section.

---------------------

        user_leds_s0: user_leds_s0 {
                pinctrl-single,pins = <
//                      AM33XX_PADCONF(AM335X_PIN_GPMC_A5, PIN_OUTPUT_PULLDOWN, MUX_MODE7)      /* gpmc_a5.gpio1_21 */
//                      AM33XX_PADCONF(AM335X_PIN_GPMC_A6, PIN_OUTPUT_PULLUP, MUX_MODE7)        /* gpmc_a6.gpio1_22 */
//                      AM33XX_PADCONF(AM335X_PIN_GPMC_A7, PIN_OUTPUT_PULLDOWN, MUX_MODE7)      /* gpmc_a7.gpio1_23 */
//                      AM33XX_PADCONF(AM335X_PIN_GPMC_A8, PIN_OUTPUT_PULLUP, MUX_MODE7)        /* gpmc_a8.gpio1_24 */
                        AM33XX_PADCONF(0x894, PIN_OUTPUT_PULLUP, MUX_MODE7)        /* P8_8  */
                        AM33XX_PADCONF(0x898, PIN_OUTPUT_PULLDOWN, MUX_MODE7)      /* P8_10 */
                        AM33XX_PADCONF(0x830, PIN_OUTPUT_PULLUP, MUX_MODE7)        /* P8_12 */
                        AM33XX_PADCONF(0x828, PIN_OUTPUT_PULLUP, MUX_MODE7)        /* P8_14 */
                >;
        };


---------------------



enter directory to build new files
cd /opt/source/dtb-5.10-ti/

sudo make clean
sudo make
sudo make install

setup an overlay
create a new cape file and add your data
sudo nano /opt/source/bb.org-overlays/src/arm/BB-BONE-MOVED-USER-LEDS.dts

---------------------

/* /opt/source/bb.org-overlays/src/arm/BB-BONE-MOVED-USER-LEDS.dts */

/dts-v1/;
/plugin/;

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

        /* identification */
        part-number = "BB-BONE-MOVED-USER-LEDS";
        version = "00A0";

        /*
         * Free up the pins to be used by the USER LED's from the pinmux helpers.
         */
        fragment@0 {
                target = <&ocp>;
                __overlay__ {
                        P8_08_pinmux { status = "disabled"; };   /* P8_8:  Moved User LED's USER1 Heartbeat */
                        P8_10_pinmux { status = "disabled"; };   /* P8_10: Moved User LED's USER2 Sd Card   */
                        P8_12_pinmux { status = "disabled"; };   /* P8_12: Moved User LED's USER3 Kernel    */
                        P8_14_pinmux { status = "Disabled"; };   /* P8_14: Moved User LED's USER3 eMMC      */
                };
        };

};

---------------------

6.) Change directory
cd /opt/source/bb.org-overlays

7.) Make
sudo make -d src/arm/BB-BONE-MOVED-USER-LEDS.dtbo

8.) Install
sudo ./install.sh

9.) Edit uEnv.txt
sudo nano /boot/uEnv.txt

add this to the ###Custom Cape section

dtb_overlay=/lib/firmware/BB-BONE-MOVED-USER-LEDS.dtbo

uncomment 

disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1


10.) reboot and cross fingers..... :wink:

1 Like

this is gold to me :slight_smile: