GithubHelp home page GithubHelp logo

hongye7 / bk7231_rtt_sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aozima/bk7231_rtt_sdk

0.0 0.0 0.0 30.75 MB

bk7231_rtt_sdk

License: MIT License

Python 0.49% C 92.58% Assembly 1.92% Makefile 0.46% C++ 2.60% Objective-C 0.14% Batchfile 0.01% Shell 1.46% HTML 0.01% Perl 0.15% CMake 0.06% Tcl 0.01% DIGITAL Command Language 0.03% Module Management System 0.01% Roff 0.01% RPC 0.03% Ruby 0.01% Pawn 0.01% M4 0.04% Lex 0.02%

bk7231_rtt_sdk's Introduction

RT-Thread for Beken7231平台说明

发布目录说明

目录 说明
applications RT-Thread OS的应用代码,包含main函数入口
beken378 Beken7231官方SDK
drivers RT-Thread提供的Beken7231的驱动程序代码,包含板级入口代码
libcpu 该目录包含芯片启动代码,中断处理等
rt-thread RT-Thread 开源核心及外围组件代码(3.0.2版本)
simples RT-Thread提供的应用Demo
test 测试的Demo

支持的功能

  • station
  • soft-AP
  • airkiss
  • http client
  • web client
  • TLS
  • OTA升级
  • MQTT
  • netio
  • iperf

编译和下载

编译

  • 启动env
    执行 tools/env/console.exe
    32位系统请使用 console_32.exe

  • 编译

cd ../../bk7231
scons
  • 下载
    执行encrypt.bat脚本,生成rtthread_crc.bin
    通过Hid Download Tool工具,下载rtthread_crc.bin文件到Flash

平台初始化说明

该工程默认使用串口1,下载代码后,连接串口1,打开终端工具,运行现象如下图所示:

系统正常运行现象

功能说明

station

执行命令:wifi w0 join rtt-SSID2 12345678
此时可通过ifconfig命令查看网络状态。
该命令以板子作为station,去连接一个热点。

参数说明:

参数 详细描述
wifi 命令类别
w0 station的网卡设备名(可通过list_device查看)
join wifi执行的动作
rtt-SSID2 SSID
12345678 密码

系统正常运行现象

soft-AP

执行命令:wifi ap ap hello 12345678
参数说明:

参数 详细描述
wifi 命令类别
ap soft-ap的网卡设备名(可通过list_device查看)
ap wifi执行的动作
hello SSID
12345678 密码

通过该命令开启板载的soft-ap功能,正常执行后,可通过设备搜索到一个SSID为hello,密码为12345678的热点。

ifconfig

在加入wifi之后,执行ifconfig命令,可查看网络状态:

msh >ifconfig
network interface: w0 (Default)
MTU: 1500
MAC: c8 93 48 44 aa 00
FLAGS: UP LINK_UP ETHARP IGMP
ip address: 192.168.12.55
gw address: 192.168.10.1
net mask  : 255.255.0.0
dns server #0: 192.168.10.1
dns server #1: 0.0.0.0

ping测试

加入wifi之后,在shell里,输入ping + IP地址,进行ping1测试

msh >ping 123.125.114.144
60 bytes from 123.125.114.144 icmp_seq=0 ttl=52 time=35 ticks
60 bytes from 123.125.114.144 icmp_seq=1 ttl=52 time=53 ticks
60 bytes from 123.125.114.144 icmp_seq=2 ttl=52 time=28 ticks
60 bytes from 123.125.114.144 icmp_seq=3 ttl=52 time=28 ticks

TLS测试

该示例为一个简单的TLS client,与外网建立TLS连接并传输数据。
使用方法:在加入wifi之后,执行命令tls_test

现象

msh />tls_test   
[tls]mbedtls client struct init success...   
[tls]Loading the CA root certificate success...   
[tls]mbedtls client context init success...   
[tls]Connected www.howsmyssl.com:443 success...   
[tls]Certificate verified success...   
[tls]Writing HTTP request success...   
[tls]Getting HTTP response...   
(get response data)....   

webclient测试

在加入wifi之后,执行命令webclient_test https://www.rt-thread.org/test.txt
现象

msh />webclient_test https://www.rt-thread.org/test.txt
argc : 2
ready webclient open : https://www.rt-thread.org/test.txt
[tls]mbedtls client struct init success...
[tls]Loading the CA root certificate success...
[tls]mbedtls client context init success...
[tls]Connected www.rt-thread.org:443 success...
[tls]Certificate verified success...
response : 200, content_length : 1545
RT-Thread

