Bk72xx SDK User Manual-3.0.3
Bk72xx SDK User Manual-3.0.3
Bk72xx SDK User Manual-3.0.3
Page 1 of 14
Machine Translated by Google
1. Revision History
Release Date Change history Authors
3.0.3 2020/10/20 Add BK7231N support, match Chunjian Tian
Beken SDK 3.0.3 Xiaoliang Yue
Heng Zhang
Bin Xu
Junlong Zhou
Page 2 of 14
Machine Translated by Google
Content
1. Revision History................................................................................................................................................... 2
2. SDK SOURCE CODE OVERVIEW........................................................................................................................... 4
2.1 SDK overview ................................................................................................................................................ 4
2.1.1 SDK with FreeRTOS ............................................................................................................................. 4
2.1.2 SDK with RT-Thread ............................................................................................................................ 5
2.1.3 SDK with AliOS .................................................................................................................................... 5
Page 3 of 14
Machine Translated by Google
scripts ÿÿÿ demos # the release related info such as SDK revision
ÿ ÿÿÿ application # RT-Thread adapter layer
# build scripts, link scripts
# helper scripts
# demos
ÿ ÿÿÿ common
ÿ ÿÿÿ components
ÿ ÿÿÿ helloworld
ÿ ÿÿÿ net
ÿ ÿÿÿ the
ÿ ÿÿÿ peripheral
ÿ ÿÿÿ wifi
ÿÿÿ FreeRTOSv9.0.0 # FreeRTOS source
ÿ ÿÿÿ FreeRTOS
ÿÿÿ release # the release related info such as the OSK revision and documents
crc binary
ÿÿÿ
memory leak # memory leak check tool
ÿÿÿ toolchain # the toolchain used for generate the SDK
Page 4 of 14
Machine Translated by Google
ÿÿÿÿcomponents
ÿÿÿÿexamples ÿ ÿ # necessary components: dfs, finsh, libc, net, etc.
ÿÿÿÿinclude
ÿÿÿÿsrc ÿ
ÿ ÿ ÿÿÿÿtools # examples of RT-Thread
ÿÿÿÿsamples
ÿÿÿÿtest ÿÿÿÿtool # major header files of RT-Thread
# major source files of RT-Thread
# build scripts with SCons of RT-Thread
# example code
# test code
# tools to manipulate firmware
ÿÿÿrelease ÿÿÿ tools # the release related info such as OSK revision and documents
# tools to manipulate firmware
Page 5 of 14
Machine Translated by Google
2.2 Configuration
There are several default configurations under BK72XX_SDK/beken378/app/config with sys_config_ prefix.
Configuration description
sys_config_bk7231.h Configuration for BK7231
sys_config_bk7231n.h Configuration for BK7231N
sys_config_bk7231u.h Configuration for BK7231U
sys_config_bk7251.h Configuration for BK7251
Build system will automatically choose these configurations, for example, make bk7231n will automatically uses
sys_config_bk7231n.h.
2.3 Libraries
Libraries description
librwnx.a Wifi lib, the lib name could be librwnx_bkxxxx.a which depend
on HW platform
libble.a BLE lib, the lib name could be libble_bkxxxx.a which depend
on HW platform
libble_mesh.a BLE mesh lib, the lib name could be libble_mesh_bkxxxx.a
which depend on HW platform
libairkiss.a Airkiss lib
libusb.a USB lib, the lib name could be libusb_bkxxxx.a which depend
on HW platform
libsensor.a WiFi Sensor lib
Build system will automatically choose these libraries, for example, make bk7231n will automatically use
librwnx_bk7231n.a and libble_bk7231n.a.
Page 6 of 14
Machine Translated by Google
3. Environment Setup
Add the following environment to ~/.bashrc if you are using bash or ~/.zshrc if you are using zsh.
Add the following environment to ~/.bashrc if you are using bash or ~/.zshrc if you are using zsh.
export ALIOS_COMPILER_PATH=/usr/local/share/toolchain/smartliving-1.6.0-compiler
You may install the toolchain to directory you want, the environment RTT_EXEC_PATH, FREERTOS_EXEC_PATH and
ALIOS_COMPILER_PATH must be changed accordingly.
If you cannot install python2 with these commands, you must manually install python2 from source code.
You can use change the pip mirrors to speed up install progress:
[global]
index-url = https://mirrors.ustc.edu.cn/pypi/web/simple format
= columns
Page 7 of 14
Machine Translated by Google
4. BUILD
$ cd tool/beken_packager
$ ./beken_packager
There are two files generated: all_2M.1220.bin and beken7231_bsp_uart_2M.1220.bin. The former include
bootloader and it can be downloaded into flash via SPI, while the latter doesn’t include bootloader and it can be downloaded
into flash via UART.
$ scons -c # cleanup
$ scons --streams=bk7251 -j4 # build bk7251 with 4 CPU core #
$scons --streams=bk7231u build bk7231u
$scons --streams=bk7231n # build bk7231n
If you encounter compile errors about python, you may replace scons with python2 `which scons`, for example
$ cd tools/beken_packager
$ ./beken_packager
There are two files generated: all_2M.1220.bin and rtthread_uart_2M.1220.bin. The former include bootloader
and it can be downloaded into flash via SPI, while the latter doesn’t include bootloader and it can be downloaded into flash via
UART.
Page 8 of 14
Machine Translated by Google
Page 9 of 14
Machine Translated by Google
5.1 BK7251
BK7251 is a 2.4 GHz 802.11n and BLE 4.2 comb chip with audio peripheral. It integrates hardware and software
component to finish a complete 802.11b/g/n audio application, which supports AP and STA role simultaneously, and
integrates Bluetooth low energy 4.2 transceiver and protocol stack. The 180 MHz MCU and embedded 512 KB RAM
make it able to support multiple cloud links and also suitable for audio and image applicationÿ
5.2 BK7231U
BK7231U is a 2.4 GHz 802.11n and BLE 4.2 full feature comb chip with multi-media feature. It integrates hardware and
software component to finish a complete 802.11b/g/n application, which supports AP and STA role simultaneously, and
integrates Bluetooth Low Energy 4.2 transceiver and protocol stack. The 120 MHz MCU and embedded 256 KB RAM
make it able to support multiple cloud links and also suitable for audio and image applicationÿ
Page 10 of 14
Machine Translated by Google
5.3 BK7231N
BK7231U is a 2.4 GHz 802.11n and BLE 5.1 full feature comb chip with multi-media feature. It integrates hardware and
software component to finish a complete 802.11b/g/n application, which supports AP and STA role simultaneously, and
integrates Bluetooth Low Energy 5.1 transceiver and protocol stack. The 120 MHz MCU and
embedded 256 KB RAM make it able to support multiple cloud links and also suitable for audio and image
applicationÿ
Page 11 of 14
Machine Translated by Google
a) SPI flasher
b) UART TTL
Page 12 of 14
Machine Translated by Google
Make sure chip supports bootrom or its flash has bootloader. We recommend CH340 UART to download
firmware.
Page 13 of 14
Machine Translated by Google
7. FAQ
Item Value
RAM 512M
HD 10G
Page 14 of 14