mirror of
https://github.com/open-sdr/openwifi.git
synced 2025-01-18 02:39:44 +00:00
Add doc for dynamic reloading drv/FPGA
This commit is contained in:
parent
94847d8099
commit
40773b7882
14
README.md
14
README.md
@ -83,10 +83,12 @@ zcu102_9371|[Xilinx ZCU102 board](https://www.xilinx.com/products/boards-and-kit
|
||||
```
|
||||
ssh root@192.168.10.122
|
||||
```
|
||||
- On board, run openwifi AP and the on board webserver
|
||||
- Then, run openwifi AP and the on board webserver
|
||||
```
|
||||
~/openwifi/fosdem.sh
|
||||
(Use "./fosdem.sh 1" to enable experimental AMPDU aggregation on top of 11n)
|
||||
cd openwifi
|
||||
./wgd.sh
|
||||
./fosdem.sh
|
||||
(Use "./wgd.sh 1" to enable experimental AMPDU aggregation on top of 11n)
|
||||
(Use "./fosdem-11ag.sh" to force 11a/g mode)
|
||||
```
|
||||
**NOTE** adrv9361z7035 has ultra low TX power in 5GHz. Move **CLOSER** when you use that board in 5GHz!!!
|
||||
@ -156,6 +158,8 @@ Since the pre-built SD card image might not have the latest bug-fixes/updates, i
|
||||
umount /mnt
|
||||
```
|
||||
**Power cycle** the board to load new FPGA bitstream.
|
||||
|
||||
To load FPGA dynamically without rebooting/power-cycle, check [Driver and FPGA dynamic reloading app note](./doc/app_notes/drv_fpga_dynamic_loading.md).
|
||||
|
||||
## Update Driver
|
||||
|
||||
@ -176,7 +180,9 @@ Since the pre-built SD card image might not have the latest bug-fixes/updates, i
|
||||
```
|
||||
cd openwifi/driver; scp `find ./ -name \*.ko` root@192.168.10.122:openwifi/
|
||||
```
|
||||
Now you can use **wgd.sh** on board to load the new openwifi driver.
|
||||
Now you can use **wgd.sh** on board to load the new openwifi driver. **wgd.sh** also tries to reload FPGA img if system_top.bit.bin presents in the same directory.
|
||||
Find more information in [Driver and FPGA dynamic reloading app note](./doc/app_notes/drv_fpga_dynamic_loading.md).
|
||||
|
||||
**Note**: If you have symbol or version error while loadng the driver, it could be because the kernel in the SD card image is too old. In this case, you need to follow [[Build openwifi Linux img from scratch](#Build-openwifi-Linux-img-from-scratch)] to generate your new SD card image.
|
||||
|
||||
## Update sdrctl
|
||||
|
@ -20,4 +20,5 @@ Application notes collect many small topics about using openwifi in different sc
|
||||
- [Access counter/statistics in FPGA](perf_counter.md)
|
||||
- [Access counter/statistics in driver](driver_stat.md)
|
||||
- [Frequent/usual trick on controlling Gain/Att/Frequency/CCA/LBT/CSMA/CW/Sensitivity/etc](frequent_trick.md)
|
||||
- [Driver and FPGA dynamic reloading](drv_fpga_dynamic_loading.md)
|
||||
- [owfuzz: a WiFi protocol fuzzing tool using openwifi.](https://github.com/alipay/WiFi-Protocol-Fuzzing-Tool) [[**Vulnerabilities**]](https://github.com/E7mer/Owfuzz)
|
||||
|
56
doc/app_notes/drv_fpga_dynamic_loading.md
Normal file
56
doc/app_notes/drv_fpga_dynamic_loading.md
Normal file
@ -0,0 +1,56 @@
|
||||
The **wgd.sh** (running on board) supports reloading driver and/or FPGA image dynamically without rebooting/power-cycle. It can work in different modes in a
|
||||
flexible way.
|
||||
|
||||
- [[Reload driver only](#Reload-driver-only)]
|
||||
- [[Reload driver and FPGA](#Reload-driver-and-FPGA)]
|
||||
- [[Reload driver and FPGA in target directory](#Reload-driver-and-FPGA-in-target-directory)]
|
||||
- [[Reload driver and FPGA from a single package file](#Reload-driver-and-FPGA-from-a-single-package-file)]
|
||||
- [[Detailed full usage info](#Detailed-full-usage-info)]
|
||||
|
||||
## Reload driver only
|
||||
This is the original way. To let **wgd.sh** only loads the driver without touching FPGA, please ensure FPGA image file **system_top.bit.bin** does **NOT**
|
||||
present in the directory. If wgd.sh can not find the FPGA image, it will skip reloading it.
|
||||
|
||||
## Reload driver and FPGA
|
||||
- Generate the reloadable FPGA file **system_top.bit.bin**. In the Linux host computer:
|
||||
```
|
||||
cd openwifi/user_space
|
||||
./drv_and_fpga_package_gen.sh $OPENWIFI_HW_DIR $XILINX_DIR $BOARD_NAME
|
||||
```
|
||||
Then **system_top.bit.bin** will be generated in openwifi/user_space
|
||||
- Put **system_top.bit.bin** on board in the same directory as wgd.sh and other driver files (.ko)
|
||||
- Run **wgd.sh** on board as usual
|
||||
|
||||
## Reload driver and FPGA in target directory
|
||||
Put **system_top.bit.bin** on board together with other driver files (.ko) in a directory ($TARGET_DIR), then run on board:
|
||||
```
|
||||
./wgd.sh $TARGET_DIR
|
||||
```
|
||||
In this way, different versions/variants of driver/FPGA can be put in different directories. Then **wgd.sh** can be used to switch
|
||||
between them without rebooting/power-cycle.
|
||||
|
||||
## Reload driver and FPGA from a single package file
|
||||
The openwifi/user_space/**drv_and_fpga_package_gen.sh** also generates a single package file **drv_and_fpga.tar.gz**, which includes driver files (.ko),
|
||||
FPGA image and many other rich source files/infos that are related. You can rename it with a more meaningful name (such as add version or variant info), and put
|
||||
the renamed **drv_and_fpga_MEANINGFUL_POSTFIX.tar.gz** on board in the same directory as **wgd.sh**, and let **wgd.sh** load it:
|
||||
```
|
||||
./wgd.sh ./drv_and_fpga_MEANINGFUL_POSTFIX.tar.gz
|
||||
```
|
||||
In this way, different version/variants of driver/FPGA can be packaged as different files. Then **wgd.sh** can be used to switch
|
||||
between them without rebooting/power-cycle.
|
||||
|
||||
## Detailed full usage info
|
||||
Run the "./wgd.sh -h" on board or open wgd.sh to see full usage info:
|
||||
```
|
||||
usage:
|
||||
Script for load (or download+load) different driver and FPGA img without rebooting
|
||||
no argument: Load .ko driver files and FPGA img (if system_top.bit.bin exist) in current dir with test_mode=0.
|
||||
1st argument: If it is a NUMBER, it will be assigned to test_mode. Then load everything from current dir.
|
||||
1st argument: If it is a string called "remote", it will download driver/FPGA and load everything.
|
||||
- 2nd argument (if exist) is the target directory name for downloading and reloading
|
||||
- 3rd argument (if exist) is the value for test_mode
|
||||
1st argument: neither NUMBER nor "remote" nor a .tar.gz file, it is regarded as a directory and load everything from it.
|
||||
- 2nd argument (if exist) is the value for test_mode
|
||||
1st argument: a .tar.gz file, it will be unpacked then load from that unpacked directory
|
||||
- 2nd argument (if exist) is the value for test_mode
|
||||
```
|
Loading…
Reference in New Issue
Block a user