When I try `digitalio.DigitalInOut(board.A10)`, I get `ValueError: A10 in use`. This happens on the BlackPill board for pins A10, A11, A12, C14, C15.
For pins C14,C15, the reason might be here: https://github.com/adafruit/circuitpyth ... gpio.c#L41
For pins A10-A12, my guess is https://github.com/adafruit/circuitpyth ... /usb.c#L85
and/or https://github.com/adafruit/circuitpyth ... gpio.c#L36
Should I try to "hack" these parts of the code as a workaround? Or are there some makefile options? Or maybe even CirctuitPython commands to deinit/release those pins?
Thanks!
Pins "in use" right from the start on STM32
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- rgbapcb
- Posts: 3
- Joined: Sun Jul 03, 2022 11:24 pm
Re: Pins "in use" right from the start on STM32
I got access to pins C14, C15 by commenting out https://github.com/adafruit/circuitpyth ... .c#L43-L44
Pins A11, A12 are in use by USB, I don't need them for other purposes.
But how do I prevent pin A10 from being "in use"? https://github.com/adafruit/circuitpyth ... /usb.c#L81 says that pin A10 gets occupied by USB_OTG_FS_ID. How do I prevent precisely that? Adding `#define BOARD_NO_USB_OTG_ID_SENSE (1)` to the board-specific mpconfigboard.h such as https://github.com/adafruit/circuitpyth ... figboard.h causes the device to appear as "Unknown USB Device (Device Descriptor Request Failed)" in Device Manager in Windows 10, and no REPL connection.
Pins A11, A12 are in use by USB, I don't need them for other purposes.
But how do I prevent pin A10 from being "in use"? https://github.com/adafruit/circuitpyth ... /usb.c#L81 says that pin A10 gets occupied by USB_OTG_FS_ID. How do I prevent precisely that? Adding `#define BOARD_NO_USB_OTG_ID_SENSE (1)` to the board-specific mpconfigboard.h such as https://github.com/adafruit/circuitpyth ... figboard.h causes the device to appear as "Unknown USB Device (Device Descriptor Request Failed)" in Device Manager in Windows 10, and no REPL connection.
- rgbapcb
- Posts: 3
- Joined: Sun Jul 03, 2022 11:24 pm
Re: Pins "in use" right from the start on STM32
Actually, the hack allows pins C14, C15 to not throw the "in use" error anymore, but using them among the `row_pins` of `keypad.KeyMatrix()` prevents the key matrix from detecting any events, also from other pins. The condition `if key_matrix.events.get()` is never triggered. Without using pins C14 and C15, it works.
Please be positive and constructive with your questions and comments.