This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3358: Configuring GPIO0 on Beaglebone Black

Part Number: AM3358

Tool/software: Linux

I'd like to use gpio0_2 and gpio0_3 within beagle bone black.

There was a thread (e2e.ti.com/.../623030) suggesting to have a look at u-boot. So I removed anything regarding SPI0 from u-boot, but after rebooting  the function (/sys/kernel/debug/pinctrl/44e10800.pinmux/pins) is still 20 instead of 2f:

pin 84 (PIN84) 44e10950 00000020 pinctrl-single
pin 85 (PIN85) 44e10954 00000020 pinctrl-single

all other pins i use 

gpio2_22
gpio2_23
gpio2_24
gpio2_25
gpio2_1
gpio2_12
gpio1_16
gpio1_17
gpio1_18
gpio1_19
gpio0_14
gpio0_10

are working as expected (2f).

How can I bring gpio0_3 alive?

Regards

Armin

  • Hello Armin,

    Which Processor SDK version are you using?

    Best regards,
    Kemal
  • Hi Kemal,

    PROCESSOR-SDK-LINUX-AM335X v04.02

    Best regards
    Armin
  • You are not pinmuxing them anywhere, so that they stay on their default pinmux state. Change uart2_pin_mux[] in <Processor SDK>/board-support/u-boot-<version>/board/ti/am335x/mux.c

    from

    static struct module_pin_mux uart2_pin_mux[] = {
    	{OFFSET(spi0_sclk), (MODE(1) | PULLUP_EN | RXACTIVE)},	/* UART2_RXD */
    	{OFFSET(spi0_d0), (MODE(1) | PULLUDEN)},		/* UART2_TXD */
    	{-1},
    };

    to

    static struct module_pin_mux uart2_pin_mux[] = {
    	{OFFSET(spi0_sclk), (MODE(7) | PULLUDDIS | RXACTIVE)},		/* GPIO0_2 */
    	{OFFSET(spi0_d0), (MODE(7) | PULLUDDIS | RXACTIVE)},		/* GPIO0_3 */
    	{-1},
    };

    and add configure_module_pin_mux(uart2_pin_mux); to

    void enable_uart0_pin_mux(void)
    {
    	configure_module_pin_mux(uart0_pin_mux);
    	configure_module_pin_mux(uart2_pin_mux);
    }

    and you will see these pins pinmuxed as 2f

  • Dear Kemal,

    it works, but I think its a rather quick and dirty solution.

    I was expecting, my dtb file (am335x-boneblack.dtb) will take care of the pinmuxing stuff. Like it does with all other pins. Just those 2 where not involved. Or where all other pins muxed by the u-boot expect those 2?

    Where should the pinmuxing take place? In U-Boot or DTB file?

    I'd like to understand it and any explanation or documentation would be appreciated.

    Best regards

    Armin

  • I gave you just an example to prove why are you not seeing these pins as 2f. Please, read this article and find the cleanest pinmux method which will suit your requirement.