Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use GPIO_B2 #4

Open
pojiro opened this issue Mar 7, 2022 · 0 comments
Open

Can't use GPIO_B2 #4

pojiro opened this issue Mar 7, 2022 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@pojiro
Copy link
Contributor

pojiro commented Mar 7, 2022

We cannot use it. Because GPIO_B2 is already used for UART4_RX, ttySTM0.


iex(12)> {:ok, gpio} = Circuits.GPIO.open(18, :output)
** (MatchError) no match of right hand side value: {:error, :export_failed}

iex(29)> {:ok, gpio} = Circuits.GPIO.open(18, :input)
** (MatchError) no match of right hand side value: {:error, :export_failed}

The serial output at this time is as follows

[  628.569771] stm32mp157-pinctrl soc:pin-controller@50002000: pin PB2 already requested by 40010000.serial; cannot claim for GPIOB:18
[  628.580319] stm32mp157-pinctrl soc:pin-controller@50002000: pin-18 (GPIOB:18) status -22
Error writing '18' to /sys/class/gpio/export

Going back to the boot log, we find the following, which are already in use

[    2.069453] stm32-usart 40010000.serial: rx dma alloc failed
[    2.069488] stm32-usart 40010000.serial: interrupt mode used for rx (no dma)
[    2.069508] stm32-usart 40010000.serial: tx dma alloc failed
[    2.069525] stm32-usart 40010000.serial: interrupt mode used for tx (no dma)
[    2.069565] 40010000.serial: ttySTM0 at MMIO 0x40010000 (irq = 31, base_baud = 4000000) is a stm32-usart
[    3.170536] printk: console [ttySTM0] enabled

40010000.serial is uart4 on the schematic. We can see that GPIO_B2 = QSPI_CLK = UART4_RX.

@pojiro pojiro added the documentation Improvements or additions to documentation label Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant