本日の主題です。 ようやっとここまで来た感じですが。
まずはUSB デバイスを接続するに従って、WSL上のLinuxからUSBデバイスにアクセスするためのドライバを入れておきます。現在のバージョンは5.0.0のようです。
nRF82540 DKで遊ぶために、Segger Embedded Studioを利用させてもらいます。
まず、SEGGERのダウンロードページからLinux版をダウンロードして、Ubuntuからアクセスできる場所に置きます。Windowsのダウンロードフォルダは /mnt/c/Users/<username>/Downloadsとしてアクセスできるので、そのままでも大丈夫です。現在のバージョンは8.22aですね。
そうしたら、Ubuntuで展開します。
$ tar zxvf Setup_EmbeddedStudio_v822a_Linux_x86_64.tar.gz
INSTALL.txt と install_segger_embedded_studio というファイルができますので、まずはINSTALL.txtを読みます。
Run "./install_segger_embedded_studio" as root user and follow the installation instructions.
sudoで実行してね、ということですね。今回、Ubuntu はまだ RDP接続とかしてないのでこのあとでX関係のライブラリなどのインストールをする必要があるんですが、どっちを先にしようか。Xかな。 とりあえずお約束でxeyesを動かせるところまではやっておきますか。
まず、管理者モードでPowerShellを起動して、 wsl --update を実行しておきます。
更新プログラムを確認しています。
Linux 用 Windows サブシステムをバージョンに更新しています: 2.4.13。
いちおうまだカーネルは 5.15 でした。
次に apt で x11-utils をインストールします。
[sudo] password for kats:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libice6 libsm6 libxaw7 libxcb-shape0 libxft2 libxkbfile1 libxmu6 libxpm4 libxt6t64 libxv1 libxxf86dga1
Suggested packages:
mesa-utils
Recommended packages:
luit
The following NEW packages will be installed:
libice6 libsm6 libxaw7 libxcb-shape0 libxft2 libxkbfile1 libxmu6 libxpm4 libxt6t64 libxv1 libxxf86dga1 x11-utils
0 upgraded, 12 newly installed, 0 to remove and 0 not upgraded.
Need to get 831 kB of archives.
After this operation, 2437 kB of additional disk space will be used.
Do you want to continue? [Y/n]
x11-appsも。
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
libxcb-damage0 xbitmaps
Suggested packages:
mesa-utils
The following NEW packages will be installed:
libxcb-damage0 x11-apps xbitmaps
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 737 kB of archives.
After this operation, 2770 kB of additional disk space will be used.
Do you want to continue? [Y/n]
でもって、
などとすると、
できました。これでコマンドラインからGUIアプリを起動できる準備ができたので、SESのインストールへと進みます。
すると、
インストールダイアログがでてきました。Nextを押して…。
もう一回Nextを押して…
/optの下だからそのままでいいか。またNextを押します。
MDK-ARMが Clang/llvm に移行してるんですが、こちらはGCCのままなんですよね。はいはい、Next。
Installボタンを押します。
Finishを押してインストールは完了です。インストールディレクトリを見てみると、
99-jlink.rules cpphtml libQt3Support.so.4 mv
CVSInterface.so_x64 crashreporter libQtCore.so.4 pkg
FileIcon.png crc32sum libQtGui.so.4 ptycom
GITInterface.so_x64 emBuild libQtNetwork.so.4 rm
HGInterface.so_x64 emLicense libQtSql.so.4 scproviders.xml
IConf.xml emScript libQtSvg.so.4 segger-LTO.so
JLinkGUIServerExe emSim libQtWebKit.so.4 segger-as
STLport.xml emStudio libQtXml.so.4 segger-cc
SVNInterface.so_x64 embed libSTLinkUSBDriver.so segger-ld
StudioIcon.png en_us.aff libc++.xml studio.xml
addstacksizes en_us.dic libcapstone.so styles.xml
cc environment.xml libjlinkarm.so svd2mm
cc++ gcc_build_options.xml libstdc++.xml symbols.sym
cc++-segger gcc_warning_options.xml libunicorn.so themes
cc-segger importCMakeGeneratedNinja.so_x64 ltollvm tools.xml
chmod importEclipse.so_x64 manifest.xml uc
codecs importGPDSC.so_x64 mkdir uninstall
color-schemes.xml importIAR.so_x64 mkld version.txt
cp importKeil.so_x64 mkpkg xmlcp
cpltodbg keyboard.xml mkresolution
emStudioというのがありますね。これがそうかな?
libusb-1.0.so.0がない、と言われました。ないのかな、と思って locate libusb したら、locate もないようです。
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
locate
0 upgraded, 1 newly installed, 0 to remove and 230 not upgraded.
Need to get 50.3 kB of archives.
After this operation, 177 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble/universe amd64 locate amd64 4.9.0-5build1 [50.3 kB]
Fetched 50.3 kB in 1s (53.5 kB/s)
Selecting previously unselected package locate.
(Reading database ... 40972 files and directories currently installed.)
Preparing to unpack .../locate_4.9.0-5build1_amd64.deb ...
Unpacking locate (4.9.0-5build1) ...
Setting up locate (4.9.0-5build1) ...
Processing triggers for man-db (2.12.0-4build2) ...
$ sudo updatedb
おっと、/mnt/c や /mnt/d なんかを検索対象外にしておかないとやばいことになります。設定は /etc/updatedb.conf を書いて、と。でも、なさそうです。ということでlibusbもインストール。
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
libusb-1.0-0
0 upgraded, 1 newly installed, 0 to remove and 230 not upgraded.
Need to get 54.0 kB of archives.
After this operation, 140 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble/main amd64 libusb-1.0-0 amd64 2:1.0.27-1 [54.0 kB]
Fetched 54.0 kB in 1s (47.0 kB/s)
Selecting previously unselected package libusb-1.0-0:amd64.
(Reading database ... 40985 files and directories currently installed.)
Preparing to unpack .../libusb-1.0-0_2%3a1.0.27-1_amd64.deb ...
Unpacking libusb-1.0-0:amd64 (2:1.0.27-1) ...
Setting up libusb-1.0-0:amd64 (2:1.0.27-1) ...
Processing triggers for libc-bin (2.39-0ubuntu8) ...
で、起動してみる。
…のっぺらぼう…。フォントとかがないのかな。たぶん、ライセンス指定のダイアログなんだけど、ウィジェットも出てこない。
どうもSESはQtライブラリを使ってるみたいですが、うーん。これはWindow Managerとか入れて、RDPで接続すべき?
ちなみに、このあとでNautilusとかGimpとかのGUIアプリをインストールしてみました。
Gimpはちゃんと動くようですが、Nautilusのほうは、
** Message: 21:21:26.725: Connecting to org.freedesktop.Tracker3.Miner.Files
libEGL warning: DRI3: Screen seems not DRI3 capable
libEGL warning: DRI3: Screen seems not DRI3 capable
MESA: error: ZINK: failed to choose pdev
libEGL warning: egl: failed to create dri2 screen
** (org.gnome.Nautilus:8401): WARNING **: 21:22:18.697: Unable to get contents of the bookmarks file: Error opening file /home/kats/.gtk-bookmarks: No such file or directory
** (org.gnome.Nautilus:8401): WARNING **: 21:22:18.698: Unable to get contents of the bookmarks file: Error opening file /home/kats/.gtk-bookmarks: No such file or directory
MESA: error: Failed to attach to x11 shm
となりました。MESAとlibEGL関係でしょうか。ちょっと座礁しました。