Quellcode durchsuchen

add support for custom nvram files

Evlers vor 1 Jahr
Ursprung
Commit
743aa5ab4d
4 geänderte Dateien mit 38 neuen und 21 gelöschten Zeilen
  1. 5 1
      Kconfig
  2. 7 1
      README.md
  3. 7 1
      README_CN.md
  4. 19 18
      SConscript

+ 5 - 1
Kconfig

@@ -33,7 +33,7 @@ menuconfig PKG_USING_WIFI_HOST_DRIVER
         endchoice
 
         menuconfig WHD_RESOURCES_IN_EXTERNAL_STORAGE
-            bool "Use resources in external storage(FAL)"
+            bool "Using resources in external storage(FAL)"
             select RT_USING_FAL
             default n
 
@@ -53,6 +53,10 @@ menuconfig PKG_USING_WIFI_HOST_DRIVER
 
             endif
 
+        config WHD_RESOURCES_CUSTOM_NVRAM
+            bool "Using custom nvram files"
+            default n
+
         config CY_WIFI_DEFAULT_ENABLE_POWERSAVE_MODE
             bool "Default enable powersave mode"
             default n

+ 7 - 1
README.md

@@ -23,7 +23,8 @@ RT-Thread online packages  --->                         # Online software packag
 ```
 --- Wifi-Host-Driver(WHD) for RT-Thread
       Select Chips (CYW43438)  --->                     # Select the corresponding chip
-[*]   Use resources in external storage(FAL)  --->      # Use the FAL component to load the resource
+[*]   Using resources in external storage(FAL)  --->    # Using the FAL component to load the resource
+[ ]   Using custom nvram files                          # Use custom nvram header files
 [ ]   Default enable powersave mode                     # The low power mode is selected by default
 (8)   The priority level value of WHD thread            # Configure the priority of the WHD thread
 (5120) The stack size for WHD thread                    # Configure the stack size of the WHD thread
@@ -35,6 +36,11 @@ RT-Thread online packages  --->                         # Online software packag
 (500) Set the waiting time for mmcsd card scanning      # Set the waiting time for the scan cards
 ```
 
+- When using the FAL component to load a resource file, FAL component is automatically selected, user must transfer the `firmware` and `clm` files used by the WiFi module to the corresponding partition of FAL.
+- When using a custom `nvram` file, users need to write their own `wifi_nvram_image.h` file and include the header file path, refer to the [wifi_nvram_image.h](./wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_43012/COMPONENT_CYSBSYS-RP01/wifi_nvram_image.h) file that comes with `WHD`.
+- When using the default enable powersave mode, the module will enter the energy saving mode when idle, which will cause the `SDIO` driver to print a timeout log when the module is woken up. This is a normal phenomenon.
+- The waiting time for mmcsd device driver to scan the card refers to the waiting time for the `RT-Thread sdio` device driver to scan the WiFi module, and `WHD` needs to wait for the completion of scanning the card before registering the driver.
+
 **Note**<br>
 sdio driver needs to support stream transfer. In the bsp of RT-Thread, most chips do not have the function of adapting stream transfer. <br>
 The `Cortex-M4` core also requires software to compute `CRC16` and send it after the data, reference [stream transmission solution](./docs/SDIO数据流传输.md).<br>

+ 7 - 1
README_CN.md

@@ -24,7 +24,8 @@ RT-Thread online packages  --->                         # 在线软件包
 ```
 --- Wifi-Host-Driver(WHD) for RT-Thread
       Select Chips (CYW43438)  --->                     # 选择相应的芯片
-[*]   Use resources in external storage(FAL)  --->      # 使用FAL组件加载资源
+[*]   Using resources in external storage(FAL)  --->    # 使用FAL组件加载资源
+[ ]   Using custom nvram files                          # 使用自定义nvram头文件
 [ ]   Default enable powersave mode                     # 默认启用低功耗模式
 (8)   The priority level value of WHD thread            # 配置WHD线程的优先级
 (5120) The stack size for WHD thread                    # 配置WHD线程的堆栈大小
@@ -36,6 +37,11 @@ RT-Thread online packages  --->                         # 在线软件包
 (500) Set the waiting time for mmcsd card scanning      # 设置mmcsd设备驱动扫卡的等待时间
 ```
 
+- 使用FAL组件加载资源文件时,FAL组件会自动选中,用户必须将WiFi模组用到的`firmware`和`clm`文件传输到`FAL`对应分区。
+- 使用自定义`nvram`文件时,用户需要自行编写`wifi_nvram_image.h`文件,并包含该头文件路径,可参考`WHD`自带的[wifi_nvram_image.h](./wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_43012/COMPONENT_CYSBSYS-RP01/wifi_nvram_image.h)文件。
+- 默认启用低功耗模式时,模组会在空闲的时候进入节能模式,这会导致唤醒模组时`SDIO`驱动打印超时的日志,这是属于正常现象。
+- mmcsd设备驱动扫卡的等待时间,是指`RT-Thread sdio`设备驱动扫描WiFi模组的等待时间,`WHD`需要等待扫卡完成后才注册驱动。
+
 **注意**<br>
 SDIO驱动需要支持数据流传输,在RT-Thread的bsp中,大多数芯片都未适配数据流传输的功能。<br>
 `Cortex-M4`内核需要软件来计算`CRC16`并在数据后面发送它,参考 [数据流传输解决方案](./docs/SDIO数据流传输.md)。<br>

+ 19 - 18
SConscript

@@ -67,29 +67,30 @@ if GetDepend(['WHD_RESOURCES_IN_EXTERNAL_STORAGE']) == False:
         path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/clm/COMPONENT_43022']
         path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/firmware/COMPONENT_43022/COMPONENT_SM']
 
-# add cyw4343W chip drivers nvram files
-if GetDepend(['WHD_USING_CHIP_CYW4343W']):
-    path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_4343W/COMPONENT_MURATA-1DX']
+if GetDepend(['WHD_RESOURCES_CUSTOM_NVRAM']) == False:
+    # add cyw4343W chip drivers nvram files
+    if GetDepend(['WHD_USING_CHIP_CYW4343W']):
+        path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_4343W/COMPONENT_MURATA-1DX']
 
-# add cyw43438 chip drivers nvram files
-if GetDepend(['WHD_USING_CHIP_CYW43438']):
-    path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_43438/COMPONENT_AW-CU427-P']
+    # add cyw43438 chip drivers nvram files
+    if GetDepend(['WHD_USING_CHIP_CYW43438']):
+        path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_43438/COMPONENT_AW-CU427-P']
 
-# add cyw4373 chip drivers nvram files
-if GetDepend(['WHD_USING_CHIP_CYW4373']):
-    path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_4373/COMPONENT_MURATA-2AE']
+    # add cyw4373 chip drivers nvram files
+    if GetDepend(['WHD_USING_CHIP_CYW4373']):
+        path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_4373/COMPONENT_MURATA-2AE']
 
-# add cyw43012 chip drivers nvram files
-if GetDepend(['WHD_USING_CHIP_CYW43012']):
-    path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_43012/COMPONENT_CYSBSYS-RP01']
+    # add cyw43012 chip drivers nvram files
+    if GetDepend(['WHD_USING_CHIP_CYW43012']):
+        path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_43012/COMPONENT_CYSBSYS-RP01']
 
-# add cyw43439 chip drivers nvram files
-if GetDepend(['WHD_USING_CHIP_CYW43439']):
-    path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_43439/COMPONENT_AZW-IFW56810']
+    # add cyw43439 chip drivers nvram files
+    if GetDepend(['WHD_USING_CHIP_CYW43439']):
+        path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_43439/COMPONENT_AZW-IFW56810']
 
-# add cyw43022 chip drivers nvram files
-if GetDepend(['WHD_USING_CHIP_CYW43022']):
-    path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_43022/COMPONENT_CYW43022CUB']
+    # add cyw43022 chip drivers nvram files
+    if GetDepend(['WHD_USING_CHIP_CYW43022']):
+        path += [cwd + '/wifi-host-driver/WiFi_Host_Driver/resources/nvram/COMPONENT_43022/COMPONENT_CYW43022CUB']
 
 # add whd porting source files
 src += Glob('porting/src/*/*.c')