There is one week to go until the feature freeze for Zephyr 3.5, and also just about a week to participate in this year’s Zephyr Developer survey.
Whether you are using Zephyr for work or just for a pet project, we’d love to hear from you and understand what you love about the project and the community, and what you’d want to see improved. I promise it should take you less than 10 minutes to fill out, and your input will be incredibly useful to shape the future of the project.
Understanding and troubleshooting initialization levels
Understanding initialization levels and how all the various drivers “light up” when a Zephyr application starts can be pretty intimidating.
That’s why you will likely appreciate the introduction of a new tool making things very visual when it comes to the bootstrapping of your application.
The new initlevels
target in west gives you a quick way to dump the list of init functions that are being called at each stage of the booting process. (PR #62459)
Let’s say I want to use this with the newly added LVGL demo apps, running on an M5Stack Core2.
west build -t initlevels -p -b m5stack_core2 -s .\samples\modules\lvgl\demos\ -- -DCONFIG_LV_Z_DEMO_MUSIC=y
The output would be as follows, giving me a good overview of when each driver is kicking in, and making it easier to spot potential bugs in the bootstrap sequence of my application.
EARLY
PRE_KERNEL_1
__init___device_dts_ord_5: clock_control_esp32_init(__device_dts_ord_5)
__init_statics_init_pre: statics_init(NULL)
__init___device_dts_ord_11: gpio_esp32_init(__device_dts_ord_11)
__init___device_dts_ord_13: gpio_esp32_init(__device_dts_ord_13)
__init___device_dts_ord_58: entropy_esp32_init(__device_dts_ord_58)
__init___device_dts_ord_61: uart_esp32_init(__device_dts_ord_61)
__init_uart_console_init: uart_console_init(NULL)
PRE_KERNEL_2
__init_sys_clock_driver_init: sys_clock_driver_init(NULL)
POST_KERNEL
__init_enable_logger: enable_logger(NULL)
__init_enable_shell_uart: enable_shell_uart(NULL)
__init_malloc_prepare: malloc_prepare(NULL)
__init_k_sys_work_q_init: k_sys_work_q_init(NULL)
__init___device_dts_ord_12: i2c_esp32_init(__device_dts_ord_12)
__init___device_dts_ord_25: mfd_axp192_init(__device_dts_ord_25)
__init___device_dts_ord_84: spi_esp32_init(__device_dts_ord_84)
__init___device_dts_ord_80: regulator_axp192_init(__device_dts_ord_80)
__init___device_dts_ord_81: regulator_axp192_init(__device_dts_ord_81)
__init___device_dts_ord_82: regulator_axp192_init(__device_dts_ord_82)
__init___device_dts_ord_85: regulator_axp192_init(__device_dts_ord_85)
__init___device_dts_ord_26: gpio_axp192_init(__device_dts_ord_26)
__init_gpio_hogs_init: gpio_hogs_init(NULL)
__init___device_dts_ord_86: ili9xxx_init(__device_dts_ord_86)
__init___device_dts_ord_14: ft5336_init(__device_dts_ord_14)
__init___device_dts_ord_15: NULL(__device_dts_ord_15)
APPLICATION
__init_lvgl_init: lvgl_init(NULL)
Running LVGL demos is now (much) easier!
Thanks to Fabian’s excellent work in PR #62904, running one of the default LVGL ‘demo’ apps has become significantly easier this week.
Check out the instructions of the newly added code sample to get started in no time. It’s really exciting to see all the improvements being made around all things GUI recently!
By the way, in case you didn’t know, LVGL code can also run in an HTML canvas, which I find really cool.
Boards & SoCs
- MPU/MMU-based stack guard is now enabled on ARM64. If you enable
CONFIG_ARM64_STACK_PROTECTION
, the system will trigger a fatal error if the current process stack overflows. This is done by preceding all stack areas with a fixed guard region. (PR #62902) - The Nuvoton NPCX7M6FB evaluation board is a development platform to for Nuvoton NPCX7 series of microcontrollers. It features an Arm Cortex-M4F MCU, with 256 KB RAM / 64 KB ROM — now supported! (PR #62799)
Drivers
- hwinfo driver is now available for TI SimpleLink CC13xx/CC26xx series. It allows to retrieve the device ID and to access the cause of reset. (PR #62537)
- STMPE811 touch controller is now supported. (PR #61826)
- RAM disk driver (which I didn’t know Zephyr had until today!) can now be easily configured directly via Devicetree. It now also supports multiple instances. (PR #60149)
/ {
ramdisk0 {
compatible = "zephyr,ram-disk";
disk-name = "RAM";
sector-size = <512>;
sector-count = <192>;
};
};
- The MCAN driver now supports statistics. It can be enabled using Kconfig CONFIG_CAN_STATS. (PR #62758)
- New driver for NXP VREF. (PR #56822)
- LTC2990 Quad I2C Voltage, Current and Temperature Monitor (no less!) from Analog Devices is now supported. (PR #60842)
- On all STM32 ADC, it is no longer possible to read sensor channels (Vref, Vbat or temperature) using the ADC driver, and the dedicated sensor driver should be used instead. (PR #62345)
- The driver for the LIS2DH accelerometer can now trigger an interrupt when a single tap is detected. (PR #62498)
- Various improvements to the NVMe disk driver. (PR #62820)
Miscellaneous
- When using the modem subsystem to describe “chat scripts” (ex. “If I send you this AT command, I’m interested in capturing this portion of your response”), you can now dynamically create chat scripts.
This makes it possible to adapt to the runtime conditions, as the parameters of the various commands, or the expected responses, might not always be known at build time. (PR #62703)
By the way, don’t forget to join us on Wednesday for our second episode of the Zephyr Tech Talks, as this will be your chance to learn more about the new modem subsystem from its author 🙂 - A new
lwm2m create
shell command makes it easy to create and register new LWM2M objects on the fly. (PR #62869)
Note to self: I need to prepare some demos around using LWM2M with Zephyr at some point 🙂 - If you’re using the USB Device stack for building some kind of audio gadget, you can now expose volume control functionality to the host. (PR #60973)
SO_REUSEADDR
andSO_REUSEPORT
socket options are now supported, making it possible to have multiple sockets bound to the same local IP-port combination (PR #61885)- The shell commands
settings read
andsettings write
now accept an optional ‘type’ argument. Ex:
settings write string foo bar
settings write hex key2 c0ffee
A big thank you to the 9 individuals who had their first pull request accepted this week, 💙 🙌: @raitraak-rrk, @kapbh, @iandmorris, @gwa-storck, @kunoh, @icsys-aal, @aaronyegx, @SawXu, and @TaiJuWu.
As always, please feel free to jump in with your thoughts or questions in the comments below. See you next week!
If you enjoyed this article, don’t forget to subscribe to this blog to be notified of upcoming publications! And of course, you can also always find me on Twitter and Mastodon.
Catch up on all previous issues of the Zephyr Weekly Update: