This article provides a basic example project using the BK7238 development board as an example.
- How to set up the BK7238 SDK compilation environment;
- How to compile and download firmware;
- BK7238 development board
- Serial port burning tool
- Computer (Windows and Ubuntu)
- ARM cross toolchain for compiling BK7238 SDK version;
- BK7238 SDK source code;
- Serial port burning software;
Development board introduction #
Build a Compilation Environment #
BK7238 SDK Download #
You can raise a request on https://support.cionlabs.com to get access to the SDK.
Toolchain Setup #
SDK_DIR/toolchain, in this directory, such as: gcc-arm-none-eabi-5_4-2016q3.tar.bz2
Use the following command to extract it to the user directory, /home/your_user_name/toolchain directory:
mkdir /home/your_user_name/toolchain tar -xvf toolchain/gcc-arm-none-eabi-5_4-2016q3.tar.bz2 -C /home/your_user_name/toolchain
Environment Variables #
Add the toolchain to the environment variable and first open the environment configuration file:
$ vim ~/.bashrc
Write the following content to the configuration file:
Enable environment variables:
Compilation in the Linux environment is currently supported. This chapter will take the Ubuntu 20.04 LTS version as an example to introduce the construction of the entire compilation environment. The above your_user_name needs to be changed to the user name of your host.
Compile Project #
Enter the BK7238 SDK directory in the terminal, perform compilation, and generate the default firmware:
make bk7238 -j4
You can enable the matter macro in sys_config_bk7238 to compile the matter version.h, such as:
#define CFG_SUPPORT_MATTER 1
Then execute the compilation command to generate matter firmware:
make bk7238 -j4
To compile matter, you should use the latest version of the compiler, such as gcc-arm-none-eabi-10.3-2021.10.
Flash the Code #
On the Windows platform, BK7238 currently supports UART programming.
Flash via Serial Port #
BK7238 supports UART programming, and it is recommended to use the CH340 serial port tool board for downloading.
The serial port burning tool is shown in the figure below:
Obtain the flashing tool:
Get the latest version of the burning tool online:http://dl.bekencorp.com/tools/flash/, such as: BEKEN_BKFIL_V2 .0.10.6_20230615.zip
The bk_writer.exe interface and related configurations are shown in the figure below:
Burn the serial port UART1, and click “Burn” to burn the version. After the burning is completed, power off and restart the device.
Serial port Log and Command Line #
help // Output the command list supported by sdk