Kconfig Configuration
System Configuration
Armino system configuration mainly refers to Kconfig configuration, partition configuration, security configuration, etc. The processing flow is shown in the following diagram:
The processing corresponding to the numbers in the diagram are:
Code generation: Before compilation, the build system first scans configuration files to generate header files or configuration files required for compilation.
Generate BIN - Compile, link and generate the original binary file.
Scan the configuration file again and package according to the configuration items, including adding CRC, encryption, signing, etc., finally generating all-app.bin, all-app-no-bl.bin, ota.bin.
Deploy the generated OTP/EFUSE configuration file to the board.
Configuration Files
Armino supports the following types of configuration files:
Kconfig - Component configuration, generates sdkconfig.h. For details, please refer to Kconfig Configuration.
csv - CSV format configuration files, including:
partitions.csv - Partition configuration table, used to generate partitions_gen.h. For details, please refer to Partition Configuration.
mpc.csv - Security block peripheral configuration table, used to generate security.h. For details, please refer to Security Configuration.
ppc.csv - Security peripheral configuration table, used to generate security.h. For details, please refer to Security Configuration.
gpio.csv - Peripheral and GPIO mapping table, combined with ppc.csv to generate GPIO security attributes. For details, please refer to Security Configuration.
security.csv - Security configuration, used to generate security.h and otp_efuse_otp.json, also used for packaging. For details, please refer to Security Configuration.
ota.csv - Security OTA configuration, used to configure OTA policies, version security counters, etc. For details, please refer to Security Configuration.
key - Configure security-related keys, such as FLASH AES KEY, secure boot public-private key pairs, etc. For details, please refer to Security Configuration.
File Deployment
Configuration files in Armino are deployed as shown in the following diagram:
- armino/
- components/
- c1/
- Kconfig
- middleware/
- boards/
- bk7239/
- csv
- mpc.csv
- ppc.csv
- ota.csv
- partitions.csv
- security.csv
- key
- root_ec256_pubkey.pem
- root_ec256_privkey.pem
- soc/
- bk7239/
- bk7239.defconfig
- projects/
- my_project/
- config/
- common
- config
- bk7239
- config
- mpc.csv
- ppc.csv
- ota.csv
- partitions.csv
- security.csv
- root_ec256_pubkey.pem
- root_ec256_privkey.pem
- bk7258
- config
- partitions.csv
- Kconfig.projbuild
- main/
- Kconfig
- components/
- c1/
- Kconfig
These files can be divided into two categories:
Configuration definition files:
Kconfig - Usually defined in components.
Kconfig.projbuild - Defined in component or project directory.
Configuration modification files:
middleware/soc/bk7239.defconfig - Default BK7239 configuration provided by Armino.
my_projects/config/common/config - Configuration shared by different BK72xx in the project.
my_projects/config/bk7239/config - BK7239-specific configuration in the project.
For configuration files or configuration items with the same name, the priority rule is:
Project configuration > Middleware configuration > Component configuration.
For configuration files in the same directory: Chip-specific configuration items > Common configuration items.
Note
Kconfig uses configuration items from higher priority files to replace configuration items in lower priority configuration files; Other configuration files use higher priority configuration files to replace lower priority files.
Important
Configuration items can only be modified through configuration modification files after they are defined in Kconfig or Kconfig.projbuild. If you attempt to modify an undefined configuration, no definition will be generated in sdkconfig.h.
Note
Kconfig.projbuild is designed for menuconfig. When an item is added to Kconfig.projbuild, the configuration item will be displayed in the top-level menu of menuconfig. BK7239 does not support menuconfig, so Kconfig.projbuild has the same effect as Kconfig.
Note
Configuration item names defined in Kconfig files need to have the CONFIG_ prefix when used in config, defconfig, and C code.
In Armino projects, Kconfig configuration priority is:
my_projects/config/bk7239/config > my_projects/config/common/config > bk7239.defconfig > Configuration definition files
Configuration Dependencies
Mutually dependent configuration items are automatically changed to the correct values only when using menuconfig configuration. Armino does not support menuconfig configuration, so when changing a configuration through a configuration modification file, configurations that are mutually dependent with that configuration will not be automatically changed.
Important
In Armino, all configuration items must be explicitly specified or use default values.
Using Kconfig in CMakeLists.txt
Configuration items defined in Kconfig can be used directly in CMakeLists.txt. The only thing to note is not to place armino_component_register() within any configuration condition. You can refer to Disabling Components via Kconfig.