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

upgrade CircuitPython #37

Open
fkpwolf opened this issue Jan 8, 2022 · 7 comments
Open

upgrade CircuitPython #37

fkpwolf opened this issue Jan 8, 2022 · 7 comments

Comments

@fkpwolf
Copy link

fkpwolf commented Jan 8, 2022

At most time, it works well on Windows 11. I even can see the left Battery volume. It is great.

But sometimes, when I am typing, Bluetooth got lost and I can't type anything. After a while, it connect again. I also noticed device status switched bettwen "paired" and "connected".

Wireless device: Wi-Fi 6 AX200.

Is there way to log error so we can debug and find root cause.

@fkpwolf
Copy link
Author

fkpwolf commented Jan 10, 2022

try to upgrade firmware by myself:

  1. https://circuitpython.org/board/makerdiary_m60_keyboard/ download latest firmware
  2. https://github.com/makerdiary/python-keyboard this is m60 keyboard module, aka main module
  3. https://github.com/adafruit/Adafruit_CircuitPython_BLE second module
    Then code can run. But sometimes failed:
code.py output:
Traceback (most recent call last):
  File "code.py", line 7, in <module>
  File "/lib/keyboard/__init__.py", line 97, in __init__
  File "/lib/keyboard/__init__.py", line 254, in set_bt_id
AttributeError: 'Keyboard' object has no attribute 'ble_hid'

And keyboard will not response even connects to USB. Ctl+D reload then it will ok. But if usb disconnect, can't connect BLE. At this time, UART reset so I didn't know what happened. It is bad design to debug by an emulated UART.

@fkpwolf
Copy link
Author

fkpwolf commented Jan 15, 2022

I upgraded Circuitpython to latest version 7.1. M60 works well when USB connected. But no response when USB disconnected and powered by battery. M60 goes to safe model?

Any clue on this issue? @xiongyihui

@fkpwolf fkpwolf changed the title Bluetooth not stable upgrade CircuitPython Feb 2, 2022
@fkpwolf
Copy link
Author

fkpwolf commented Mar 18, 2022

I just tried ZMK, so far so good. https://github.com/fkpwolf/zmk-config/actions

@hyx0329
Copy link

hyx0329 commented Jul 2, 2022

I picked up some changes from adafruit/circuitpython@main...xiongyihui:m60
with modifications to suits CPY 7.x, and compiled an experimental firmware (CPY v7.3.1).
The keyboard should work fine without usb connection. The matrix module is also ported.
Be aware the patches aren't suitable for upstreaming.

For anyone interested, please go to my repo.

@BarbUk
Copy link

BarbUk commented Jul 6, 2022

@hyx0329 Thanks for the new firmware.

Can you share some information about the process of building a new firmware (cf: #8)?

@hyx0329
Copy link

hyx0329 commented Jul 7, 2022

@BarbUk In order to build a new firmware, just follow the official document. You might want to read a different version of document, eg. here for CPY v7.3.x. After walking through the guide, you'll find UF2 file named as firmware.uf2 among the artifacts.

To summarize the whole building process:

  1. prepare environment (gcc toolchain and py stuff)
  2. prepare source code (root repo and submodules)
  3. compile mpy-cross
  4. modifiy target configurations (if any)
  5. compile firmware for the target board in the corresponding port directory (ports/nrf for M60 keyboard)

PS. my primary computer's OS is GNU/Linux

@hyx0329
Copy link

hyx0329 commented May 27, 2023

I upgraded Circuitpython to latest version 7.1. M60 works well when USB connected. But no response when USB disconnected and powered by battery. M60 goes to safe model?

Current upstream version doesn't preserve the state of the battery control pin(p0.28), which seems need to be addressed. That's why the keyboard won't work without a USB power.

Edit: this should be fixed in CircuitPython 8.2.0+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants