Mbed Unit Testing on an STM32F767 Nucleo in WSL2

73 Views Asked by At

I am attempting to run unit tests on an STM32F767 Nucleo within WSL2. I decided to use WSL due to the significant increase in compilation speed with GCC_ARM (~8x) compared to Windows and because using a full Linux installation is not an option. When connecting the Nucleo via USB on a 'real' virtual Linux machine (VMware), a block device (/media//NOD_F767ZI) and a serial device (/dev/ttyACM0) are created. The Mbed test runner Greentea automatically scans for compatible device and only works if both are present.

I've set up USB/IP in WSL and the host machine (following the instructions here: https://learn.microsoft.com/en-us/windows/wsl/connect-usb) to connect the Nucleo board to WSL as a serial device, which allows me to manually flash it with st-tools.

I am also able to mount the device on WSL using sudo mount -t drvfs <drive_letter>: <mounting_path>. However, this is only possible if it is not already attached by USB/IP.

Is there a way to attach the Nucleo to WSL2 as both a serial and block device simultaneously?

0

There are 0 best solutions below