maxgerhardt / platform-raspberrypi

Raspberry Pi: development platform for PlatformIO
Apache License 2.0
94 stars 46 forks source link

Please help, error installing... #52

Closed realZnS closed 2 months ago

realZnS commented 5 months ago

I've followed the instructions on https://arduino-pico.readthedocs.io/en/latest/platformio.html trying to install this core on windows.

platformio.ini

platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = pico
framework = arduino
board_build.core = earlephilhower
build_flags =
  -DUSE_TINYUSB

I tried pio pkg install -p https://github.com/maxgerhardt/platform-raspberrypi.git, and the error logs are below.

......
Submodule path 'pico-sdk/lib/tinyusb/tools/uf2/hidapi': checked out 'a6a622ffb680c55da0de787ff93b80280498330f'
Submodule path 'tools/libbearssl/bearssl': checked out 'f294aa022f82833941ffdf3b0f306c2072e3a26c'
Submodule path 'tools/pyserial': checked out '0e7634747568547b8a7f9fd0c48ed74f16af4b23'
[WinError 3] 系统找不到指定的路径。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt\\rt-thread\\components\\vmm\\linux_patch-v3.8\\0001-RTT-VMM-implement-dual-system-running-on-realview-pb.patch'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307\Application\8_uarts_server\RT-Thread\uart_server_rtt\rt-thread\components\vmm\linux_patch-v3.8\0001-RTT-VMM-implement-dual-system-running-on-realview-pb.patch`
[WinError 3] 系统找不到指定的路径。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt\\rt-thread\\components\\vmm\\linux_patch-v3.8\\0002-arm-gic-correct-the-cpu-map-on-gic_raise_softirq-for.patch'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307\Application\8_uarts_server\RT-Thread\uart_server_rtt\rt-thread\components\vmm\linux_patch-v3.8\0002-arm-gic-correct-the-cpu-map-on-gic_raise_softirq-for.patch`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt\\rt-thread\\components\\vmm\\linux_patch-v3.8'       
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307\Application\8_uarts_server\RT-Thread\uart_server_rtt\rt-thread\components\vmm\linux_patch-v3.8`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt\\rt-thread\\components\\vmm'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307\Application\8_uarts_server\RT-Thread\uart_server_rtt\rt-thread\components\vmm`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt\\rt-thread\\components'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307\Application\8_uarts_server\RT-Thread\uart_server_rtt\rt-thread\components`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt\\rt-thread'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307\Application\8_uarts_server\RT-Thread\uart_server_rtt\rt-thread`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307\Application\8_uarts_server\RT-Thread\uart_server_rtt`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307\Application\8_uarts_server\RT-Thread`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307\Application\8_uarts_server`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307\Application`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch\ch32v307`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu\wch` 
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw\mcu`     
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw'

Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb\hw`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb' 
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib\tinyusb`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib'
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk\lib`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk' 
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou\pico-sdk`
[WinError 145] 目录不是空的。: 'C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou' 
Please manually remove the file `C:\Users\realzns\.platformio\.cache\tmp\pkg-installing-dnthw2ou`
Error: Traceback (most recent call last):
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\__main__.py", line 103, in main
    cli()  # pylint: disable=no-value-for-parameter
    ^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\click\core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\click\core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\cli.py", line 85, in invoke
    return super().invoke(ctx)
           ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\click\core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\click\core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\click\core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\package\commands\install.py", line 68, in package_install_cmd
    install_project_dependencies(options)
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\package\commands\install.py", line 107, in install_project_dependencies
    already_up_to_date = not install_project_env_dependencies(env, options)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\package\commands\install.py", line 119, in install_project_env_dependencies
    _install_project_env_custom_platforms(project_env, options)
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\package\commands\install.py", line 169, in _install_project_env_custom_platforms
    pm.install(
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\package\manager\platform.py", line 62, in install
    p.install_required_packages(force=force)
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\platform\_packages.py", line 76, in install_required_packages
    self.install_package(name, force=force)
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\platform\_packages.py", line 70, in install_package        
    return self.pm.install(spec or self.get_package_spec(name), force=force)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\package\manager\_install.py", line 47, in install
    pkg = self._install(spec, skip_dependencies=skip_dependencies, force=force)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\package\manager\_install.py", line 97, in _install
    pkg = self.install_from_uri(spec.uri, spec)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\package\manager\_install.py", line 200, in install_from_uri
    return self._install_tmp_pkg(pkg_item)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\penv\Lib\site-packages\platformio\package\manager\_install.py", line 292, in _install_tmp_pkg
    shutil.copytree(tmp_pkg.path, dst_pkg.path, symlinks=True)
  File "C:\Users\realzns\.platformio\python3\Lib\shutil.py", line 561, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\realzns\.platformio\python3\Lib\shutil.py", line 515, in _copytree
    raise Error(errors)
shutil.Error: [('C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt\\rt-thread\\components\\vmm\\linux_patch-v3.8\\0001-RTT-VMM-implement-dual-system-running-on-realview-pb.patch', 'C:\\Users\\realzns\\.platformio\\packages\\framework-arduinopico\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt\\rt-thread\\components\\vmm\\linux_patch-v3.8\\0001-RTT-VMM-implement-dual-system-running-on-realview-pb.patch', "[Errno 2] No such file or directory: 'C:\\\\Users\\\\realzns\\\\.platformio\\\\.cache\\\\tmp\\\\pkg-installing-dnthw2ou\\\\pico-sdk\\\\lib\\\\tinyusb\\\\hw\\\\mcu\\\\wch\\\\ch32v307\\\\Application\\\\8_uarts_server\\\\RT-Thread\\\\uart_server_rtt\\\\rt-thread\\\\components\\\\vmm\\\\linux_patch-v3.8\\\\0001-RTT-VMM-implement-dual-system-running-on-realview-pb.patch'"), ('C:\\Users\\realzns\\.platformio\\.cache\\tmp\\pkg-installing-dnthw2ou\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt\\rt-thread\\components\\vmm\\linux_patch-v3.8\\0002-arm-gic-correct-the-cpu-map-on-gic_raise_softirq-for.patch', 'C:\\Users\\realzns\\.platformio\\packages\\framework-arduinopico\\pico-sdk\\lib\\tinyusb\\hw\\mcu\\wch\\ch32v307\\Application\\8_uarts_server\\RT-Thread\\uart_server_rtt\\rt-thread\\components\\vmm\\linux_patch-v3.8\\0002-arm-gic-correct-the-cpu-map-on-gic_raise_softirq-for.patch', "[Errno 2] No such file or directory: 'C:\\\\Users\\\\realzns\\\\.platformio\\\\.cache\\\\tmp\\\\pkg-installing-dnthw2ou\\\\pico-sdk\\\\lib\\\\tinyusb\\\\hw\\\\mcu\\\\wch\\\\ch32v307\\\\Application\\\\8_uarts_server\\\\RT-Thread\\\\uart_server_rtt\\\\rt-thread\\\\components\\\\vmm\\\\linux_patch-v3.8\\\\0002-arm-gic-correct-the-cpu-map-on-gic_raise_softirq-for.patch'")]

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `python -m pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq/index.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================
realZnS commented 5 months ago

And there is a wired situation: even with the errors above, I can still successfully build and upload my codes to pico, but not fully functional. For example, I copied this code to main.cpp, and no usb hid gamepad showed up in device manager at all. I tried the same code in Arduino IDE with this core, and it is fully functional as expected.

nWestie commented 4 months ago

It appears you did not successfully enable longpaths in windows, as described in the instructions you followed for arduino-pico

Depending what version of windows you are using, you might need to find another way to enable longpaths in windows, gpedit.msc is not typically available on windows home.

I was able to use these instructions to get it done on windows 11

maxgerhardt commented 2 months ago

I'm gonna attribute this to not enabling long paths. We do document that on https://arduino-pico.readthedocs.io/en/latest/platformio.html#important-steps-for-windows-users-before-installing, but not here. Will add a note in the readme.

Done in https://github.com/maxgerhardt/platform-raspberrypi/commit/503933d536b4345e964b2dc5f04761e61edc9ed6.