You are also using the wrong alt function numbers. You do need alt function 0 (PWM0_CHAN0 & 1) on GPIOs 12 & 13, and alt function 3 (PMW0_CHAN2 & 3) on GPIOs 18 & 19, but you are working in the wrong number space.
One translation is required because the overlay is using the legacy "brcm,function" style of declaration, and the RP1 pinctrl driver tries to find RP1 functions that are equivalent to those that appear on BCM2711. Compare:andBoth use ALT0 for PWM0 and GPIOs 12 & 13, but where RP1 uses ALT3 for PWM0 on GPIOs 18 & 19, BCM2711 uses ALT5.
The other translation is required because the "brcm,function" holds the numeric value used to select each alt function, and on the BCM2835 family of SoCs the values 0 and 1 are used for GPIO_INPUT and GPIO_OUTPUT. The values 4-7 encode ALT0-ALT3, 3 is ALT4 and 2 is ALT5 (sic). The correct numeric value for PWM on GPIOs 12 & 13 is therefore 4, and 2 for PWM on GPIOs 18 & 19.
New-style declarations use pin/gpio names and named functions (e.g. "pwm0"), but it is harder to change the affected pins from an overlay parameter.
One translation is required because the overlay is using the legacy "brcm,function" style of declaration, and the RP1 pinctrl driver tries to find RP1 functions that are equivalent to those that appear on BCM2711. Compare:
Code:
$ pinctrl -c rp1 funcs 12-13,18-1912, GPIO12, PWM0_CHAN0, DPI_D8, TXD4, SDA2, AAUD_LEFT, SYS_RIO012, PROC_RIO012, PIO12, SPI5_CE013, GPIO13, PWM0_CHAN1, DPI_D9, RXD4, SCL2, AAUD_RIGHT, SYS_RIO013, PROC_RIO013, PIO13, SPI5_SIO118, GPIO18, SPI1_CE0, DPI_D14, I2S0_SCLK, PWM0_CHAN2, I2S1_SCLK, SYS_RIO018, PROC_RIO018, PIO18, GPCLK119, GPIO19, SPI1_MISO, DPI_D15, I2S0_WS, PWM0_CHAN3, I2S1_WS, SYS_RIO019, PROC_RIO019, PIO19, -
Code:
$ pinctrl -c bcm2711 funcs 12-13,18-1912, GPIO12, PWM0_0, SD4, DPI_D8, SPI5_CE0_N, TXD5, SDA513, GPIO13, PWM0_1, SD5, DPI_D9, SPI5_MISO, RXD5, SCL518, GPIO18, PCM_CLK, SD10, DPI_D14, SPI6_CE0_N, SPI1_CE0_N, PWM0_019, GPIO19, PCM_FS, SD11, DPI_D15, SPI6_MISO, SPI1_MISO, PWM0_1
The other translation is required because the "brcm,function" holds the numeric value used to select each alt function, and on the BCM2835 family of SoCs the values 0 and 1 are used for GPIO_INPUT and GPIO_OUTPUT. The values 4-7 encode ALT0-ALT3, 3 is ALT4 and 2 is ALT5 (sic). The correct numeric value for PWM on GPIOs 12 & 13 is therefore 4, and 2 for PWM on GPIOs 18 & 19.
New-style declarations use pin/gpio names and named functions (e.g. "pwm0"), but it is harder to change the affected pins from an overlay parameter.
Statistics: Posted by PhilE — Wed Mar 06, 2024 4:18 pm