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

[BUG] Enabling pan causes error code 10 #1028

Open
Glodigit opened this issue Sep 5, 2024 · 10 comments
Open

[BUG] Enabling pan causes error code 10 #1028

Glodigit opened this issue Sep 5, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@Glodigit
Copy link

Glodigit commented Sep 5, 2024

Describe the bug
In boot.py, I have added the following:

from kmk.bootcfg import bootcfg
import board
bootcfg(    sense  = board.ROW0,
            source = board.COL0,
            pan    = True,
            )

Unlike enabling nkro, when enabling pan, Windows 10 reports a USB descriptor error:
image

This device cannot start. (Code 10)
An unknown item was found in the report descriptor.

Problem Status:
{EXCEPTION}
Illegal Instruction
An attempt was made to execute an illegal instruction.
C000001D

Thus, no HID reports are processed.

To Reproduce
Steps to reproduce the behavior:

  • Enable pan or pan + nkro
  • Input: AX.P.move()

Debug output
If pan is enabled:

Traceback (most recent call last):
  File "kmk/kmk_keyboard.py", line 448, in go
  File "kmk/kmk_keyboard.py", line 483, in _init
  File "kmk/kmk_keyboard.py", line 296, in _init_hid
  File "kmk/hid.py", line 276, in __init__
  File "kmk/hid.py", line 68, in __init__
  File "kmk/hid.py", line 285, in hid_send
OSError: USB busy

If both nkro and pan are enabled:

kmk.hid: use NKRO
kmk.hid: use pan
...
kmk.keyboard: keys_pressed={MouseKey(code=1)}
kmk.hid: send: OSError: USB busy
kmk.keyboard: axes={Axis(code=3, delta=-8)}
kmk.hid: send: OSError: USB busy

Additional context
Using

  • Circuitpython 9.1.2
  • Pog 1.5.2
  • Windows 10
@Glodigit Glodigit added the bug Something isn't working label Sep 5, 2024
@JamesToBoot
Copy link

JamesToBoot commented Sep 5, 2024

Hey there,
Is circuitpython 9x now working? Do you have issues when you use 8x?

@Glodigit
Copy link
Author

Glodigit commented Sep 5, 2024

I've never used 8x

@JamesToBoot
Copy link

what to give it a try? Most MCUs have 8x available on circuitpython.org/downloads

@Glodigit
Copy link
Author

Glodigit commented Sep 6, 2024

I've got a custom keyboard I reverse engineered. It seems based on a Raspberry Pi Pico.
9.1.2 is the only version I've successfully compiled the .uf2 for, and it took multiple days to get to that point.

I'd also like to add that only enabling NKRO works.

@JamesToBoot
Copy link

There are a lot of pi pico clones that are supported by CircuitPython. Attach a pic of your MCU (front and back).

It may be that there is no compiling involved. Just a download and copy.

@xs5871
Copy link
Collaborator

xs5871 commented Sep 7, 2024

There's no indication that the CircuitPython version is to blame here and there is no reason to suggest a downgrade as the first course of action.

@Glodigit
Copy link
Author

Glodigit commented Sep 7, 2024

I can only get access to the back:
image

  • There's no SMD components on the other side.
  • RP2040 as the MCU
  • 2MB W25Q16JV flash chip
  • LED on GP0, not GP25 like the Pico

I'll see if I can get 8.2.10 .uf2 compiled, since I've also been getting MemoryError: memory allocation failed, allocating 1280 bytes recently (it's always 1280 bytes) and one of the v9.0.0 notes is New split-heap internal dynamic storage mechanism. Some CircuitPython programs may fail with MemoryError..

@Glodigit
Copy link
Author

Glodigit commented Sep 7, 2024

8.2.x does not affect the pan bug.
(it has fixed MemoryError though)
I've also tried 9.1.3 with no change.

@claycooper
Copy link
Member

Is this what you're building? Are you using the files they provide or building your own?

@Glodigit
Copy link
Author

Glodigit commented Sep 7, 2024

That's the project page I created where I document my findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants