0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

FRDM RW612 - zephyr rtosでwifiを使用してみる。

0
Posted at
FRDM RW612 - zephyr rtosでwifiを使用してみる。

  • 作業環境
    VirtualBox7.1.4で、Ubuntu24.04 LTSを使用
    Windows11 - オンボードデバッグプローブのファームウェア書き換えに使用



  • MCU-Linkデバッグプローブのファームウェアの書き換え(Windowsで作業)

    • デフォルトでは、J-Link用のfirmwareが書き込まれている。

    • CMSIS-DAP用のfirmwareへ書き換える場合は、
      基板上のJ2ピンをショートした状態でさせた状態のまま、PCへUSB接続して基板を起動、
      MCU-LINKと呼ばれるユーティリティを用いて書き換える。(詳細は、参照情報を参照)。
      本確認では、CMSIS-DAP用のfirmwareへ書き換えて確認を行っている。

    • 書き換え対応方法

      program_CMSIS.cmd実行結果
      CMSIS-DAP firmware for MCU-Link programming script V3.172 March 2026.
      
      Place the board in ISP USB mode using the appropriate jumper on your MCU-Link.
      Refer to the board documentation for more information.
      Connect board via USB then press Space.
      
      WARNING:
      
      This firmware version requires MCUXpresso IDE version 11.7.1 or later.
      
      続行するには何かキーを押してください . . .
      
      Programming "MCU-LINK_CMSIS-DAP_V3_172.s19" 
      
      Programmed successfully - To use: remove ISP jumper and reboot.
      
      Connect Next Board then press Space (or CTRL-C to Quit)
      
      続行するには何かキーを押してください . . .
      

      書き換えが成功したら、J2のショートを外し、基板を再起動。

  • LinkServer probeによる基板の接続状況確認(Ubuntuで作業)
    FRDM-MCXN947の確認
    (https://qiita.com/mana_t/items/d1123726581914a0597b)
    の際と同様のコマンド、LinkServerのprobesを使用して、接続を確認。
    (CMSIS-DAP用に書き換える前は、LinkServer probesの実行に対して、何も出力されない状態となる。)。

    $ sudo /usr/local/LinkServer_26.3.123/LinkServer probes
    #  Description                                Serial         Device    Board    Capabilities
    ---  -----------------------------------------  -------------  --------  -------  ----------------
    1  MCU-LINK on-board (r0E7) CMSIS-DAP V3.172  DCG43LSIHUOOH                     DEBUG, VCOM, SIO
    

  • サンプルアプリケーション(samples/net/wifi/shell/)のビルドと書き込み
    • ビルド前の事前対応
      wifiの利用にあたりbinary blobが必要になるので、以下のwestコマンドでダウンロードする。
    $ west blobs fetch hal_nxp
    
    westコマンド実行結果抜粋
    $ west blobs fetch hal_nxp
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/iw612/uart_nw61x_se.h
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/rw61x/rw61x_sb_ble_15d4_combo_a2.bin
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/rw61x/rw61x_sb_ble_a2.bin
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/rw61x/rw61x_sb_wifi_a2.bin
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/mcxw23/libble_ll_os.a
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/mcxw23/libble_ll_utils_os.a
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/mcxw71/mcxw71_nbu_ble.sb3
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/mcxw72/mcxw72_nbu_ble_all_hosted.bin
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/mcxw71/mcxw71_nbu_ble_15_4_dyn.sb3
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/mcxw72/mcxw72_nbu_ble_15_4_dyn.bin
    Fetching blob hal_nxp: /home/zephyr/dev_env/zephyrproject/modules/hal/nxp/zephyr/blobs/nw61x/sd_nw61x.bin.se
    For this blob, need to read and accept license to continue. Read it?
    Please type 'y' or 'n' and press enter to confirm: 
    Please type 'y' or 'n' and press enter to confirm: y
    ~中略~
    Vivante: Distribution of Vivante software must be a part of, or embedded
    within, Authorized Systems that include a Vivante Graphics Processing Unit.
    Accept license to continue?
    Please type 'y' or 'n' and press enter to confirm: 
    Please type 'y' or 'n' and press enter to confirm: y
    $ 
    
    • ビルド
    $ west build -b frdm_rw612 samples/net/wifi/shell/ -p always
    
    • 書き込み
    $ sudo env "PATH=/usr/local/LinkServer_26.3.123:$PATH" $(which west) flash -r linkserver
    

  • アプリケーションの実行

    • サンプルアプリケーションは、wifiステーション機能を利用できるので、
      接続前のスキャン動作の使用例を示す。
    スキャン
    uart:~$ wifi scan
    Scan requested
    
    Num  | SSID                             (len) | Chan (Band)   | RSSI | Security             | BSSID             | MFP   
    1    | Buffalo-A-BB10-WPA3              19    | 44   (5GHz  ) | -41  | WPA3-SAE-HNP         | 90:96:F3:E2:BB:1A | Required
    2    | Buffalo-G-BB10                   14    | 6    (2.4GHz) | -29  | WPA2-PSK             | 90:96:F3:E2:BB:12 | Optional
    3    | Buffalo-G-BB10-WPA3              19    | 6    (2.4GHz) | -28  | WPA3-SAE-HNP         | 90:96:F3:E2:BB:13 | Required
    ~中略~
    10   | Buffalo-A-BB10                   14    | 44   (5GHz  ) | -41  | WPA2-PSK             | 90:96:F3:E2:BB:19 | Optional
    Scan request done
    
    • スキャン結果で出力される、Num 3(SSID: Buffalo-G-BB10-WPA3)のアクセスポイントに接続する例を示す。
      例で示されるパラメータは下記になる(コマンドwifi helpから抜粋)。
      -s <-s --ssid "">: SSID.
      -p [-p, --passphrase]: Passphrase (valid only for secure SSIDs)
      -k [-k, --key-mgmt]: Key Management type (valid only fo secure SSIDs)
      -w [-w, --ieee-80211w]: MFP (optional: needs security type to be specified)
    接続
    uart:~$ wifi connect -s Buffalo-G-BB10-WPA3 -p 3ndrbwfbm5vy3 -k 3 -w 2
    Connection requested
    
    ~中略~
    
    uart:~$ wifi status
    Status: successful
    ==================
    State: COMPLETED
    Interface Mode: STATION
    Link Mode: WIFI 6 (802.11ax/HE)
    SSID: Buffalo-G-BB10-WPA3
    BSSID: 90:96:F3:E2:BB:13
    Band: 2.4GHz
    Channel: 6
    Security:  WPA3-SAE-HNP
    MFP: Required
    RSSI: -29
    Beacon Interval: 100
    DTIM: 0
    TWT: Supported
    Current PHY TX rate (Mbps) : 77.0
    uart:~$ net ping  192.168.11.1
    uart:~$ PING 192.168.11.1
    28 bytes from 192.168.11.1 to 192.168.11.3: icmp_seq=1 ttl=64 time=14 ms
    ~中略~
    uart:~$ 
    

  • サンプルアプリケーション(samples/net/wifi/shell/)を使ってアクセスポイントを使用

    • wifiアクセスポイント機能の有効化
      サンプルアプリケーション(samples/net/wifi/shell/)はデフォルトの状態は、ステーション機能のみを有効にしており、アクセスポイントの機能は無効となっている。機能を有効にするために、サンプルアプリケーションのprj.confに以下を追加する。
      機能確認上、ステーション機へのIPアドレスの割り当ても併せて確認したためDHCPサーバ機能も有効にしている。
    samples/net/wifi/shell/prj.conf
    CONFIG_WIFI_USAGE_MODE_STA_AP=y
    CONFIG_NET_DHCPV4_SERVER=y
    CONFIG_NET_IF_MAX_IPV4_COUNT=2
    CONFIG_NET_CONFIG_SETTINGS=n
    CONFIG_NET_DHCPV4_SERVER_ADDR_COUNT=5
    
    • wifiアクセスポイントの起動例
      例で示されるパラメータは下記になる(コマンドwifi ap helpから抜粋)。
      対向となる機器からの接続し、対向となる機器にIPアドレスが割り当てられる。
      -s --ssid=
      -c --channel=
      -p --passphrase= (valid only for secure SSIDs)
      -k --key-mgmt= (valid only for secure SSIDs)
    アクセスポイントの起動
    uart:~$ wifi ap enable -s "FRDM_RW612_AP" -p "password123" -k 1 -c 6
    AP mode enable requested
    uart:~$ 
    uart:~$ net iface
    Default interface: 1
    
    Interface ml (0x10041c28) (WiFi) [1]
    ===============================
    Interface is down.
    
    Interface ua (0x10041d68) (WiFi) [2]
    ===============================
    Interface is down.
    uart:~$ 
    uart:~$ net ipv4 add 2 192.168.10.1 255.255.255.0
    uart:~$ net dhcpv4 server start 2 192.168.10.10
    DHCPv4 server started on interface 2
    Station connected: 92:10:0D:60:AC:A0
    
    ~中略~
    uart:~$ net ping 192.168.10.10
    PING 192.168.10.10
    28 bytes from 192.168.10.10 to 192.168.10.1: icmp_seq=1 ttl=64 time=45 ms
    ~中略~
    28 bytes from 192.168.10.10 to 192.168.10.1: icmp_seq=3 ttl=64 time=66 ms
    
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?