MicroPython PyCharm 2021.3.3 插件权限错误

发布于 2025-01-15 20:56:32 字数 1242 浏览 2 评论 0原文

我试图在 PyCharm 2021.3.3 上设置 MicroPython,不幸的是我无法成功将我的板连接到 IDE。我正在尝试使用工具>>MicroPython>>MicroPython REPL:

Found the device, but could not connect via port 'COM4': could not open port 'COM4': PermissionError(13, 'Odmowa dostępu.', None, 5)
I'm not sure what to suggest. :-(
Press ENTER to continue

然后我尝试刷新简单的程序来控制,尽管之前有错误,但它吐出:

Connecting to COM4
Traceback (most recent call last):
  File "C:\Users\reczul\AppData\Roaming\JetBrains\PyCharm2021.3\plugins\intellij-micropython\scripts\microupload.py", line 139, in <module>
    main(sys.argv[1:])
  File "C:\Users\reczul\AppData\Roaming\JetBrains\PyCharm2021.3\plugins\intellij-micropython\scripts\microupload.py", line 56, in main
    board = Pyboard(port)
  File "C:\Users\reczul\PycharmProjects\pythonProject1\venv\lib\site-packages\ampy\pyboard.py", line 147, in __init__
    raise PyboardError('failed to access ' + device)
ampy.pyboard.PyboardError: failed to access COM4

我能做些什么来修复此错误?

我使用过的示例代码:

from machine import Pin, Timer

led = Pin(25, Pin.OUT)
tim = Timer()
def tick(timer):
    global led
    led.toggle()

tim.init(freq=2.5, mode=Timer.PERIODIC, callback=tick)```

I was trying to set up MicroPython on PyCharm 2021.3.3, unfortunately I was not able to successfully connect my board to IDE. I'm getting trying to use tools>>MicroPython>>MicroPython REPL:

Found the device, but could not connect via port 'COM4': could not open port 'COM4': PermissionError(13, 'Odmowa dostępu.', None, 5)
I'm not sure what to suggest. :-(
Press ENTER to continue

Then I have tried to flush simple program to control despite previous error and it spits out:

Connecting to COM4
Traceback (most recent call last):
  File "C:\Users\reczul\AppData\Roaming\JetBrains\PyCharm2021.3\plugins\intellij-micropython\scripts\microupload.py", line 139, in <module>
    main(sys.argv[1:])
  File "C:\Users\reczul\AppData\Roaming\JetBrains\PyCharm2021.3\plugins\intellij-micropython\scripts\microupload.py", line 56, in main
    board = Pyboard(port)
  File "C:\Users\reczul\PycharmProjects\pythonProject1\venv\lib\site-packages\ampy\pyboard.py", line 147, in __init__
    raise PyboardError('failed to access ' + device)
ampy.pyboard.PyboardError: failed to access COM4

What can I do to fix this error?

The sample code I have used:

from machine import Pin, Timer

led = Pin(25, Pin.OUT)
tim = Timer()
def tick(timer):
    global led
    led.toggle()

tim.init(freq=2.5, mode=Timer.PERIODIC, callback=tick)```

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

淡墨 2025-01-22 20:56:33

假设您使用的是 Pi Pico。

您很可能会收到此错误,因为您在插入设备时按下了“BOOTSEL”按钮。

将 UF2 文件拖到设备上,设备应该会重新启动。
这次不要拔掉设备插头并按住“BOOTSEL”。

现在走应该很好。

Assuming you are using a Pi Pico.

You are most likely getting this error because you pressed the 'BOOTSEL' button while plugging your device in.

Drag your UF2 file onto the device, it should reboot.
Don't unplug the device and hold the 'BOOTSEL' this time.

It should be good to go now.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文