RT-Thread is an open source IoT operating system from China, which has strong scalability: from a tiny kernel running on a tiny core, for example ARM Cortex-M0, or Cortex-M3/4/7, to a rich feature system running on MIPS32, ARM Cortex-A8, ARM Cortex-A9 DualCore etc.

content pos : 1545, content_length : 1545
msh />

Airkiss测试

在shell里执行命令:airkiss
然后通过微信的配网工具,输入SSID后进行配网测试。

测试用例说明

Iperf测试

介绍

Iperf测试最大 TCP 和 UDP 带宽性能,可以报告带宽、延迟抖动和数据包丢失。

使用说明

在menuconfig中配置使能Iperf,如下图所示

Test samples  --->
    [*]Enable Iperf Test

然后编译并下载固件。

进入tools下的jperf-2.0.2,执行jperf.bat,启动iperf测试工具,并设置为Server模式。
注意:该工具需要jre环境的支持。

打开板载终端,在shell里执行命令:

wifi w0 join rtt-SSID2 12345678
iperf PC的IP地址 1
eg:iperf 192.168.10.135 1

测试结果

现象如下:
iperf测试

Netio测试

介绍

netio是一个测试网络的吞吐量的工具。

使用说明

在shell里执行命令:

wifi w0 join rtt-SSID2 12345678
netio_init

测试现象

启动tools下的NetIO-GUI.exe工具,测试结果如下:
netio测试

MQTT说明

使用说明见\packages\pahomqtt\README.md

OTA说明

RT-Thread的OTA功能提供固件升级的功能,详细描述见samples/ota路径下的说明。

代码管理策略

随着项目的日益增多,决定以RTT-Ayla/Hisense/Roobo为试验项目,使用submodule+branch的方式来管理

  1. 每类项目单独创建一个repository
  2. 同类项目用分支区分不同产品、不同代理商、不同客户
  3. beken378、wifi_stack、ble_stack使用submodule关联,beken378不包含协议栈源码,相当于design kit
  4. 在项目稳定前,可直接使用submodule主分支,如果submodule有重大功能合入,可提前创建项目分支
  5. 在提交代码时,不同目的的修改分开提交,便于向其它分支合入
  6. 在提交代码后,如果需要将修改合入其它分支,使用git cherry-pick commitid
  7. 在版本发布后,使用git tag -a -m "notes" tag_name创建标签,并用git push --tags提交

submodule使用说明

创建submodule

  1. git submodule add http://192.168.0.6/wifi/beken_wifi_sdk.git beken378
  2. git submodule add http://192.168.0.6/wifi/beken_wifi_stack.git
  3. git submodule add http://192.168.0.6/wifi/beken_ble_stack.git
  4. 修改.submodule中的url为相对路径,便于ssh和http同时使用
  5. git add .submodule beken378
  6. git commit -m "xxx"

注:

  1. 所有submodule可能使用不同的分支,建议使用如下命令,指定所有submodules(包括主repository)的分支 git branch --set-upstream-to=origin/xxx master

获取submodule

  1. git clone --recurse-submodules http://xxx.git 或者
  2. git clone http://xxx.git
  3. cd xxx
  4. git submodule update --init --recursive
  5. git config --global credential.helper store (将用户名密码保存到本地文件中,解决每次push都要输入用户名密码问题)

更新submodule

可以在repository根目录使用git pull --recurse-submodules命令更新整个工程 当然也可以进入特定submodule通过git pull单独更新

推荐使用前者更新,因为更新后submodules仍然停留在当前commit,不会主动切换到HEAD

提交submodule

需要先在submodule中提交修改,然后在root repo中更新submodule

  1. cd beken378 (the submodle name)
  2. git add xxx
  3. git commit -m ""
  4. git push origin xxx:yyy
  5. cd .. (the root of repo)
  6. git add beken378
  7. git commit -m ""
  8. git push origin

版本发布

在发布版本时,ip stack中的代码编译以库的形式打包,然后对代码打标签并发布,方法如下

  • 根据项目实际情况修改beken378/app/config/sys_config.h中的CFG_SOC_NAME,并返回项目根目录

编译库文件

  • scons --buildlib=beken_ip 并根据CFG_SOC_NAME重命名为beken378/ip/libip72xx.a
  • scons --buildlib=beken_ble 并重命名为beken378/driver/ble/libble.a

编译好库并提交代码以后,需要打标签,由于submodule本身就是以commit id的形式存在,无需单独打标签。 当然,如果为了方便查找,可以用相同名称在相应代码库中打标签

  • git tag -a -m "" tag_name
  • git push --tags

运行脚本打包文件并发布

  • run release_tool.bat

bk7231_rtt_sdk's People

Contributors

bekenshenzhen avatar bekencorp avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.