-
Notifications
You must be signed in to change notification settings - Fork 164
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
How to build under ARM Linux #138
Comments
Interestingly the old libusbdotnet 2.2.8 binary release still works even though I can not use MonoDevelope to build from source.
|
It seems that I have better luck with Raspberry Pi 400 running Ubuntu 64bit.
|
However the examples can not be built.
|
@mcuee Things should be a bit better by now. You should be able to build the main LibUsbDotNet library on all supported .NET platforms by just running I haven't yet fixed all examples, though. |
Yes it is okay to build the main LibUsbDotNet library now.
But not yet the example.
|
The following can be built under Raspberry Pi 400 running 64bit Ubuntu |
Great. I will try v2 branch under Linux, macOS and Windows. Under Windows 10 and VS2019 all seem to build fine. |
Under macOS, it is strange that BenchmarkCon becomes a dll.
|
@mcuee Yes, the .NET team decided to produce libraries and not executables on macOS because of notarization requirements: https://docs.microsoft.com/en-us/dotnet/core/install/macos-notarization-issues#apphost-is-disabled-by-default. There are a couple of options which should work:
Let me know if either of those options work for you. |
Great. I tried Option 1 and Option 2 and both are working under my Raspberry Pi 400. It should be the same for macOS. Only thing is that the new BenchmarkCon no longer prints out the help text when running without an argument. A bit strange.
|
Ah, good catch! #142 should fix help text. |
Great. Now it is all good. The following is from my Mac Mini M1.
|
BTW, it also works under Windows. |
Results with my Raspberry Pi 400 running Ubuntu Linux 64bit, testing with Cypress FX3 USB 3 board, pretty decent result at about 373MB/sec.
|
Thanks @mcuee ! |
Sorry for digging out this conversation. |
Linux: tested on both 64bit x86_64 and ARM32/ARM64 (Raspberry Pi 400) Somehow I feel Windows on ARM64 is a dead end and I do not think it will fly. But I understand people may like it for some reasons. Relevant discussions: |
If you have access to Windows on ARM64, please try it to see if libusbdotnet works or not. Thanks. By right it should work if the device is using WinUSB driver. If you develop your own firmware, make sure you use Microsoft OS Descriptors for USB Devices so that the OS will automatically pick WinUSB as the driver. Ref: |
@mcuee |
I see. I tend to believe it will work for your purpose. Apple macOS with Apple Silicon (ARM64) has built-in emulation from x86_64 (Rosetta 2 technology), so you can run macOS x86_64 application natively. However, as far as I know, for virtualization applications like Parallel Desktop and VMware Fusion, you can only run ARM version of VMs on Apple Silicon (ARM64) macOS machines. For libusb and libusbdotnet to work under macOS, you do not need to have Microsoft OS Descriptors for USB Devices, rather make sure it as a generic USB device and no other kernel driver are loaded for the device with exclusive access. It is a difficult task to use libusb under macOS in case there is already a kernel extension loaded for the device. You can also refer to libusb FAQ here. |
@mcuee I have Parallels setup and I can try libusb build for Windows 11 ARM, I am looking for solution for my RTL SDR, is there any build tutorial for such driver? |
@dwadi Sorry I am not familiar with RTL SDR. As of now, Zadig does not work under Windows on ARM, so you need a generic device which use WinUSB driver to test it out. The best is probably those generic USB device with the WCID descriptor. Ref:
|
Hi, I only have SDR's that needs drivers to be replaced, other device that
use WinUSB drivers is PS Vita, i could help if you give me instructions
what should be done, you could even run Parallels in trial mode and create
Windows 11, it is very simple and all resources are present from Parallels
software,like Win 11 ARM or sth like Ubuntu.
|
Personaly I have zero interests for Windows on ARM64 for now, so I will not test it our myself. I use Mac Mini M1 (macOS) which is ARM 64. I also use Linux on Raspberry Pi 400 and other ARM single board computers. As of now I think Windows on ARM64 is a dead end unless more companies are coming out with good and affordable Windows on ARM64 computers. Since Zadig will not work under Windows on ARM64 -- so you can not use your SDR device under Windows on ARM64. |
It is only case on Zadig? Is there any other options there? If you wanna test for Linux, try Trial version of Parallels, I think you should have around 2 weeks.
|
The first thing you need to use a USB HW under Windows on ARM64 is to have the device recognized under the machine with WinUSB driver (or maybe HID driver). Since Zadig does not work yet for Windows on ARM64, you have to modify your device FW to use WCID (Microsoft OS Descriptors for USB Devices).
Thanks for the info. As of now I am not interested in using Parallels. I have used UTM before to running ARM Linux VMs under my Mac Mini M1. But as mentioned, I have proper ARM Linux 32/64 machines like Raspberry Pi 400 so I do not really need to use ARM Linux under my Mac Mini M1. |
Last version of LibUsbDotNet (which contain my last modification linked to WCID WinUSB device) is working on Windows 11 ARM running on a rpi400 (installed via Windows on Raspberry) ✔️ |
Great. Thanks a lot for the reports. |
Still have problems with Windows 11 ARM virtualized via Parallels on Mac M1. Ongoing research... |
You may want to check with Parallels to see if they support USB or not in this case. |
The library works on vm Windows 11 ARM virtualized via Parallels on Mac M1. However I do not go through Zadig or other things to assign the driver (because they are not ported to ARM). I therefore use USB descriptors on the firmware side of my device which are WinUSB descriptors (so works with WinUSB device having the WCID) |
I have just installed MonoDevelop and Dotnet Core SDK 3.1/5.0 under a Debian 10 ARM Linux virtual machine. But it seems to me I can not build libusbdotnet.
/home/debian/.dotnet/sdk/5.0.300/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(5,5): Error MSB4186: Invalid static method invocation syntax: "[MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')". Method '[MSBuild]::GetTargetPlatformIdentifier' not found. Static method invocation should be of the form:$([FullTypeName]::Method()), e.g. $ ([System.IO.Path]::Combine(
a
,b
)). Check that all parameters are defined, are of the correct type, and are specified in the right order. (MSB4186) (LibUsbDotNet)The text was updated successfully, but these errors were encountered: