Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: wifi: nxp: Fix the compilation error on the MIMXRT1170_EVK board with the NXP_88W8987_MURATA_1ZM_M2 WiFi module #83092

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/wifi/nxp/Kconfig.nxp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ config NXP_88W8801_MURATA_2DS_USD
https://www.murata.com/en-us/products/connectivitymodule/wi-fi-bluetooth/overview/lineup/type2ds
https://www.murata.com/en-us/products/connectivitymodule/wi-fi-bluetooth/overview/lineup/usd-m2-adapter

config NXP_88W8801_MURATA_2DS_USD
config NXP_88W8801_MURATA_2DS_M2
bool "NXP MURATA-2DS-M2"
help
Murata Type 2DS is a small high-performance module (integrated PCB antenna)
Expand Down
13 changes: 11 additions & 2 deletions drivers/wifi/nxp/nxp_wifi_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1343,18 +1343,23 @@ static int nxp_wifi_power_save(const struct device *dev, struct wifi_ps_params *
}
break;
case WIFI_PS_PARAM_MODE:

if (params->mode == WIFI_PS_MODE_WMM) {
#if CONFIG_NXP_WIFI_WMM_UAPSD
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#if CONFIG_NXP_WIFI_WMM_UAPSD
#ifdef CONFIG_NXP_WIFI_WMM_UAPSD

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same for other #if CONFIG_NXP_WIFI_WMM_UAPSD

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This modification was added to prevent compilation errors when the “Disable WMM feature” configuration is applied.

ret = wlan_set_wmm_uapsd(1);

if (ret != WM_SUCCESS) {
status = NXP_WIFI_RET_FAIL;
}
#endif
} else if (params->mode == WIFI_PS_MODE_LEGACY) {
#if CONFIG_NXP_WIFI_WMM_UAPSD
ret = wlan_set_wmm_uapsd(0);

if (ret != WM_SUCCESS) {
status = NXP_WIFI_RET_FAIL;
}
}
#endif
}
break;
case WIFI_PS_PARAM_TIMEOUT:
Expand Down Expand Up @@ -1405,11 +1410,15 @@ int nxp_wifi_get_power_save(const struct device *dev, struct wifi_ps_config *con
config->ps_params.wakeup_mode = WIFI_PS_WAKEUP_MODE_DTIM;
}

#if CONFIG_NXP_WIFI_WMM_UAPSD
if (wlan_is_wmm_uapsd_enabled()) {
config->ps_params.mode = WIFI_PS_MODE_WMM;
} else {
} else
#endif
{
config->ps_params.mode = WIFI_PS_MODE_LEGACY;
}

} else {
status = NXP_WIFI_RET_FAIL;
}
Expand Down
32 changes: 32 additions & 0 deletions dts/bindings/wifi/nxp,wifi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,35 @@ description: |
compatible: "nxp,wifi"

include: [sd-device.yaml, pinctrl-device.yaml]

properties:

pdn-gpios:
type: phandle-array
required: false
description: |
Power Down control GPIO pin.

Signal states:
- High: Module enabled and internally powered
- Low: Module disabled and powered down

wl_rst-gpios:
type: phandle-array
required: false
description: |
WiFi SDIO reset control GPIO pin.

Signal states:
- High: Normal operation mode
- Low: Module held in reset state

bt_rst-gpios:
type: phandle-array
required: false
description: |
Bluetooth reset control GPIO pin.

Signal states:
- High: Normal operation mode
- Low: Bluetooth held in reset state
168 changes: 168 additions & 0 deletions samples/net/wifi/shell/boards/mimxrt1170_evk_mimxrt1176_cm7_A.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
# Early Console and Debug Configuration
CONFIG_EARLY_CONSOLE=y
CONFIG_LOG=y
CONFIG_LOG_MODE_IMMEDIATE=y
# CONFIG_WIFI_LOG_LEVEL_DBG=y
# CONFIG_NET_LOG=y
# CONFIG_NET_SOCKETS_LOG_LEVEL_DBG=y
# CONFIG_NET_MGMT_EVENT_LOG_LEVEL_DBG=y
CONFIG_INIT_STACKS=y
CONFIG_TEST_RANDOM_GENERATOR=y

# OS and Memory Configuration
CONFIG_THREAD_CUSTOM_DATA=y
CONFIG_EVENTS=y
CONFIG_SYS_HEAP_AUTO=y
CONFIG_HEAP_MEM_POOL_SIZE=307200
CONFIG_SCHED_MULTIQ=y
CONFIG_ZVFS_OPEN_MAX=30
CONFIG_POSIX_API=y
CONFIG_BUILD_OUTPUT_HEX=y

