How to Setup a Development Environment for BK7238

How to Setup a Development Environment for BK7238

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;

Preparation #

Hardware: #

  • BK7238 development board
  • Serial port burning tool
  • Computer (Windows and Ubuntu)

Software: #

  • ARM cross toolchain for compiling BK7238 SDK version;
  • BK7238 SDK source code;
  • Serial port burning software;

Development board introduction #


BK7238 Demo Board


BK7238 Demo Board Back Side

Build a Compilation Environment #

BK7238 SDK Download #

You can raise a request on 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:

export FREERTOS_EXEC_PATH=/home/your_user_name/toolchain/gcc-arm-none-eabi-5_4-2016q3/bin/

Enable environment variables:

source ~/.bashrc

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:


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:, such as: BEKEN_BKFIL_V2

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 #

Currently, on the BK72xx platform, the serial port Log and Command Line commands are input to the UART1 port; you can view the supported command list through the help command:

help // Output the command list supported by sdk

Now you can purchase the BK7238 modules from here


Cionlabs is formed by a group of experts with extensive domain knowledge coming from the leading technology and consulting firms around the globe with the aim to deliver The Best in the industry. We have the capability to develop comprehensive solutions to tackle the industry challenges, create value, and improve profitability and sustainability for our customers.


Go to Top