ARM-software / vscode-device-manager

Extension support for VS Code Device Manager Extension
https://marketplace.visualstudio.com/items?itemName=Arm.device-manager
Other
8 stars 1 forks source link

Device Manager Not Working on Windows Arm64 #6

Open ofoacimr opened 4 months ago

ofoacimr commented 4 months ago

Type: Bug Report

Describe the bug

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'Activity Bar' in VS Code

  2. Click on 'Device Manager'

  3. Click the Button 'Refresh Devices'

  4. See error

    Error running command device-manager.refresh: command 'device-manager.refresh' not found. This is likely caused by the extension that contributes device-manager.refresh.
  5. Go to 'Activity Bar' in VS Code

  6. Click on 'Device Manager'

  7. Click the Button 'Add Device' (the one besides the refresh button, not the blue one)

  8. See error

    Error running command device-manager.addDevice: command 'device-manager.addDevice' not found. This is likely caused by the extension that contributes device-manager.addDevice.
  9. Go to 'Activity Bar' in VS Code

  10. Click on 'Device Manager'

  11. Click the Button 'Add Device' (the blue one, not the one besides the refresh button)

  12. No response

Expected behavior

  1. Go to 'Activity Bar' in VS Code
  2. Click on 'Device Manager'
  3. Click the Button 'Add Device'
  4. The Command Palette appears, showing what's connected to choose from.

Code sample and logs

Screenshots

image_2024-02-23_22-21-28

Additional context

  1. I carefully compared this extension on Windows arm64 & x64 platform, and it is the same on every line of code.
  2. It works perfectly on Windows 11 x64.
  3. Disabling other extensions doesn't help.
  4. As this extension does not work, I cannot further test whether other Arm Keil Studio extensions are working as expected.
ofoacimr commented 4 months ago

Additional information:

Under %USERPROFILE%\.vscode\extensions\arm.device-manager-1.10.0\node_modules\usb\prebuilds\, there's only win32-ia32 and win32-x64, no arm64 binary for Windows.

thegecko commented 4 months ago

Thanks for your feedback @ofoacimr

You are right, there isn't a prebuilt binary for node-usb, so I've added one:

https://github.com/node-usb/node-usb/pull/735

Unfortunately I don't have access to a windows Arm machine to test this works, would you be able to?

You can grab the binary from the win32-arm64.zip artefact from the build here:

https://github.com/node-usb/node-usb/actions/runs/8026472128

ofoacimr commented 4 months ago

Thanks for your support @thegecko

I found the log, and there're several issues to solve.

This is the startup log with original extensions. → VS Code Startup.log

It reports two errors:

  1. [error] spawn %USERPROFILE%\.vscode\extensions\arm.keil-studio-pack-1.13.0-win32-arm64\tools\armlm\bin\armlm.exe ENOENT This is caused by the lack of file extension .exe for armlm, I think it should be reported to ARM-software/vscode-keil-studio-pack. 🤣🤣🤣

  2. [error] Activating extension 'Arm.device-manager' failed: No native build was found for platform=win32 arch=arm64 runtime=electron abi=118 uv=1 armv=8 libc=glibc node=18.17.1 electron=27.2.3 loaded from: %USERPROFILE%\.vscode\extensions\arm.device-manager-1.10.0\node_modules\@serialport\bindings-cpp So, this comes to serialport/bindings-cpp, it lacks Win32-arm64 prebuilt binary.

As the startup process stopped without loading node-usb, adding the binary you built won't change the log. → VS Code Startup with arm64 USB.log

Finally, renaming that armlm to armlm.exe could simply solve the first error. → VS Code Startup with arm64 USB & armlm.exe.log

thegecko commented 4 months ago

Thanks for your continued feedabck @ofoacimr

[error] spawn %USERPROFILE%.vscode\extensions\arm.keil-studio-pack-1.13.0-win32-arm64\tools\armlm\bin\armlm.exe ENOENT This is caused by the lack of file extension .exe for armlm, I think it should be reported to ARM-software/vscode-keil-studio-pack. 🤣🤣🤣

Yes, this is indeed a problem in the pack. @mcgordonite @federicobozzini could you investigate?

[error] Activating extension 'Arm.device-manager' failed: No native build was found for platform=win32 arch=arm64 runtime=electron abi=118 uv=1 armv=8 libc=glibc node=18.17.1 electron=27.2.3 loaded from: %USERPROFILE%.vscode\extensions\arm.device-manager-1.10.0\node_modules\@serialport\bindings-cpp So, this comes to serialport/bindings-cpp, it lacks Win32-arm64 prebuilt binary.

PR here: https://github.com/serialport/bindings-cpp/pull/167

Interim binary can be found on this run: https://github.com/thegecko/bindings-cpp/actions/runs/8031265251

ofoacimr commented 4 months ago

Thanks a lot! @thegecko

The Device Manager now works properly.

image

However, some other extensions in Arm Keil Studio Pack do not function well under Windows Arm64, and I will report under corresponding Repository.

Thank you again for your fast and professional support!

federicobozzini commented 4 months ago

Thanks for your continued feedabck @ofoacimr

[error] spawn %USERPROFILE%.vscode\extensions\arm.keil-studio-pack-1.13.0-win32-arm64\tools\armlm\bin\armlm.exe ENOENT This is caused by the lack of file extension .exe for armlm, I think it should be reported to ARM-software/vscode-keil-studio-pack. 🤣🤣🤣

Yes, this is indeed a problem in the pack. @mcgordonite @federicobozzini could you investigate?

I think the problem comes from the fact that when the pack was created the armlm binary was not available for Windows on the arm64 architecture. I'll check with the licensing team to see if it's till the case.