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

rp2040-zero not correctly handled #2260

Open
LeonHagenaarsKeus opened this issue Jun 7, 2022 · 7 comments · May be fixed by #2263
Open

rp2040-zero not correctly handled #2260

LeonHagenaarsKeus opened this issue Jun 7, 2022 · 7 comments · May be fixed by #2263

Comments

@LeonHagenaarsKeus
Copy link

What were you trying to do?

Edit code on a WaveShare rp2040-zero running CircuitPython

What steps did you take to trigger the issue?

  • Open MU editor
  • Switch to rp2040 mode
  • Restart MU editor
    • MU suggests that it detects a CircuitPython device, asks to switch to CircuitPython mode
  • Press OK
    • MU complains:
      image

What did you expect to happen?

A working editor in CircuitPython mode on the waveshare rp2040-zero

What actually happened?

An editor working with a local folder (not the circuitpython device)

Operating System Version

Windows 11 21H2 build 22000.708

Mu Version

1.1.1

Other Info

Using version below as requested in mu-editor/crash-reports#148:
https://github.com/mu-editor/mu/actions/runs/2444128277

Editor Log

mu.log

@carlosperate
Copy link
Member

Hi @LeonHagenaarsKeus,

Thanks for opening the separate GitHub issue.

How does your CircuitPython device mount itself in the operating system? Is the device name CIRCUITPY? What drive letter does it have?
What build of CircuitPython is it running?

@dhalbert
Copy link
Contributor

dhalbert commented Jun 7, 2022

It looks like it was detected and then was lost five seconds later:

2022-06-07 12:51:39,497 - mu.interface.main:1072(show_confirmation) DEBUG: Detected new CircuitPython board device.
2022-06-07 12:51:39,497 - mu.interface.main:1073(show_confirmation) DEBUG: Would you like to change Mu to the CircuitPython mode?
2022-06-07 12:51:44,649 - mu.modes.base:61(get_default_workspace) INFO: Using workspace C:\Users\Leon Hagenaars-Keus\mu_code from settings file
2022-06-07 12:51:44,651 - mu.interface.main:1044(show_message) DEBUG: Could not find an attached CircuitPython device.

@carlosperate
Copy link
Member

Without having a deep look I think the detection that asks the user to change the mode (via adafruit_board_toolkit using pyserial and USB data) is probably different than the detection that tries to configure Mu to save code into the CircuitPython MSD drive, which checks the volume name via Windows C apis.

@LeonHagenaarsKeus
Copy link
Author

Hi @dhalbert

  • Device name: PIDOXL
    (I'm creating my own 'ergodox' based keyboard with a rp2040, the L makes KMK recognize it's the left part of a split keyboard)
  • Mount point: D:
  • boot_out.txt (Which includes the CircuitPython version and board ID, in case it helps):
Adafruit CircuitPython 7.3.0 on 2022-05-23; Waveshare RP2040-Zero with rp2040
Board ID:waveshare_rp2040_zero

@carlosperate
Copy link
Member

  • Device name: PIDOXL

Right, that'd be the reason. Mu expects the CircuitPython devices to have CIRCUITPY as the volume name.

I'm not too familiar with the general guidelines for making your own CircuitPython devices, is the current recommendation to change the drive volume name? Is it up to be board designer? or maybe there isn't any guidelines in this area?

@LeonHagenaarsKeus
Copy link
Author

LeonHagenaarsKeus commented Jun 7, 2022

No, CircuitPython doesn't suggest this, KMK does suggest it in order to enable autodetection of split keyboards. Having different names also helps me detect which code is going to which side.

https://github.com/KMKfw/kmk_firmware/blob/master/docs/split_keyboards.md#ee-hands

The name out of the box was CIRCUITPY. Mu does detect the serial port, so I can use it for serial communication out of the box.
Maybe being able to choose the device by hand (or putting a .mu file on the device) might be an option for those who want/need to change the name?

Perhaps detecting a code.py in the root of a drive might also be an option? (Installing CircuitPython will create a code.py file with 'hello-world'-like content)

@LeonHagenaarsKeus
Copy link
Author

boot_out.txt is generated at each connect, this file does contain the string 'CircuitPython', so maybe it can be used for the same check?

@LeonHagenaarsKeus LeonHagenaarsKeus linked a pull request Jun 11, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

3 participants