2024년 12월 12일 목요일

WireGuard for Zephyr RTOS(2)

Let's continue the Zephyr RTOS programming story (4th time) from last time. This time's topic is about  WireGuard Porting in a Wi-Fi environment. 😎 


WireGuard Porting for Zephyr RTOS in the Wi-Fi environment

Index

1. Nordic nRF7002 DK board
2. Wi-Fi 6 and Wi-Fi Example (SoftAP and Station)
3. Porting WireGuard to work in a Wi-Fi environment
4. Other untold stories
5. References


The country is in turmoil due to the sudden martial law. But what kind of country is the Republic of Korea? It is definitely not a country that is shaken by one or two people. It is a country with the strength to have maintained democracy for a long time.  Article 1, Section 2 of the Constitution of the Republic of Korea: "The sovereignty of the Republic of Korea resides in the people, and all state authority emanates from the people." Now, it is time to rise again. Korea Fighting~ 👍

[Image source - Reference 17]

Nordic products have many strengths in the wireless communication field (BLE, NFC, Matter, Thread, ZigBee, LoraWAN, Wi-Fi, LTE-M, NB-IoT, etc.). The board price is also very affordable, and it is also attractive that it supports Zephyr RTOS. Therefore, if possible, I would like to cover various Nordic products through the blog. 👌



1. Nordic nRF7002 DK board
In order to port the wireguard-zephyr code implemented last time to operate in a Wi-Fi environment, I ordered a Nordic nRF7002 DK board. 💢 In this posting, I will explain how to use the nRF7002 DK board for Wi-Fi programming in a zephyr environment and how to change the wireguard-zephyr project to operate in a Wi-Fi environment.

[Figure 1.1]  Nordic nRF7002 DK board box (10 boards included)
📌 Wow, I ordered one, but I got one box containing 10 boards (costing around 80,000 won). 😓 That's around 8,000 won per board, which is very cheap.

[Figure 1.2] Nordic nRF7002 DK board  [Source - Reference 3]


[Figure 1.3] Nordic nRF7002 DK board front view [Source - Reference 3]


[Figure 1.4] Nordic nRF7002 DK board connectors [Source - Reference 3]

The main h/w features of the nRF7002 DK board are summarized as follows.

<Key features of the nRF7002 DK board>

To summarize the above, the main MCU is the nRF5340 SoC (Arm Cortex-M33 2 cores, supports BLE, NFC, 802.15.4, Thread, ZigBee, ANT, etc.), and the Wi-Fi is handled separately by the nRF7002 IC . The supported Wi-Fi version is 6 (802.11 ax). In addition, it is equipped with a SEGGER J-link on board adapter (Interface MCU) , so programming and debugging are possible right away.

The block diagram below is a pictorial summary of the above-mentioned content for easy understanding at a glance. Although it is a small system, it is still armed with three CPUs. 💪

[Figure 1.5] Nordic nRF7002 DK board block diagram [Source - Reference 3]
📌 The nRF5340 and nRF7002 are connected (communicate) via QSPI (Quad Serial Peripheral Interface).

The figure below shows the antenna connection relationship between BLE (2.4GHz) and Wi-Fi (2.4GHz, 5GHz).


[Figure 1.6] Nordic nRF7002 DK antenna configuration [Source - Reference 3] 
📌 Wi-Fi 6 uses both 2.4Ghz and 5Ghz wireless frequency bands.

______________
The content explained from now on  is about the main MCU, nRF5340 SoC , and refers to the nRF5340 product specification v1.5 document provided on the site below.


First, the main MCU nRF5340 SoC consists of  an application core (Arm Cortex-M33 64/128 MHz) and a network core ( Arm Cortex-M33 64MHz).

[Figure 1.7] Nordic nRF5340 main MCU block diagram [Source - Reference 4]
📌 The nRF5340 MCU has two CPUs, one for general applications and the other for wireless f/w such as BLE.

The following figure shows the memory map, which consists of the application core and the network core.

[Figure 1.8] Nordic nRF5340 Memory Map [Source - Reference 4]

Meanwhile, power management is a very important part of h/w board design. The figure below shows power management-related contents including PMU (Power Management Unit) and internal regulator & oscillator.

[Figure 1.9] Nordic nRF5340 Power Manangement Unit [Source - Reference 4]

The following figure is about the nRF5340 Clock. 

[Figure 1.10] Nordic nRF5340 Clock Control [Source - Reference 4]

Finally, the figure below shows the interface part related to debugging & programming using SWD.

[Figure 1.11] Nordic nRF5340 Debug and Trace overview [Source - Reference 4]

For more specific information about the nRF5340 SoC, please refer to the nRF5340 product specification v1.5 document mentioned above. The content of the document is much better than I expected, but it is a shame that it cannot be fully included here. 😓

"Even if it's just a superficial understanding, it's okay. If you organize it like this, things you didn't understand before will naturally be organized in your head at some point."

Okay, so after connecting the power, let's move on to the next chapter.

[Figure 1.12]  nRF7002DK power connection
📌 The device will not turn on simply by connecting the USB cable. (Based on the image above) You must adjust the power switch (SW8) on the upper right to ON.



2. Wi-Fi 6 and Wi-Fi Example (SoftAP and Station)
In this chapter, we will take a brief look at Wi-Fi 6 technology and then run Wi-Fi SoftAP and Station examples on the nRF7002 DK board. 

2.1 Wi-Fi 6 Technology

The following is the information that AI gave me when I searched for “wi-fi 6 technology” on Google. It is well explained without any unnecessary details, so I will copy the original text as is.
_________________________________________________________________________

Wi-Fi 6 , also known as IEEE 802.11ax, is the latest wireless network protocol and a significant improvement over its predecessor, Wi-Fi 5.
  • Speed
    Wi-Fi 6 is faster than Wi-Fi 5, with increased data transfer rates and the ability to support more devices on the same network.
  • Security
    Wi-Fi 6 uses WPA3 encryption, which is more secure than Wi-Fi 5's predecessor, WPA2. WPA3 has stronger user authentication and more effective data encryption.
  • Frequency bands
    Wi-Fi 6 operates in the 2.4 GHz and 5 GHz bands , and can use the 6 GHz band with Wi-Fi 6E . 
  • Efficiency
    Wi-Fi 6 uses technologies like: 
    • OFDMA :  Orthogonal Frequency Division Multiple Access, which improves communication with compatible devices
    • Beamforming : Increases the number of transmit beamforming streams to eight
    • Individual target wake time ( TWT : Makes Wi-Fi-enabled devices' batteries last longer 
  • Coverage
    Wi-Fi 6's longer OFDM symbol provides increased coverage 
  • Latency
    Wi-Fi 6 reduces latency and improves the quality of service in areas with many people and high network demand 
_________________________________________________________________________
📌 Wi-Fi technology is evolving from 6th generation (max: 9.6Gbps) to 7th generation (802.11be, max: 300Gbps). Starting with 6E, it is characterized by the use of the 6Ghz band.

The pdf document below (published by Juniper) summarizes Wi-Fi 6 and 6E technologies in one page. (The illustrations are so good) I've copied a few of them here.


[Figure 2.1]  Evolution of Wi-Fi technology [Source - Reference 7]

[Figure 2.2] Comparison between IEEE 802.11ac and 802.11ax  [Source - Reference 7]

[Figure 2.3] Wi-Fi 6 OFDMA technology [ Source - Reference 7]
📌 OFDMA (Orthogonal Frequency Division Multiple Access) is a multi-user version of OFDM digital modulation technology.

The features of the nRF7002 Wi-Fi IC can be summarized as follows:

[Figure 2.4]  nRF7002 Wi-Fi IC [Source - https://www.nordicsemi.com/Products/nRF7002 ]
📌  The nRF7002 IC does not appear to support the full Wi-Fi 6 spec.

2.2 Wi-Fi SoftAP and Station Example

The example code below  uses the ones provided by  the nRF Connect SDK . For nRF Connect SDK installation (environment settings), please refer to Chapter 8 of the previous posting.




[Figure 2.5]  Wi-Fi Connection   [Source - Reference 16]



a) Try running the wi-fi softap example
Now, let's run the softap (soft access point) example.

 cd ~/ncs/
 nrfutil toolchain-manager launch --shell

(v2.8.0) chyi@earth:~/ncs$  source zephyr/zephyr-env.sh
(v2.8.0) chyi@earth:~/ncs$  cd zephyr/

(v2.8.0) chyi@earth:~/ncs/zephyr$ west build -b nrf7002dk/nrf5340/cpuapp ../nrf/samples/wifi/softap -t menuconfig
First, change the kernel settings and wifi ap settings information through the menuconfig option.

[Figure 2.6] Executing the menuconfig option for the softap app 


[Figure 2.7]  Running the menuconfig option for the softap app  - wifi driver settings


[Figure 2.8] Executing menuconfig option for softap app  - SSID change

Now that the configuration changes have been made, it's time to build.

(v2.8.0) chyi@earth:~/ncs/zephyr$ west build -b nrf7002dk/nrf5340/cpuapp ../nrf/samples/wifi/softap
-- west build: making build dir /home/chyi/ncs/zephyr/build pristine
-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /home/chyi/ncs/toolchains/b81a7cd864/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
-- Cache files will be written to: /home/chyi/.cache/zephyr
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf7002dk, qualifiers: nrf5340/cpuapp
Parsing /home/chyi/ncs/zephyr/share/sysbuild/Kconfig
Loaded configuration '/home/chyi/ncs/zephyr/build/_sysbuild/empty.conf'
Merged configuration '/home/chyi/ncs/nrf/samples/wifi/softap/sysbuild.conf'
Configuration saved to '/home/chyi/ncs/zephyr/build/zephyr/.config'
Kconfig header saved to '/home/chyi/ncs/zephyr/build/_sysbuild/autoconf.h'
-- 
   ****************************
   * Running CMake for softap *
   ****************************

Loading Zephyr default modules (Zephyr base).
--Application: /home/chyi/ncs/nrf/samples/wifi/softap
-- CMake version: 3.21.0
-- Using NCS Toolchain 2.8.20241106.790718371940 for building. (/home/chyi/ncs/toolchains/b81a7cd864/cmake)
-- Found Python3: /home/chyi/ncs/toolchains/b81a7cd864/usr/local/bin/python3 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
-- Cache files will be written to: /home/chyi/.cache/zephyr
-- Zephyr version: 3.7.99 (/home/chyi/ncs/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf7002dk, qualifiers: nrf5340/cpuapp
-- Found host-tools: zephyr 0.16.8 (/home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.8 (/home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk)
-- Found Dtc: /home/chyi/ncs/toolchains/b81a7cd864/usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/chyi/ncs/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp.dts
-- Generated zephyr.dts: /home/chyi/ncs/zephyr/build/softap/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/chyi/ncs/zephyr/build/softap/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /home/chyi/ncs/zephyr/build/softap/zephyr/dts.cmake

warning: Deprecated symbol MBEDTLS_LEGACY_CRYPTO_C is enabled.
warning: Deprecated symbol POSIX_CLOCK is enabled.
warning: Experimental symbol WIFI_READY_LIB is enabled.
warning: Experimental symbol WIFI_NM_WPA_SUPPLICANT is enabled.
warning: Experimental symbol WIFI_NM_WPA_SUPPLICANT is enabled.
warning: Experimental symbol POSIX_ASYNCHRONOUS_IO is enabled.
warning: Experimental symbol POSIX_DEVICE_IO is enabled.
warning: Experimental symbol POSIX_FD_MGMT is enabled.
warning: Experimental symbol POSIX_MULTI_PROCESS is enabled.
warning: Experimental symbol POSIX_REALTIME_SIGNALS is enabled.
warning: Experimental symbol POSIX_SIGNALS is enabled.
warning: Experimental symbol NET_BUF_VARIABLE_DATA_SIZE is enabled.
warning: Experimental symbol NET_SOCKETS_SERVICE is enabled.

Parsing /home/chyi/ncs/nrf/samples/wifi/softap/Kconfig
Loaded configuration '/home/chyi/ncs/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig'
Merged configuration '/home/chyi/ncs/nrf/samples/wifi/softap/prj.conf'
Merged configuration '/home/chyi/ncs/zephyr/build/softap/zephyr/.config.sysbuild'
Configuration saved to '/home/chyi/ncs/zephyr/build/softap/zephyr/.config'
Kconfig header saved to '/home/chyi/ncs/zephyr/build/softap/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
=========== Generating psa_crypto_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Backup: CONFIG_MBEDTLS_THREADING: False
Backup: CONFIG_MBEDTLS_THREADING_ALT: True
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Restore: CONFIG_MBEDTLS_THREADING: False
Restore: CONFIG_MBEDTLS_THREADING_ALT: True
=========== End psa_crypto_config ===============
=========== Generating psa_crypto_library_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: False
Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Backup: CONFIG_MBEDTLS_THREADING: False
Backup: CONFIG_MBEDTLS_THREADING_ALT: True
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: False
Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Restore: CONFIG_MBEDTLS_THREADING: False
Restore: CONFIG_MBEDTLS_THREADING_ALT: True
=========== End psa_crypto_library_config ===============
-- Setting build type to 'MinSizeRel' as none was specified.
-- Using ccache: /home/chyi/ncs/toolchains/b81a7cd864/usr/bin/ccache
CMake Warning at /home/chyi/ncs/zephyr/kernel/CMakeLists.txt:171 (message):
  

          CONFIG_HEAP_MEM_POOL_SIZE is less than requested minimum:
            183600 < 223024
          Setting the system heap size to 223024


-- Configuring done
-- Generating done
-- Build files have been written to: /home/chyi/ncs/zephyr/build/softap
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chyi/ncs/zephyr/build
-- west build: building application
[5/10] Performing build step for ‘softap’
[1/497] Preparing syscall dependency handling

[5/497] Generating include/generated/zephyr/version.h
-- Zephyr version: 3.7.99 (/home/chyi/ncs/zephyr), build: v3.7.99-ncs1
[497/497] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
           FLASH: 733340 B 1 MB 69.94%
             RAM: 315468 B 448 KB 68.77%
        IDT_LIST: 0 GB 32 KB 0.00%
Generating files from /home/chyi/ncs/zephyr/build/softap/zephyr/zephyr.elf for board: nrf7002dk
[10/10] Generating ../merged.hex

Since the build has proceeded normally, let's try flash writing through J-link.

(v2.8.0) chyi@earth:~/ncs/zephyr$  west flash
...




📌 Since the J-link adapter is on board, flash writing works without any problems.

Let's check the operation of the softap app through a serial console emulator (e.g. mimicom).

$ sudo minicom -D /dev/ttyACM1

*** Booting nRF Connect SDK v2.8.0-a2386bfc8401 ***
*** Using Zephyr OS v3.7.99-0bc3393fb112 ***
[00:00:00.617,095] <inf> net_config: Initializing network
[00:00:00.617,095] <inf> net_config: Waiting interface 1 (0x2000112c) to be up...
[00:00:00.617,187] <inf> net_config: IPv4 address: 192.168.1.1
[00:00:00.617,858] <inf> softap: Waiting for Wi-Fi to be ready
[00:00:00.619,720] <inf> wifi_supplicant: wpa_supplicant initialized
[00:00:00.757,202] <inf> softap: Regulatory domain set to 00
[00:00:00.757,537] <inf> softap: DHCPv4 server started and pool address starts from 192.168.1.2
[00:00:03.193,359] <inf> wpa_supp: wlan0: interface state UNINITIALIZED->ENABLED
[00:00:03.193,481] <inf> wpa_supp:wlan0:AP-ENABLED 
[00:00:03.193,817] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to f4:ce:36:00:13:54 completed [id=0 id_st]
[00:00:03.197,357] <inf> softap: AP enable requested
[00:00:03.197,692] <inf> softap: AP mode enabled
[00:00:08.200,683] <err> wifi_nrf: nrf_wifi_wpa_supp_signal_poll: Failed to get station info, ret = -11
[00:00:08.200,805] <err> wpa_supp: wpa_drv_zep_signal_poll: Signal polling failed: -1
[00:00:08.200,897] <wrn> wpa_supp: supplicant_status: Failed to get signal info
[00:00:08.200,927] <inf> softap: Status: successful
[00:00:08.200,958] <inf> softap: =================================
[00:00:08.200,958] <inf> softap: State: COMPLETED
[00:00:08.200,988] <inf> softap: Interface Mode: ACCESS POINT
[00:00:08.201,019] <inf> softap: Link Mode: UNKNOWN
[00:00:08.201,049] <inf> softap: SSID: nrf7002dk
[00:00:08.201,049] <inf> softap: BSSID: F4:CE:36:00:13:54
[00:00:08.201,080] <inf> softap: Band: 2.4GHz
[00:00:08.201,110] <inf> softap: Channel: 1
[00:00:08.201,110] <inf> softap: Security: WPA2-PSK
[00:00:08.201,141] <inf> softap: MFP: Disable
[00:00:08.201,141] <inf> softap: Beacon Interval: 100
[00:00:08.201,141] <inf> softap: DTIM: 2
[00:00:08.201,171] <inf> softap: TWT: Not supported

After preparing the second nRF7002 DK board in this state, let's try running the station mode example.

b) Try running the wi-fi station example
 cd ~/ncs/
 nrfutil toolchain-manager launch --shell

(v2.8.0) chyi@earth:~/ncs$  source zephyr/zephyr-env.sh
(v2.8.0) chyi@earth:~/ncs$  cd zephyr/

(v2.8.0) chyi@earth:~/ncs/zephyr$  vi  ~/ncs/nrf/samples/wifi/sta/prj.conf
 -> Set the contents below (SSID and password) to those of the previously run softap.
...
# WPA supplicant
CONFIG_WIFI_NM_WPA_SUPPLICANT=y
CONFIG_WIFI_READY_LIB=y
CONFIG_NRF_WIFI_RPU_RECOVERY=y

CONFIG_WIFI_MGMT_EXT=y
CONFIG_WIFI_CREDENTIALS=y
CONFIG_WIFI_CREDENTIALS_STATIC=y
CONFIG_WIFI_CREDENTIALS_STATIC_SSID="nrf7002dk"    #Enter the information of the AP you are using.
CONFIG_WIFI_CREDENTIALS_STATIC_PASSWORD="goodluck"      #Enter the information of the AP you are using.
...


(v2.8.0) chyi@earth:~/ncs/zephyr$  west build -b nrf7002dk/nrf5340/cpuapp ../nrf/samples/wifi/sta --pristine
-- west build: making build dir /home/chyi/ncs/zephyr/build pristine
-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /home/chyi/ncs/toolchains/b81a7cd864/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
-- Cache files will be written to: /home/chyi/.cache/zephyr
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf7002dk, qualifiers: nrf5340/cpuapp
Parsing /home/chyi/ncs/zephyr/share/sysbuild/Kconfig
Loaded configuration '/home/chyi/ncs/zephyr/build/_sysbuild/empty.conf'
Merged configuration '/home/chyi/ncs/nrf/samples/wifi/sta/sysbuild.conf'
Configuration saved to '/home/chyi/ncs/zephyr/build/zephyr/.config'
Kconfig header saved to '/home/chyi/ncs/zephyr/build/_sysbuild/autoconf.h'
-- 
   *************************
   * Running CMake for sta *
   *************************

Loading Zephyr default modules (Zephyr base).
--Application: /home/chyi/ncs/nrf/samples/wifi/sta
-- CMake version: 3.21.0
-- Using NCS Toolchain 2.8.20241106.790718371940 for building. (/home/chyi/ncs/toolchains/b81a7cd864/cmake)
-- Found Python3: /home/chyi/ncs/toolchains/b81a7cd864/usr/local/bin/python3 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
-- Cache files will be written to: /home/chyi/.cache/zephyr
-- Zephyr version: 3.7.99 (/home/chyi/ncs/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf7002dk, qualifiers: nrf5340/cpuapp
-- Found host-tools: zephyr 0.16.8 (/home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.8 (/home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk)
-- Found Dtc: /home/chyi/ncs/toolchains/b81a7cd864/usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/chyi/ncs/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp.dts
-- Generated zephyr.dts: /home/chyi/ncs/zephyr/build/sta/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/chyi/ncs/zephyr/build/sta/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /home/chyi/ncs/zephyr/build/sta/zephyr/dts.cmake

warning: Deprecated symbol MBEDTLS_LEGACY_CRYPTO_C is enabled.
warning: Deprecated symbol POSIX_CLOCK is enabled.
warning: Experimental symbol WIFI_CREDENTIALS is enabled.
warning: Experimental symbol WIFI_READY_LIB is enabled.
warning: Experimental symbol WIFI_NM_WPA_SUPPLICANT is enabled.
warning: Experimental symbol WIFI_NM_WPA_SUPPLICANT is enabled.
warning: Experimental symbol NRF_WIFI_RPU_RECOVERY is enabled.
warning: Experimental symbol POSIX_ASYNCHRONOUS_IO is enabled.
warning: Experimental symbol POSIX_DEVICE_IO is enabled.
warning: Experimental symbol POSIX_FD_MGMT is enabled.
warning: Experimental symbol POSIX_MULTI_PROCESS is enabled.
warning: Experimental symbol POSIX_REALTIME_SIGNALS is enabled.
warning: Experimental symbol POSIX_SIGNALS is enabled.
warning: Experimental symbol NET_BUF_VARIABLE_DATA_SIZE is enabled.

Parsing /home/chyi/ncs/nrf/samples/wifi/sta/Kconfig
Loaded configuration '/home/chyi/ncs/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig'
Merged configuration '/home/chyi/ncs/nrf/samples/wifi/sta/prj.conf'
Merged configuration '/home/chyi/ncs/zephyr/build/sta/zephyr/.config.sysbuild'
Configuration saved to '/home/chyi/ncs/zephyr/build/sta/zephyr/.config'
Kconfig header saved to '/home/chyi/ncs/zephyr/build/sta/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
=========== Generating psa_crypto_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Backup: CONFIG_MBEDTLS_THREADING: False
Backup: CONFIG_MBEDTLS_THREADING_ALT: True
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Restore: CONFIG_MBEDTLS_THREADING: False
Restore: CONFIG_MBEDTLS_THREADING_ALT: True
=========== End psa_crypto_config ===============
=========== Generating psa_crypto_library_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: False
Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Backup: CONFIG_MBEDTLS_THREADING: False
Backup: CONFIG_MBEDTLS_THREADING_ALT: True
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: False
Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Restore: CONFIG_MBEDTLS_THREADING: False
Restore: CONFIG_MBEDTLS_THREADING_ALT: True
=========== End psa_crypto_library_config ===============
-- Setting build type to 'MinSizeRel' as none was specified.
-- Using ccache: /home/chyi/ncs/toolchains/b81a7cd864/usr/bin/ccache
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chyi/ncs/zephyr/build/sta
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chyi/ncs/zephyr/build
-- west build: building application
[5/10] Performing build step for ‘sta’
[1/459] Preparing syscall dependency handling

[6/459] Generating include/generated/zephyr/version.h
-- Zephyr version: 3.7.99 (/home/chyi/ncs/zephyr), build: v3.7.99-ncs1
[459/459] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
           FLASH: 545332 B 1 MB 52.01%
             RAM: 211072 B 448 KB 46.01%
        IDT_LIST: 0 GB 32 KB 0.00%
Generating files from /home/chyi/ncs/zephyr/build/sta/zephyr/zephyr.elf for board: nrf7002dk
[10/10] Generating ../merged.hex

(v2.8.0) chyi@earth:~/ncs/zephyr$  west flash
...


$  sudo minicom -D /dev/ttyACM2

[Figure 2.9]  Serial console - Wi-Fi sta app execution

📌 When the Station app is running, it is receiving IP allocation (dhcp) from the SoftAP app.

After adding the following to the prj.conf file to enable net shell, try again.
# Network shell
CONFIG_NET_SHELL=y
CONFIG_SHELL=y

uart:~$ net ping 192.168.1.1
PING 192.168.1.1
28 bytes from 192.168.1.1 to 192.168.1.2: icmp_seq=1 ttl=64 time=22 ms
28 bytes from 192.168.1.1 to 192.168.1.2: icmp_seq=2 ttl=64 time=12 ms
28 bytes from 192.168.1.1 to 192.168.1.2: icmp_seq=3 ttl=64 time=16 ms


OK, in this state, you can see that ping is normal even with 192.1681.1 (softap) assigned to the wifi station.

(Although it leaves a deep sense of regret)  So far, we have roughly checked the Wi-Fi function of the nRF7002 DK board through the Wi-Fi SoftAP example and the Station example. In addition,  the nRF Connect SDK includes various Wi-Fi-related examples as shown below. For the rest, I recommend that the readers try it out themselves and figure out the code. 😂

chyi@earth:~/ncs/nrf/samples/wifi$ ls -la
drwxrwxr-x 4 chyi chyi 4096 November 22 13:29 ble_coex
drwxrwxr-x 3 chyi chyi 4096 November 22 13:29 monitor
drwxrwxr-x 3 chyi chyi 4096 Nov 22 13:29 offloaded_raw_tx
drwxrwxr-x 3 chyi chyi 4096 Nov 22 13:29 promiscuous
drwxrwxr-x 4 chyi chyi 4096 November 22 13:29 provisioning
drwxrwxr-x 5 chyi chyi 4096 November 22 13:29 radio_test
drwxrwxr-x 3 chyi chyi 4096 Nov 22 13:29 raw_tx_packet
drwxrwxr-x 4 chyi chyi 4096 November 22 13:29 scan
drwxrwxr-x 5 chyi chyi 4096 November 22 13:29 shell
drwxrwxr-x 3 chyi chyi 4096 November 22 13:29 shutdown
drwxrwxr-x 3 chyi chyi 4096 Dec 11 15:07 softap
drwxrwxr-x 4 chyi chyi 4096 Dec 11 15:00 sta
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 thread_coex
drwxrwxr-x 3 chyi chyi 4096 November 22 13:29 throughput
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 twt
drwxrwxr-x 3 chyi chyi 4096 Nov 22 13:29 wfa_qt_app



3. Porting WireGuard to work in a Wi-Fi environment
The work (wireguard-zephyr) done in the last posting was based on an ethernet (wired) environment. However, in the actual IoT environment (or resource-limited device environment), it can be said that a wireless environment is more realistic than a wired ethernet environment. Therefore, in this chapter, we will finish the related work so that wireguard-zephyr can operate in a Wi-Fi environment.

Please check the previous posting regarding the wireguard-zephyr project first (I will not explain the repeated contents).



[Figure 3.1]  Overview of WireGuard zephyr application in Wi-Fi environment(1) - Packet transmission and reception flow diagram


[Figure 3.2]  Overview of WireGuard zephyr application in Wi-Fi environment(2)

<Porting Contents>
In fact, there is not much to do since all you have to do is replace the ethernet interface (eth0) setting part of what you worked on last time with the wi-fi station interface (wlan0) connection part.

1) Remove dhcpc.c code and add wifi.c code (see wifi station example).
2) Modify the contents of the prj.conf file.
  -> Added contents of wifi station project
3) Fill in the eth_if field in the structure below with the value of the wifi interface.

struct netif {
    int sockfd;
    int tunfd;
    struct net_if *eth_if;   /* ethernet or wifi interface */
    struct net_if *tun_if; /* virtual interface */
    void *state;
};

<Excerpt from the contents of the wifi.c file>
static int wifi_connect(void)
{
    struct net_if *iface = net_if_get_first_wifi();

    context.connected = false;
    context.connect_result = false;

    if (wg_netif) {
        wg_netif->eth_if = iface;
    }
    ...
}

4) Perform stabilization (debugging) work.
___________________________________________________

Before compiling, let's open the file below and change the wireguard settings.

(v2.8.0) chyi@earth:~/ncs/zephyr$ vi ../nrf/samples/net/wireguard/src/wireguard_vpn.h
...
#define WG_LOCAL_ADDRESS IPADDR4_INIT_BYTES(10, 1, 1, 50)    // my vpn ip address
#define WG_LOCAL_NETMASK IPADDR4_INIT_BYTES(255, 255, 255, 0)
#define WG_LOCAL_NETWORK IPADDR4_INIT_BYTES(10, 1, 1, 0)

#define WG_CLIENT_PRIVATE_KEY "kL/HdaoIlqlDmrjtIkb/0PmF+3N7eApdkrjUQvsbK0c="
#define WG_CLIENT_PORT 51820

#define WG_PEER_PUBLIC_KEY "isbaRdaRiSo5/WtqEdmpH+NrFeT1+QoLvnhVI1oFfhE="
#define WG_PEER_PORT 51820
#define WG_ENDPOINT_ADDRESS IPADDR4_INIT_BYTES(192, 168, 8, 139)  //peer endpoint(real) ip address
...
~

Okay, now that we're ready, let's try building the wireguard code.

(v2.8.0) chyi@earth:~/ncs/zephyr$ west build -b nrf7002dk/nrf5340/cpuapp ../nrf/samples/net/wireguard --pristine
-- west build: making build dir /home/chyi/ncs/zephyr/build pristine
-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /home/chyi/ncs/toolchains/b81a7cd864/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
-- Cache files will be written to: /home/chyi/.cache/zephyr
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf7002dk, qualifiers: nrf5340/cpuapp
Parsing /home/chyi/ncs/zephyr/share/sysbuild/Kconfig
Loaded configuration '/home/chyi/ncs/zephyr/build/_sysbuild/empty.conf'
Merged configuration '/home/chyi/ncs/nrf/samples/net/wireguard/sysbuild.conf'
Configuration saved to '/home/chyi/ncs/zephyr/build/zephyr/.config'
Kconfig header saved to '/home/chyi/ncs/zephyr/build/_sysbuild/autoconf.h'
-- 
   *******************************
   * Running CMake for wireguard *
   *******************************

Loading Zephyr default modules (Zephyr base).
-- Application: /home/chyi/ncs/nrf/samples/net/wireguard
-- CMake version: 3.21.0
-- Using NCS Toolchain 2.8.20241106.790718371940 for building. (/home/chyi/ncs/toolchains/b81a7cd864/cmake)
-- Found Python3: /home/chyi/ncs/toolchains/b81a7cd864/usr/local/bin/python3 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
-- Cache files will be written to: /home/chyi/.cache/zephyr
-- Zephyr version: 3.7.99 (/home/chyi/ncs/zephyr)
-- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
-- Board: nrf7002dk, qualifiers: nrf5340/cpuapp
-- Found host-tools: zephyr 0.16.8 (/home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk)
-- Found toolchain: zephyr 0.16.8 (/home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk)
-- Found Dtc: /home/chyi/ncs/toolchains/b81a7cd864/usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
-- Found BOARD.dts: /home/chyi/ncs/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp.dts
-- Generated zephyr.dts: /home/chyi/ncs/zephyr/build/wireguard/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /home/chyi/ncs/zephyr/build/wireguard/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /home/chyi/ncs/zephyr/build/wireguard/zephyr/dts.cmake

warning: Deprecated symbol MBEDTLS_LEGACY_CRYPTO_C is enabled.
warning: Deprecated symbol POSIX_CLOCK is enabled.
warning: Experimental symbol WIFI_CREDENTIALS is enabled.
warning: Experimental symbol WIFI_READY_LIB is enabled.
warning: Experimental symbol WIFI_NM_WPA_SUPPLICANT is enabled.
warning: Experimental symbol WIFI_NM_WPA_SUPPLICANT is enabled.
warning: Experimental symbol NRF_WIFI_RPU_RECOVERY is enabled.
warning: Experimental symbol POSIX_ASYNCHRONOUS_IO is enabled.
warning: Experimental symbol POSIX_DEVICE_IO is enabled.
warning: Experimental symbol POSIX_FD_MGMT is enabled.
warning: Experimental symbol POSIX_MULTI_PROCESS is enabled.
warning: Experimental symbol POSIX_REALTIME_SIGNALS is enabled.
warning: Experimental symbol POSIX_SIGNALS is enabled.
warning: Experimental symbol NET_BUF_VARIABLE_DATA_SIZE is enabled.
warning: Experimental symbol NET_CONNECTION_MANAGER is enabled.

Parsing /home/chyi/ncs/nrf/samples/net/wireguard/Kconfig
Loaded configuration '/home/chyi/ncs/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_defconfig'
Merged configuration '/home/chyi/ncs/nrf/samples/net/wireguard/prj.conf'
Merged configuration '/home/chyi/ncs/zephyr/build/wireguard/zephyr/.config.sysbuild'
Configuration saved to '/home/chyi/ncs/zephyr/build/wireguard/zephyr/.config'
Kconfig header saved to '/home/chyi/ncs/zephyr/build/wireguard/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38") 
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/chyi/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
=========== Generating psa_crypto_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Backup: CONFIG_MBEDTLS_THREADING: False
Backup: CONFIG_MBEDTLS_THREADING_ALT: True
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Restore: CONFIG_MBEDTLS_THREADING: False
Restore: CONFIG_MBEDTLS_THREADING_ALT: True
=========== End psa_crypto_config ===============
=========== Generating psa_crypto_library_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: False
Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Backup: CONFIG_MBEDTLS_THREADING: False
Backup: CONFIG_MBEDTLS_THREADING_ALT: True
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: True
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: False
Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Restore: CONFIG_MBEDTLS_THREADING: False
Restore: CONFIG_MBEDTLS_THREADING_ALT: True
=========== End psa_crypto_library_config ===============
-- Setting build type to 'MinSizeRel' as none was specified.
-- Using ccache: /home/chyi/ncs/toolchains/b81a7cd864/usr/bin/ccache
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chyi/ncs/zephyr/build/wireguard
-- Configuring done
-- Generating done
-- Build files have been written to: /home/chyi/ncs/zephyr/build
-- west build: building application
[5/10] Performing build step for ‘wireguard’
[1/540] Preparing syscall dependency handling

[5/540] Generating include/generated/zephyr/version.h
-- Zephyr version: 3.7.99 (/home/chyi/ncs/zephyr), build: v3.7.99-ncs1
[540/540] Linking C executable zephyr/zephyr.elf
Memory region Used Size Region Size %age Used
           FLASH: 652012 B 1 MB 62.18%
             RAM: 228208 B 448 KB 49.75%
        IDT_LIST: 0 GB 32 KB 0.00%
Generating files from /home/chyi/ncs/zephyr/build/wireguard/zephyr/zephyr.elf for board: nrf7002dk
[10/10] Generating ../merged.hex

OK, the build is proceeding normally. Next, let's start flash writing (programming) using J-link.

(v2.8.0) chyi@earth:~/ncs/zephyr$ west flash
-- west flash: rebuilding
[0/5] Performing build step for 'wireguard'
ninja: no work to do.
[4/5] cd /home/chyi/ncs/zephyr/build/_sysbuild && /home/chyi/ncs/toolchains/b81a7cd864/usr/local/bin/cmake -E true
-- west flash: using runner nrfjprog
-- runners.nrfjprog: reset after flashing requested
Using board 1050709566
-- runners.nrfjprog: Flashing file: /home/chyi/ncs/zephyr/build/merged.hex

                                             
Applying pin reset.
-- runners.nrfjprog: Board with serial number 1050709566 flashed successfully.

OK, there is nothing wrong with flash writing. 

Finally, let's check the operation on the target board through minicom.

$  sudo minicom -D /dev/ttyACM1

[Figure 3.3]  Serial console - wireguard execution appearance (1)

As mentioned in the previous post, after booting, you need to bring up the virtual interface.

uart:~$  net iface up 2
📌 There's still some work to be done to fix this so that it works without having to run this command later. 😂

Next, try pinging peer wireguard.

uart:~$  net ping 10.1.1.200
📌 Of course, wireguard settings must be set up on the peer side as well.

[Figure 3.4]  Serial console - wireguard execution appearance (2)

OK, it works fine. 😎 

For reference, if you check the thread stack information while the WireGuard app is running, it is as follows:

uart:~$ kernel thread stacks

[Figure 3.5]  Serial console - Checking kernel thread stacks
📌 After searching the source with nrf70_intr_wq, etc., we can see that the location of the wifi device driver for nrf7002 is as follows. It seems that code analysis is needed.
 zephyr/drivers/wifi/nrfwifi
~/ncs/modules/hal/nordic/drivers/nrf_wifi
______________________________________________________________

The entire code written so far can be found on github below (Note: This is still an early version, so there may be bugs).



After running the Wi-Fi example with the nRF7002 DK board, I proceeded with the porting work so that Wireguard can work in a Wi-Fi environment. 👏



4. Other untold stories
Finally, in this chapter, I would like to touch on some topics that I have not been able to cover so far. 💣

4.1 Introduction to Cryptography Examples
The nRF Connect SDK provides a number of examples related to cryptography, so it would be worth analyzing their code.

chyi@earth:~/ncs/nrf/samples/crypto$ ls -la
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 aes_cbc
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 aes_ccm
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 aes_ctr
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 aes_gcm
drwxrwxr-x 4 chyi chyi 4096 November 22 13:29 chachapoly
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 ecdh
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 ecdsa
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 ecjpake
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 eddsa
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 hkdf
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 hmac
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 pbkdf2
drwxrwxr-x 4 chyi chyi 4096 November 22 13:29 persistent_key_usage
drwxrwxr-x 7 chyi chyi 4096 Dec 10 12:24 psa_tls
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 rng
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 rsa
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 sha256
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 spake2p

4.2 Introduction to NFC Examples
The nRF7002 DK board supports NFC (Near Field Communication). Therefore, let's check the operation through the example in the directory below.

chyi@earth:~/ncs/nrf/samples/nfc$ ls -la
drwxrwxr-x 4 chyi chyi 4096 November 22 13:29 record_launch_app
drwxrwxr-x 4 chyi chyi 4096 November 22 13:29 record_text
drwxrwxr-x 4 chyi chyi 4096 November 22 13:29 shell
drwxrwxr-x 3 chyi chyi 4096 November 22 13:29 system_off
drwxrwxr-x 3 chyi chyi 4096 November 22 13:29 tag_reader
drwxrwxr-x 3 chyi chyi 4096 Nov 22 13:29 tnep_poller
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 tnep_tag
drwxrwxr-x 4 chyi chyi 4096 Nov 22 13:29 writable_ndef_msg

4.3 Programming other boards with the J-Link adapter of the nRF7002DK board
The nRF7002 DK board is equipped with a J-link adapter. If you do not have an independent J-link adapter, you can also use the J-link adapter on the nRF7002 DK board to program and debug an external custom board. The figure below shows this, and you will need to test whether it actually works properly.

[Figure 4.1]  Nordic nRF7002 DK - External custom board debugging with J-link adapter  [Source - Reference 3]


4.4 Porting WireGuard in LTE-M (Cat-M1) Environment
Among the Nordic development boards, there are dev kits that support LTE-M and NB-IoT, as shown below. If I have a chance, I would like to purchase this board and do various tests. 🙏

[Figure 4.2] nRF9160 DK board [Source - Reference 6]


To be continued...



5. References
<Nordic boards>
[1]  https://docs.zephyrproject.org/latest/boards/nordic/nrf7002dk/doc/index.html
[2]  https://www.nordicsemi.com/Products/Development-hardware/nrf7002-dk
[3] nRF7002DK Hardware v1.0.0 User Guide, Nordic Semiconductor
[4] nRF5340 Product Specification, v1.5,  Nordic Semiconductor
[5] nRF7002 DK_Product Brief v1.0.pdf  Nordic Semiconductor

[6]  https://www.nordicsemi.com/Products/Development-hardware/nRF9160-DK


<wi-fi 6>
[7]  https://www.juniper.net/content/dam/www/assets/additional-resources/kr/ko/wi-fi-6-and-wi-fi-6e-quick-guides.pdf
[8]  https://www.eventservice.kr/2019/aruba/00/file/1022_aruba_WP_802.11AX.pdf
[9]  https://www.intel.com/content/dam/www/central-libraries/us/en/documents/2022-06/wi-fi-tutorial-long.pdf
[10]  https://www.i-pex.com/ko-kr/library/article/what-is-wi-fi-6-6e
[11]  https://www.intel.co.kr/content/www/kr/ko/gaming/resources/wifi-6.html
[12]  https://hilelectronic.com/wifi-6-vs-wifi-5/
[13]  https://www.tp-link.com/kr/wifi6/
[14]  https://www.hpe.com/kr/ko/what-is/wi-fi-6.html
[15]  https://netbeez.net/blog/how-wifi-connection-works/
[16]  https://academy.nordicsemi.com/courses/wi-fi-fundamentals/lessons/lesson-1-wifi-fundamentals/topic/what-is-wifi/

[17]  https://kr.pinterest.com/pin/741757001152752781/

[18] And, Google~


Slowboot

댓글 없음:

댓글 쓰기