mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-09 20:45:41 +08:00
update drv_wifi.c
This commit is contained in:
1 parent
ff9162a994
commit
54a28abb4b
6 files changed
+330
-150
No files matched your search
@@ -0,0 +1,166 @@
|
||||
# STM32F4xx-HAL 板级支持包
|
||||
|
||||
## 1. 简介
|
||||
|
||||
amebaz 是由Realtek推出的Cortex-M4内核的WiFi SOC芯片rtl8710b系列
|
||||
包括如下硬件特性:
|
||||
|
||||
| 硬件 | 描述 |
|
||||
| -- | -- |
|
||||
|芯片型号| amebaz |
|
||||
|CPU| Cortex-M4 |
|
||||
|主频| 125MHz |
|
||||
|
||||
## 2. 编译说明
|
||||
|
||||
|
||||
| 环境 | 说明 |
|
||||
| ------------ | ------------------------------------------------------------ |
|
||||
| PC操作系统 | Linux/MacOS/Windows |
|
||||
| 编译器 | arm-none-eabi-gcc version 6.3.1 20170620 (release)/iar |
|
||||
| 构建工具 | scons/iar |
|
||||
| 依赖软件环境 | Env工具/(IAR或arm-none-eabi-gcc)/git/调试器驱动 |
|
||||
|
||||
1) 下载源码
|
||||
|
||||
```bash
|
||||
git clone https://github.com/RT-Thread/rt-thread.git
|
||||
```
|
||||
|
||||
2) 配置工程并准备env
|
||||
|
||||
(Linux/Mac)
|
||||
|
||||
```bash
|
||||
cd rt-thread/bsp/amebaz
|
||||
scons --menuconfig
|
||||
source ~/.env/env.sh
|
||||
pkgs --upgrade
|
||||
```
|
||||
|
||||
(Windows)
|
||||
|
||||
>在[RT-Thread官网][1]下载ENV工具包
|
||||
|
||||
3) 配置芯片型号
|
||||
|
||||
(Linux/Mac)
|
||||
|
||||
```bash
|
||||
scons --menuconfig
|
||||
```
|
||||
|
||||
(Windows(ENV环境中))
|
||||
|
||||
```bash
|
||||
menuconfig
|
||||
```
|
||||
|
||||
在menuconfig页面配置并选择对应的芯片型号,若开发环境为IAR,则需要生成工程
|
||||
|
||||
4) 下载package
|
||||
|
||||
amebaz配套的驱动库以package形式提供,故需先下载对应的package(realtek-ameba),请使用env下载package
|
||||
|
||||
```bash
|
||||
pkgs --update
|
||||
```
|
||||
|
||||
5) 生成工程(Mac/Linux下请跳过此步骤)
|
||||
|
||||
(Windows IAR)
|
||||
|
||||
```bash
|
||||
SET RTT_CC=iar
|
||||
scons --target=iar -s
|
||||
```
|
||||
|
||||
*该板级支持包不支持生成mdk的工程
|
||||
|
||||
|
||||
6) 编译
|
||||
|
||||
使用IAR请参见对应教程
|
||||
|
||||
(Windows arm-none-eabi-gcc)
|
||||
使用以下指令设置gcc路径
|
||||
|
||||
```bash
|
||||
SET RTT_EXEC_PATH=[GCC路径]
|
||||
```
|
||||
|
||||
(Linux/Mac arm-none-eabi-gcc)
|
||||
使用以下指令设置gcc路径
|
||||
|
||||
```bash
|
||||
export RTT_EXEC_PATH=[GCC路径]
|
||||
```
|
||||
|
||||
编译(WindowsLinux/Mac arm-none-eabi-gcc)
|
||||
|
||||
```bash
|
||||
scons -j4
|
||||
```
|
||||
|
||||
出现下列信息即为编译成功
|
||||
|
||||
```bash
|
||||
LINK rtthread.axf
|
||||
arm-none-eabi-objcopy -j .ram_image2.entry -j .ram_image2.data -j .ram_image2.bss -j .ram_image2.skb.bss -j .ram_heap.data -Obinary rtthread.axf ram_2.r.bin
|
||||
arm-none-eabi-objcopy -j .xip_image2.text -Obinary rtthread.axf xip_image2.bin
|
||||
arm-none-eabi-objcopy -j .ram_rdp.text -Obinary rtthread.axf rdp.bin
|
||||
python gen_bin.py
|
||||
is_law = 1
|
||||
start = 10005000, end = 0, base = 10000000
|
||||
Input file size: 65852
|
||||
copy size 45372
|
||||
start = 10005000, end = 0, base = 10000000
|
||||
Input file size: 45372
|
||||
copy size 24892
|
||||
start = 0, end = 0, base = 0
|
||||
Input file size: 336816
|
||||
copy size 336816
|
||||
size = 361772
|
||||
checksum 209b36c
|
||||
'true' is not recognized as an internal or external command,
|
||||
operable program or batch file.
|
||||
Done...
|
||||
scons: done building targets.
|
||||
```
|
||||
|
||||
如果编译正确无误,会产生image2_all_ota1.bin文件。
|
||||
|
||||
## 3. 烧写及执行
|
||||
|
||||
烧写可以使用仿真器 串口等多种方式 此处不再赘述
|
||||
|
||||
### 3.1 运行结果
|
||||
|
||||
如果编译 & 烧写无误,会在专用日志串口*上看到RT-Thread的启动logo信息:
|
||||
|
||||
```bash
|
||||
\ | /
|
||||
- RT - Thread Operating System
|
||||
/ | \ 3.0.4 build May 15 2018
|
||||
2006 - 2018 Copyright by rt-thread team
|
||||
msh />
|
||||
```
|
||||
|
||||
*默认串口
|
||||
|
||||
|
||||
## 4. 驱动支持情况及计划
|
||||
|
||||
| 驱动 | 支持情况 | 备注 |
|
||||
| ---------- | :------: | :--------------------------: |
|
||||
| UART | 支持 | UART0 |
|
||||
|
||||
|
||||
## 6. 联系人信息
|
||||
|
||||
维护人:
|
||||
[flyingcys][4] < [flyingcys@163.com][5] >
|
||||
|
||||
[1]: https://www.rt-thread.org/page/download.html
|
||||
[4]: https://github.com/flyingcys
|
||||
[5]: mailto:flyingcys@163.com
|
||||
@@ -33,6 +33,9 @@
|
||||
//#define ETH_TX_DUMP
|
||||
//#define MINI_DUMP
|
||||
|
||||
struct sk_buff * rltk_wlan_get_recv_skb(int idx);
|
||||
struct sk_buff * rltk_wlan_alloc_skb(unsigned int total_len);
|
||||
|
||||
#define MAX_ADDR_LEN 6
|
||||
|
||||
struct ameba_wifi
|
||||
@@ -217,9 +220,9 @@ struct netif *rltk_wlan_get_netif(int idx)
|
||||
struct netif *netif;
|
||||
|
||||
if(idx == 0)
|
||||
netif = &wifi_sta.parent.parent.netif;
|
||||
else if(idx = 1)
|
||||
netif = &wifi_ap.parent.parent.netif;
|
||||
netif = wifi_sta.parent.parent.netif;
|
||||
else if(idx == 1)
|
||||
netif = wifi_ap.parent.parent.netif;
|
||||
|
||||
return netif;
|
||||
}
|
||||
@@ -356,7 +359,7 @@ rt_err_t rt_ameba_wifi_control(rt_device_t dev, int cmd, void *args)
|
||||
{
|
||||
int *channel = (int *)args;
|
||||
|
||||
channel = amebaz_wifi_get_channel();
|
||||
*channel = amebaz_wifi_get_channel();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
+146
-135
File diff suppressed because it is too large.
Load diff
@@ -37,7 +37,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>MacFile</name>
|
||||
<state>$PROJ_DIR$\packages\realtek_ameba\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\preload.mac</state>
|
||||
<state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\preload.mac</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>MemOverride</name>
|
||||
@@ -45,7 +45,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>MemFile</name>
|
||||
<state>$PROJ_DIR$\packages\realtek_ameba\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\8710b.ddf</state>
|
||||
<state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\8710b.ddf</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>RunToEnable</name>
|
||||
@@ -603,7 +603,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>IjetCpuClockEdit</name>
|
||||
<state>72.0</state>
|
||||
<state></state>
|
||||
</option>
|
||||
<option>
|
||||
<name>IjetSwoPrescalerList</name>
|
||||
|
||||
@@ -636,8 +636,8 @@
|
||||
<name>BUILDACTION</name>
|
||||
<archiveVersion>1</archiveVersion>
|
||||
<data>
|
||||
<prebuild>CSCRIPT "$PROJ_DIR$\packages\realtek_ameba\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\prebuild.vbs" "$PROJ_DIR$" "1" "0x08080000"</prebuild>
|
||||
<postbuild>CSCRIPT "$PROJ_DIR$\packages\realtek_ameba\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\postbuild_img2.vbs" "$TARGET_DIR$" "$PROJ_DIR$"</postbuild>
|
||||
<prebuild>CSCRIPT "$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\prebuild.vbs" "$PROJ_DIR$" "1" "0x08080000"</prebuild>
|
||||
<postbuild>CSCRIPT "$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\postbuild_img2.vbs" "$TARGET_DIR$" "$PROJ_DIR$"</postbuild>
|
||||
</data>
|
||||
</settings>
|
||||
<settings>
|
||||
@@ -673,7 +673,7 @@
|
||||
</option>
|
||||
<option>
|
||||
<name>IlinkRawBinaryFile</name>
|
||||
<state>$PROJ_DIR$\packages\realtek_ameba\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\image\boot_all.bin</state>
|
||||
<state>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\bsp\image\boot_all.bin</state>
|
||||
</option>
|
||||
<option>
|
||||
<name>IlinkRawBinarySymbol</name>
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
<flash_board>
|
||||
<pass>
|
||||
<range>CODE 0x8000000 0x8004fff</range>
|
||||
<loader>$PROJ_DIR$\packages\realtek_ameba\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\flashloader\FlashRTL8195aMP.flash</loader>
|
||||
<loader>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\flashloader\FlashRTL8195aMP.flash</loader>
|
||||
<abs_offset>0x00000000</abs_offset>
|
||||
</pass>
|
||||
<pass>
|
||||
<range>CODE 0x800b020 0x807ffff</range>
|
||||
<loader>$PROJ_DIR$\packages\realtek_ameba\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\flashloader\FlashRTL8195aMP.flash</loader>
|
||||
<loader>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\flashloader\FlashRTL8195aMP.flash</loader>
|
||||
<abs_offset>0xb020</abs_offset>
|
||||
</pass>
|
||||
<pass>
|
||||
<range>CODE 0x10005000 0x10005A43</range>
|
||||
<loader>$PROJ_DIR$\packages\realtek_ameba\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\flashloader\FlashRTL8195aMP.flash</loader>
|
||||
<range>CODE 0x10005000 0x10005A6B</range>
|
||||
<loader>$PROJ_DIR$\packages\realtek_ameba-latest\sdk-ameba-v4.0b_without_NDA_GCC_V1.0.0\component\soc\realtek\8711b\misc\iar_utility\common\flashloader\FlashRTL8195aMP.flash</loader>
|
||||
<abs_offset>0xb000</abs_offset>
|
||||
<args>--concat</args>
|
||||
</pass>
|
||||
<ignore>CODE 0x10005a44 0x1003dfff</ignore>
|
||||
<ignore>CODE 0x10005a6c 0x1003dfff</ignore>
|
||||
</flash_board>
|
||||
Reference in new issue
Block a user