You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
update practical-zephyr series to recent versions of Zephyr and the nRF Connect SDK (memfault#620)
Due to deprecation of the Nordic toolchain manager I'm trying to update
the series to Zephyr 4.3.0 and the nRF Connect SDK 3.2.1. I didn't check
every single file that I quoted, though I hope everything is aligned.
With this there are two pull requests in the accompanying repositories:
- lmapii/practical-zephyr#8
- lmapii/practical-zephyr-manifest-repository#5
If you give me a heads-up then I can merge those before merging the PR
to Interrupt.
Copy file name to clipboardExpand all lines: _posts/2024-01-24-practical_zephyr_kconfig.md
+39-39Lines changed: 39 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,7 @@ The simplest way to log text in Zephyr is the `printk` function. `printk` can ta
46
46
#include<zephyr/kernel.h>
47
47
#defineSLEEP_TIME_MS 100U
48
48
49
-
voidmain(void)
49
+
intmain(void)
50
50
{
51
51
printk("Message in a bottle.\n");
52
52
while (1)
@@ -67,7 +67,7 @@ As mentioned in the previous article, we're using a development kit from [Nordic
67
67
The connection settings for the UART interface are configured using [devicetree](https://docs.zephyrproject.org/latest/build/dts/index.html) - which we'll explore in a later article. Since these default settings are all we need for now, let's focus on Kconfig. We build and flash the project as follows:
68
68
69
69
```bash
70
-
$ west build --board nrf52840dk_nrf52840 --build-dir ../build
70
+
$ west build --no-sysbuild --board nrf52840dk/nrf52840 --build-dir ../build
71
71
$ west flash --build-dir ../build
72
72
```
73
73
@@ -157,7 +157,7 @@ In the header file `zephyr/lib/os/printk.h` we can see that `printk` is replaced
157
157
With `printk` disabled in our application configuration file, let's try to rerun our application to verify that the output is indeed disabled:
158
158
159
159
```bash
160
-
$ west build --board nrf52840dk_nrf52840 --build-dir ../build --pristine
160
+
$ west build --no-sysbuild --board nrf52840dk/nrf52840 --build-dir ../build --pristine
161
161
$ west flash --build-dir ../build
162
162
```
163
163
@@ -202,7 +202,7 @@ Zephyr contains _hundreds_ of so-called Kconfig _fragments_. It is therefore alm
202
202
For the `build` command, _West_ has some builtin _targets_, two of which are used for _Kconfig_:
203
203
204
204
```bash
205
-
$ west build --build-dir ../build -t usage
205
+
$ west build --no-sysbuild --build-dir ../build -t usage
206
206
-- west build: running target usage
207
207
...
208
208
Kconfig targets:
@@ -276,7 +276,7 @@ The downside of saving the configuration to `zephyr/.config` in the build direct
276
276
The people at [Golioth](https://golioth.io/) published a [short article](https://blog.golioth.io/zephyr-quick-tip-show-what-menuconfig-changed-and-make-changes-persistent/) that shows how to leverage the `diff` command to find out which configuration options have changed when using the normal _Save_ operation: Before writing the changes to the `zephyr/.config` file, Kconfig stores the old configuration in `build/zephyr/.config.old`. Thus, all changes that you make between a _Save_ operation are reflected by the differences between `zephyr/.config` and `build/zephyr/.config.old`:
277
277
278
278
```bash
279
-
$ west build --board nrf52840dk_nrf52840 -d ../build --pristine
279
+
$ west build --no-sysbuild --board nrf52840dk/nrf52840 -d ../build --pristine
280
280
$ west build -d ../build -t menuconfig
281
281
# Within menuconfig:
282
282
# - Disable BOOT_BANNER and PRINTK.
@@ -306,7 +306,7 @@ Both `menuconfig` and `guiconfig` have the _Save minimal config_ option. As the
306
306
Let's try this out with our settings for the `BOOT_BANNER` and `PRINTK` symbols.
307
307
308
308
```bash
309
-
$ west build --board nrf52840dk_nrf52840 -d ../build --pristine
309
+
$ west build --no-sysbuild --board nrf52840dk/nrf52840 -d ../build --pristine
310
310
$ west build -d ../build -t menuconfig
311
311
# Within menuconfig:
312
312
# - Disable BOOT_BANNER and PRINTK.
@@ -331,7 +331,7 @@ CONFIG_UART_CONSOLE=y
331
331
CONFIG_EARLY_CONSOLE=y
332
332
```
333
333
334
-
As you can see, this minimal configuration contains a lot more options than we changed within `menuconfig`. Some of these options come from the selected board, in my case `zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig`, but are still listed since they do not use default values. However, the two changes to `PRINTK` and `BOOT_BANNER` are still visible. We can just take those options and write them to our application configuration file:
334
+
As you can see, this minimal configuration contains a lot more options than we changed within `menuconfig`. Some of these options come from the selected board, in my case `zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52840_defconfig`, but are still listed since they do not use default values. However, the two changes to `PRINTK` and `BOOT_BANNER` are still visible. We can just take those options and write them to our application configuration file:
335
335
336
336
```bash
337
337
$ cat prj.conf
@@ -359,9 +359,9 @@ At the time of writing and for this repository, the following configuration opti
Configuration saved to '/path/to/zephyr_practical/build/zephyr/.config'
438
438
```
@@ -447,7 +447,7 @@ Aside from the application configuration file [prj.conf](https://github.com/lmap
447
447
448
448
E.g., throughout this guide, we're using the nRF52840 development kit, which has the board name `nrf52840dk_nrf52840`. Thus, the file `boards/nrf52840dk_nrf52840.conf` is automatically merged into the `Kconfig` configuration during the build, if present.
449
449
450
-
Let's try this by disabling UART as console output using a new fragment `boards/nrf52840dk_nrf52840.conf`. For the nRF52840 development kit, this symbol is enabled by default. You can go ahead and verify this by checking the default configuration `zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig` - or take my word for it:
450
+
Let's try this by disabling UART as console output using a new fragment `boards/nrf52840dk_nrf52840.conf`. For the nRF52840 development kit, this symbol is enabled by default. You can go ahead and verify this by checking the default configuration `zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52840_defconfig` - or take my word for it:
451
451
452
452
```bash
453
453
tree --charset=utf-8 --dirsfirst
@@ -470,19 +470,19 @@ CONFIG_UART_CONSOLE=n
470
470
Then, we perform a _pristine_ build of the project. Notice that a `--pristine` build is required at this point because otherwise, the build system does not pick up our newly added `.conf` file. This is one of the very few occasions where a pristine build is actually required.
471
471
472
472
```bash
473
-
$ west build --board nrf52840dk_nrf52840 -d ../build --pristine
473
+
$ west build --no-sysbuild --board nrf52840dk/nrf52840 -d ../build --pristine
474
474
```
475
475
476
476
In the output of `west build` shown below you can see that the new file `boards/nrf52840dk_nrf52840.conf` is indeed merged into the `Kconfig` configuration. You can also see a warning that the Zephyr library `drivers__console` is excluded from the build since it now has no `SOURCES`:
CONFIG_OVERRIDE_FRAME_POINTER_DEFAULT | n | y || FAIL
@@ -707,12 +707,12 @@ By sourcing the `Kconfig.zephr` file, we're loading all _Kconfig_ menus and symb
707
707
Let's rebuild our application without configuring `USR_FUN` and have a look at the build output. A `--pristine` build is required to pick up the new `Kconfig` file:
708
708
709
709
```bash
710
-
$ west build --board nrf52840dk_nrf52840 -d ../build --pristine
710
+
$ west build --no-sysbuild --board nrf52840dk/nrf52840 -d ../build --pristine
0 commit comments