FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
12-07-2023 04:00 PM - edited 12-07-2023 04:36 PM
Hi, we are starting to develop Apps with ctrlX OS as our target system.
We setup the App Build Environment and tested the first cpp-samples.
Is it possible to connect (usb 3.0 or Ethernet) hardware to the Windows host and use the hardware inside the App Build Environment during development?
Solved! Go to Solution.
12-07-2023 05:06 PM
Hi,
the App Build Environment is a virtual ubuntu server machine emulated with qemu. You can customize the qemu settings for your needs (like giving network adapters to the virtual maschine). Just take a look into the storage location, where you stored your App Build Environment end change (or add) settings in the "launch.bat".
The qemu documentation can help you here probably.
Best regards,
Nick
12-07-2023 06:11 PM - edited 12-07-2023 06:21 PM
Hi @EchoHarmony ,
Sorry, I was working on this while @nickH replied, so there is some duplicate information.
This is possible by setting some flags in the QEMU launch.bat file.
See documentation on USB Emulation from QEMU. Specifically, you will want usb-host and usb-net.
You can find the VM data at the storage location specified in ctrlX WORKS.
Here is an example implementation passing through a USB mouse/keyboard reciever from the Windows host.
IF "%ARCH%" == "amd64" (
qemu-system-x86_64.exe ^
-name "%NAME%" ^
-machine q35,accel=%ACCEL% ^
-smp 4 ^
-m 4G ^
-netdev user,id=eth0,%PFW% ^
-device virtio-net-pci,netdev=eth0,mac=DE-AD-BE-00-00-01 ^
-drive "file=%QCOW2%,format=qcow2" ^
-drive "file=%UDIMG%,format=raw" ^
-display none ^
-nographic ^
-device nec-usb-xhci ^
-device usb-host,vendorid=0x1F75,productid=0x0817
exit /B 0
)
The last two -device flags are the required changes from the default. I can now see the reciever in the usb device list.
12-08-2023 09:05 AM
Thank you, for the quick response and the nice explanation.
It works!