Project Setup
The SiFli SDK uses the menuconfig tool to configure user applications and SDK options. Menuconfig uses the same syntax as the Linux kernel configuration, generating project-related .config and rtconfig.h files, which can be applied to build scripts and C code. For information on the syntax of Menuconfig, you can refer to https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html.
Setting Kconfig Configuration Values
The menuconfig interface can be used to configure tests during application development. This section describes how to make the settings permanent.
A generated list of all Kconfig options can be found in the Kconfig symbol reference.
Note
It is recommended to review the Kconfig tips and best practices page before making changes to Kconfig files.
Kconfig Configuration Items
When making Kconfig changes, it is important to understand the difference between visible and invisible configuration items. Visible symbols are those defined with prompts. These visible symbols appear in the interactive configuration interface and can be set in the configuration file.
Here is an example of a visible configuration:
This configuration item will appear in menuconfig and can be toggled:
Invisible configuration items do not have a prompt. Invisible configuration items are not displayed in the interactive configuration interface, and the user cannot directly control their value. Instead, they get their values from default values or other configuration items.
In this case, the symbol BF0_HCPU
is enabled by selecting other symbols that depend on it.
Setting Configuration Items Through the Configuration File
Visible configuration items can be configured by setting them in the configuration file. The initial configuration is generated by merging the board’s .config file with the application settings. For more details, refer to the section on initial configuration.
The assignments in the configuration file use the following syntax:
CONFIG=<value>
Note
No spaces allowed around the equals sign.
Boolean symbols can be enabled or disabled by setting them to y
or n
. For example, to enable the FPU symbol:
CONFIG_FPU=y
Note
Boolean symbols can also be set to
n
, and their comment format is as follows:
#CONFIG_SOME_OTHER_BOOL is not set
This format is seen in the merged configuration in .config.
Assignments for other symbol types are as follows:
CONFIG_SOME_STRING="cool value"
CONFIG_SOME_INT=123
Commenting with #
#This is a comment
SiFli SDK Configuration
The SDK includes a variety of options that users can configure, including chip, board, drivers, RTOS, peripheral circuits, middleware, third-party software, etc. Users can customize their chosen features as needed.
Users can add SDK configurations to their own project’s Kconfig.
Add the following to your KConfig to include SDK configuration:
config SIFLI_SDK
string
option env="SIFLI_SDK"
default "."
# SDK configuration
source "$SIFLI_SDK/Kconfig"
This will introduce the SDK configuration, and after running menuconfig, you will see the following separator:
------------End of SDK configuration -----------
The SDK configuration mainly consists of the following sections:
Chip Selection (Select chipset)
Select the chip; currently, SF32LB55X should be chosen.Operating System Selection (RTOS)
RT-Thread is the primary supported operating system and is recommended. It also includes RT-Thread driver configurations for internal IPs of the chip.Board-Level Peripherals (Select board peripherals)
This section provides configuration for external devices supported by Sifli Technology.Middleware (Sifli middleware)
This section contains middleware configurations developed by Sifli Technology.Third-Party Software (Third-party package)
This section includes third-party software verified and optimized by Sifli Technology.
Users can also customize some Kconfig configurations and are advised not to mix them with SDK configurations. It is recommended to use separate Kconfig files.