How to setup a global configuration
Overview
Greenwaves SDK offers a lot of examples, each one comes with its own set of Kconfig option defined in the sdk.config located in the example directory. Some options can be very common depending on user needs such as the platform used, the board, the boot device, etc…
Greenwaves SDK offers a mechanism to set a global configuration that will be applied by default to all examples. This configuration is a sdk.config file located here:
install/workstation/sdk.config
As examples’s sdk.config files, this file contains a list of Kconfig options affected to a desired value. It will be read in a first place.
Note
This file is automatically created when running cmake for the first time.
How to write the global configuration file
The global sdk.config file’s content can be filled from an application’s current configuration using the installconfig target. As an example, the helloworld example is running on GVSOC platform as default. The following lines demonstrate how to change the platform to BOARD from menuconfig interface and how to install this change to the global sdk.config file :
cd example/gap9/basic/helloworld
cmake -B build
cmake --build build -t menuconfig
# Select board platform then save and exit menuconfig interface
cmake --build build -t installconfig
The terminal output is outputing the following line:
[100%] Copying current config to global sdk.config file
Finally, the global sdk.config file is filled with the option that changed :
# install/workstation/sdk.config content
CONFIG_PLATFORM_BOARD=y
Note
The global sdk.config file can also be filled manually.
Warning
The global sdk.config file is located in the install directory which is erased when make clean target si run on SDK top level.
Global sdk.config VS app’s sdk.config
The global sdk.config file has a lower priority than an application’s one. It means that an option set by the global sdk.config can be overridden in an applciation sdk.config file if needed. As instance, Kconfig set the default fabric controller frequency to 50MHz :
config FREQUENCY_FC
int "Fabric controller frequency"
default 50000000
help
Configure the Fabric controller (or SOC) clock frequency at startup
If the global sdk.config set this frequency to 100MHz Hz and the application being run set it to 150Mhz in its sdk.config file, the final Fabric Controller frequency will be 150MHz.
Note
In another application that does not set this option, the fabric controller frequency will be 100MHz.
Note
In a same way, the Fabric Controller frequency set by the application’s sdk.config file can be overridden again by menuconfig interface or command line.