# Stack Size Configuration
CONFIG_MAIN_STACK_SIZE=5200
CONFIG_SHELL_STACK_SIZE=8192
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_NET_MGMT_EVENT_STACK_SIZE=4096
CONFIG_NET_SOCKETS_SERVICE_STACK_SIZE=4096

# WiFi Core Configuration
CONFIG_WIFI=y
CONFIG_WIFI_LOG_LEVEL_ERR=y
CONFIG_WIFI_NXP=y

CONFIG_NXP_88W8987=y
CONFIG_NXP_88W8987_MURATA_1ZM_M2=y
# CONFIG_NXP_88W8987_MURATA_1ZM_USD=y
# CONFIG_NXP_88W8987_AW_CM358_USD=y
# CONFIG_NXP_88W8987_AW_CM358MA_M2=y

# CONFIG_NXP_IW416=y
# CONFIG_NXP_IW416_AW_AM457MA_M2=y
# CONFIG_NXP_IW416_AW_AM457_USD=y
# CONFIG_NXP_IW416_AW_AM510_USD=y
# CONFIG_NXP_IW416_AW_AM510MA_M2=y
# CONFIG_NXP_IW416_MURATA_1XK_USD=y
# CONFIG_NXP_IW416_MURATA_1XK_M2=y

# CONFIG_NXP_IW61X=y
# CONFIG_NXP_IW612_MURATA_2EL_USD=y
# CONFIG_NXP_IW612_MURATA_2EL_M2=y
# CONFIG_NXP_IW611_MURATA_2DL_USD=y
# CONFIG_NXP_IW611_MURATA_2DL_M2=y

# CONFIG_NXP_88W8801=y
# CONFIG_NXP_88W8801_AW_NM191_USD=y
# CONFIG_NXP_88W8801_AW_NM191MA_M2=y
# CONFIG_NXP_88W8801_MURATA_2DS_USD=y
# CONFIG_NXP_88W8801_MURATA_2DS_M2=y


# WiFi Task Stack Configuration
CONFIG_NXP_WIFI_MON_TASK_STACK_SIZE=2048
CONFIG_NXP_WIFI_WLCMGR_TASK_STACK_SIZE=8192
CONFIG_NXP_WIFI_POWERSAVE_TASK_STACK_SIZE=1024
CONFIG_NXP_WIFI_TX_TASK_STACK_SIZE=4096
CONFIG_NXP_WIFI_DRIVER_TASK_STACK_SIZE=4096
CONFIG_NXP_WIFI_SCAN_TASK_STACK_SIZE=4096

# Disable WMM feature
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need this Disable WMM feature part?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During the device testing process, I encountered an issue where the device failed to operate normally. My initial assessment suggested that the problem might be due to the CONFIG_NXP_WIFI_WMM configuration being enabled (although later verification revealed this not to be the case). To test this hypothesis, I attempted to disable the configuration, but encountered compilation errors. To resolve this issue, I added the aforementioned macro definitions. After thorough testing, it was confirmed that these new codes do not affect the functionality of the original code, therefore I have retained these modifications.

# CONFIG_NXP_WIFI_WMM=n
# CONFIG_NXP_WIFI_WMM_UAPSD=n
# CONFIG_NXP_WIFI_SDIO_MULTI_PORT_TX_AGGR=n
# CONFIG_NXP_WIFI_TURBO_MODE=n
# CONFIG_NXP_WIFI_11AX=n
# CONFIG_NXP_WIFI_11AC=n

# SDIO Configuration
CONFIG_SDHC=y
CONFIG_SDIO_STACK=y

# Network Core Configuration
CONFIG_NETWORKING=y
CONFIG_NET_IPV4=y
CONFIG_NET_IPV6=y
CONFIG_NET_TCP=y
CONFIG_NET_L2_ETHERNET=y
# CONFIG_NET_L2_ETHERNET_MGMT=y
# CONFIG_NET_MGMT=y
# CONFIG_NET_MGMT_EVENT=y

# Network Buffer Configuration
# CONFIG_NET_BUF=y
CONFIG_NET_BUF_LOG=y
CONFIG_NET_BUF_DATA_SIZE=2048
CONFIG_NET_PKT_RX_COUNT=32
CONFIG_NET_PKT_TX_COUNT=32
CONFIG_NET_BUF_RX_COUNT=64
CONFIG_NET_BUF_TX_COUNT=64
CONFIG_NET_MAX_CONTEXTS=16

# Network Thread Priority Configuration
CONFIG_NET_TC_THREAD_PRIO_CUSTOM=y
CONFIG_NET_TC_THREAD_PREEMPTIVE=y
CONFIG_NET_TCP_WORKER_PRIO=-16
CONFIG_NET_TCP_WORKQ_STACK_SIZE=2048
CONFIG_NET_TC_TX_THREAD_BASE_PRIO=3
CONFIG_NET_TC_RX_THREAD_BASE_PRIO=3
CONFIG_ZPERF_WORK_Q_THREAD_PRIORITY=3
CONFIG_NET_SOCKETS_SERVICE_THREAD_PRIO=3
CONFIG_NET_TC_SKIP_FOR_HIGH_PRIO=y
CONFIG_NET_CONTEXT_PRIORITY=y
CONFIG_NET_MGMT_THREAD_PRIO_CUSTOM=y
CONFIG_NET_MGMT_THREAD_PRIORITY=3

# Network Protocol Configuration
CONFIG_NET_TC_TX_COUNT=1
CONFIG_NET_TC_RX_COUNT=1
CONFIG_NET_MGMT_EVENT_QUEUE_SIZE=32
CONFIG_NET_MGMT_EVENT_QUEUE_TIMEOUT=5000
CONFIG_NET_IF_MAX_IPV4_COUNT=4
CONFIG_NET_IF_MAX_IPV6_COUNT=4
CONFIG_NET_MAX_CONN=10

# DHCP Configuration
CONFIG_NET_DHCPV4=y
# CONFIG_NET_DHCPV4_INITIAL_DELAY_MAX=10
CONFIG_NET_DHCPV4_SERVER_ADDR_COUNT=32
CONFIG_NET_DHCPV4_SERVER_ICMP_PROBE_TIMEOUT=100

# DNS Configuration
CONFIG_DNS_RESOLVER=y
CONFIG_DNS_RESOLVER_MAX_SERVERS=2
CONFIG_NET_SOCKETS_POLL_MAX=14

# Network Features
CONFIG_NET_IPV4_FRAGMENT=y
CONFIG_NET_IPV4_FRAGMENT_MAX_COUNT=3
CONFIG_NET_IPV4_FRAGMENT_MAX_PKT=7
CONFIG_NET_IPV4_FRAGMENT_TIMEOUT=3
CONFIG_NET_IPV6_FRAGMENT=y
CONFIG_NET_IPV6_FRAGMENT_MAX_COUNT=3
CONFIG_NET_IPV6_FRAGMENT_MAX_PKT=8
CONFIG_NET_IPV6_FRAGMENT_TIMEOUT=3

# Shell Configuration
CONFIG_NET_SHELL=y
CONFIG_NXP_WIFI_SHELL=y
CONFIG_NET_L2_WIFI_SHELL=y
CONFIG_SHELL=y
# CONFIG_SHELL_BACKEND_SERIAL=y
CONFIG_SHELL_CMD_BUFF_SIZE=512
CONFIG_SHELL_ARGC_MAX=48
CONFIG_WIFI_SHELL_MAX_AP_STA=8
CONFIG_WIFI_MGMT_AP_MAX_NUM_STA=8

# Network Statistics
CONFIG_NET_STATISTICS=y
CONFIG_NET_STATISTICS_PERIODIC_OUTPUT=n
CONFIG_NET_STATISTICS_WIFI=y
CONFIG_NET_STATISTICS_USER_API=y


# Performance Testing
CONFIG_NET_ZPERF=y
CONFIG_NET_ZPERF_MAX_PACKET_SIZE=1500
CONFIG_NET_ZPERF_MAX_SESSIONS=6
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

&usdhc1 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
pinctrl-0 = <&pinmux_usdhc1>;
pinctrl-1 = <&pinmux_usdhc1_dat3_nopull>;
pinctrl-names = "default", "nopull";
pwr-gpios = <&gpio10 2 GPIO_ACTIVE_LOW>;
power-delay-ms = <100>;

wifi: nxp_wifi@0 {
compatible = "nxp,wifi";
reg = <0>;
status = "okay";

pdn-gpios = <&gpio9 30 GPIO_ACTIVE_HIGH>;
wl_rst-gpios = <&gpio9 15 GPIO_ACTIVE_HIGH>;
};
};
1 change: 1 addition & 0 deletions samples/net/wifi/shell/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,4 @@ tests:
platform_allow:
- frdm_rw612
- rd_rw612_bga
- mimxrt1170_evk/mimxrt1176/cm7
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ manifest:
groups:
- hal
- name: hal_nxp
revision: d2e2514cbe70babc2dfe6e8eb0e4f9e4c97769b6
revision: pull/489/head
path: modules/hal/nxp
groups:
- hal
Expand Down
Loading