Part 1
요약·해설
모든 symbol·수치·반환값과 Devicetree 예제 6개를 보존하고 필수 변경과 권장 변경을 분리합니다.
Signature · Picolibc
Binding · property · API
PM · BT · net · MCUmgr
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
BD99A98C582ED4D5E83390385236042AEB9D9BED941A3AD758F546C38295F59A
:orphan:
.. _migration_3.5:
Migration guide to Zephyr v3.5.0
################################
This document describes the changes required or recommended when migrating your
application from Zephyr v3.4.0 to Zephyr v3.5.0.
Any other changes (not directly related to migrating applications) can be found in
the :ref:`release notes<zephyr_3.5>`.
Required changes
****************
Kernel
======
* The kernel :c:func:`k_mem_slab_free` function has changed its signature, now
taking a ``void *mem`` pointer instead of a ``void **mem`` double-pointer.
The new signature will not immediately trigger a compiler error or warning,
instead likely causing a invalid memory access at runtime. A new ``_ASSERT``
statement, that you can enable with :kconfig:option:`CONFIG_ASSERT`, will
detect if you pass the function memory not belonging to the memory blocks in
the slab.
* :c:macro:`CONTAINER_OF` now performs type checking, this was very commonly
misused to obtain user structure from :c:struct:`k_work` pointers without
passing from :c:struct:`k_work_delayable`. This would now result in a build
error and have to be done correctly using
:c:func:`k_work_delayable_from_work`.
C Library
=========
* The default C library used on most targets has changed from the built-in
minimal C library to Picolibc. While both provide standard C library
interfaces and shouldn't cause any behavioral regressions for applications,
there are a few side effects to be aware of when migrating to Picolibc.
* Picolibc enables thread local storage
(:kconfig:option:`CONFIG_THREAD_LOCAL_STORAGE`) where supported. This
changes some internal operations within the kernel that improve
performance using some TLS variables. Zephyr places TLS variables in the
memory reserved for the stack, so stack usage for every thread will
increase by 8-16 bytes.
* Picolibc uses the same malloc implementation as the minimal C library, but
the default heap size depends on which C library is in use. When using the
minimal C library, the default heap is zero bytes, which means that malloc
will always fail. When using Picolibc, the default is 16kB with
:kconfig:option:`CONFIG_MMU` or :kconfig:option:`ARCH_POSIX`, 2kB with
:kconfig:option:`CONFIG_USERSPACE` and
:kconfig:option:`CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT`. For all
other targets, the default heap uses all remaining memory on the system.
You can change this by adjusting
:kconfig:option:`CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE`.
* Picolibc can either be built as part of the OS build or pulled from the
toolchain. When building as part of the OS, the build will increase by
approximately 1000 files.
* When using the standard C++ library with Picolibc, both of those must come
from the toolchain as the standard C++ library depends upon the C library
ABI.
* Picolibc removes the ``-ffreestanding`` compiler option. This allows
significant compiler optimization improvements, but also means that the
compiler will now warn about declarations of `main` which don't conform to
the Zephyr required type -- ``int main(void)``.
* Picolibc has four different printf/scanf variants supported in Zephyr,
'double', 'long long', 'integer', and 'minimal. 'double' offers a
complete printf implementation with exact floating point in decimal and
hexadecimal formats, full integer support including long long, C99
integer size specifiers (j, z, t) and POSIX positional arguments. 'long
long' mode removes float support, 'integer' removes long long support
while 'minimal' mode also removes support for format modifiers and
positional arguments. Building the library as a module allows finer
control over the feature set provided at each level.
* Picolibc's default floating point input/output code is larger than the
minimal C library version (this is necessary to conform with the C
language "round trip" requirements for these operations). If you use
:kconfig:option:`CONFIG_CBPRINTF_FP_SUPPORT`, you will see increased
memory usage unless you also disable
:kconfig:option:`CONFIG_PICOLIBC_IO_FLOAT_EXACT`, which switches Picolibc
to a smaller, but inexact conversion algorithm. This requires building
Picolibc as a module.
Optional Modules
================
The following modules have been made optional and are not downloaded with `west update` by default anymore:
* ``chre``
* ``lz4``
* ``nanopb``
* ``psa-arch-tests``
* ``sof``
* ``tf-m-tests``
* ``tflite-micro``
* ``thrift``
* ``zscilib``
To enable them again use the ``west config manifest.project-filter -- +<module
name>`` command, or ``west config manifest.group-filter -- +optional`` to
enable all optional modules, and then run ``west update`` again.
Device Drivers and Device Tree
==============================
* ``zephyr,memory-region-mpu`` was renamed ``zephyr,memory-attr`` and its type
moved from 'enum' to 'int'. To have a seamless conversion this is the
required change in the DT:
.. code-block:: none
- "RAM" -> <( DT_MEM_ARM(ATTR_MPU_RAM) )>
- "RAM_NOCACHE" -> <( DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) )>
- "FLASH" -> <( DT_MEM_ARM(ATTR_MPU_FLASH) )>
- "PPB" -> <( DT_MEM_ARM(ATTR_MPU_PPB) )>
- "IO" -> <( DT_MEM_ARM(ATTR_MPU_IO) )>
- "EXTMEM" -> <( DT_MEM_ARM(ATTR_MPU_EXTMEM) )>
* Device dependencies (incorrectly referred as "device handles" in some areas)
are now an optional feature enabled by :kconfig:option:`CONFIG_DEVICE_DEPS`.
This means that an extra linker stage is no longer necessary if this option is
not enabled.
* On all STM32 ADC, it is no longer possible to read sensor channels (Vref,
Vbat or temperature) using the ADC driver. The dedicated sensor driver should
be used instead. This change is due to a limitation on STM32F4 where the
channels for temperature and Vbat are identical, and the impossibility of
determining what we want to measure using solely the ADC API.
* The RAM disk driver has been changed to support multiple instances and instantiation
using devicetree. As a result, Kconfig option :kconfig:option:`CONFIG_DISK_RAM_VOLUME_SIZE`
and Kconfig option :kconfig:option:`CONFIG_DISK_RAM_VOLUME_NAME` are removed,
and the application using the RAM disk must instantiate it using devicetree,
as in the following example:
.. code-block:: devicetree
/ {
ramdisk0 {
compatible = "zephyr,ram-disk";
disk-name = "RAM";
sector-size = <512>;
sector-count = <192>;
};
};
* The :dtcompatible:`goodix,gt911`, :dtcompatible:`xptek,xpt2046` and
:dtcompatible:`hynitron,cst816s` drivers have been converted from Kscan to
Input, they can still be used with Kscan applications by adding a
:dtcompatible:`zephyr,kscan-input` node.
* The ``zephyr,gpio-keys`` binding has been merged into
:dtcompatible:`gpio-keys` and the callback definition has been renamed from
``INPUT_LISTENER_CB_DEFINE`` to :c:macro:`INPUT_CALLBACK_DEFINE`.
* The :dtcompatible:`ti,bq274xx` driver was using incorrect units for capacity
and power channels, these have been fixed and scaled by x1000 factor from the
previous implementation, any application using them has to be changed
accordingly.
* The configuration options for the SSD1306 display driver can now be provided
via the Devicetree binding :dtcompatible:`solomon,ssd1306fb`. The following
Kconfig options: ``CONFIG_SSD1306_DEFAULT``,
``CONFIG_SSD1306_SH1106_COMPATIBLE``, and ``CONFIG_SSD1306_REVERSE_MODE`` have
been removed.
* You can remove ``CONFIG_SSD1306_DEFAULT`` without any other modification.
* ``CONFIG_SSD1306_SH1106_COMPATIBLE`` was used to assert that the device is
(compatible with) SH1106. This has been replaced by a dedicated dts
compatible declaration. You may update an existing sh1106 node to change the
``compatible`` designation from :dtcompatible:`solomon,ssd1306fb` to
:dtcompatible:`sinowealth,sh1106`.
* ``CONFIG_SSD1306_REVERSE_MODE`` is now set using the ``inversion-on``
property of the devicetree node.
* GPIO drivers not implementing IRQ related operations must now provide
``NULL`` to the relevant operations: ``pin_interrupt_configure``,
``manage_callback``, ``get_pending_int``. The public API will return
``-ENOSYS`` when these are not available, instead of ``-ENOTSUP``.
* STM32 Ethernet driver was misusing :c:func:`hwinfo_get_device_id` to generate
last 3 bytes of mac address, resulting in a high risk of collision when using
SoCs from the same lot. This is now fixed to use the whole range of entropy
available from the unique ID (96 bits). Devices using unique ID based mac address
will see last 3 bytes of their MAC address modified by this change.
* On all STM32 (except F1x and F37x series), two new required properties have been
added to ADC to configure the source clock and the prescaler.
``st,adc-clock-source`` allows choosing either synchronous or asynchronous clock source.
``st,adc-prescaler`` allows setting the value of the prescaler for the chosen clock source.
Not all combinations are allowed. Refer to the appropriate RefMan for more information.
When choosing asynchronous clock, the choice of the kernel source clock is made in the
``clocks`` node as it is done for other peripherals, for example, to select
HSI16 as clock source for STM32G0:
.. code-block:: devicetree
&adc {
clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00100000>,
<&rcc STM32_SRC_HSI ADC_SEL(2)>;
};
* On NXP boards with LPC DMA, the DMA controller node used to have its ``dma-channels`` property
set in the board DTS as a way to configure the amount of structures the driver will allocate.
This did not match the zephyr dma-controller binding, so this property is now fixed and set
in the SOC devicetree definition. Downstream boards should not override this property and
instead use the new driver Kconfig
:kconfig:option:`CONFIG_DMA_MCUX_LPC_NUMBER_OF_CHANNELS_ALLOCATED`.
* The LPC55XXX series SOC (except LPC55S06) default main clock has been
updated to PLL1 source from XTAL32K running at 144MHZ. If the new
kconfig option :kconfig:option:`CONFIG_INIT_PLL1`
is disabled then the main clock is muxed to FRO_HR as before.
* The Kconfig option ``CONFIG_GPIO_NCT38XX_INTERRUPT`` has been renamed to
:kconfig:option:`CONFIG_GPIO_NCT38XX_ALERT`.
* The CAN controller timing API functions :c:func:`can_set_timing` and :c:func:`can_set_timing_data`
no longer fallback to the (Re-)Synchronization Jump Width (SJW) value set in the devicetree
properties for the given CAN controller upon encountering an SJW value corresponding to
``CAN_SJW_NO_CHANGE`` (which is no longer available). The caller will therefore need to fill in
the ``sjw`` field in :c:struct:`can_timing`. To aid in this, the :c:func:`can_calc_timing` and
:c:func:`can_calc_timing_data` functions now automatically calculate a suitable SJW. The
calculated SJW can be overwritten by the caller if needed. The CAN controller API functions
:c:func:`can_set_bitrate` and :c:func:`can_set_bitrate_data` now also automatically calculate a
suitable SJW, but their SJW cannot be overwritten by the caller.
* The CAN ISO-TP message configuration in :c:struct:`isotp_msg_id` is changed to use the following
flags instead of bit fields:
* :c:macro:`ISOTP_MSG_EXT_ADDR` to enable ISO-TP extended addressing
* :c:macro:`ISOTP_MSG_FIXED_ADDR` to enable ISO-TP fixed addressing
* :c:macro:`ISOTP_MSG_IDE` to use extended (29-bit) CAN IDs
The two new flags :c:macro:`ISOTP_MSG_FDF` and :c:macro:`ISOTP_MSG_BRS` were added for CAN FD
mode.
* NXP i.MX RT based boards should now enable
:kconfig:option:`CONFIG_DEVICE_CONFIGURATION_DATA` at the board level when
using a DCD with the RT bootrom, and enable
:kconfig:option:`CONFIG_NXP_IMX_EXTERNAL_SDRAM` when using external SDRAM
via the SEMC
* NXP i.MX RT11xx series SNVS pin control name identifiers have been updated to
match with the source data for these SOCs. The pin names have had the
suffix ``dig`` added. For example, ``iomuxc_snvs_wakeup_gpio13_io00`` has
been renamed to ``iomuxc_snvs_wakeup_dig_gpio13_io00``
Power Management
================
* Platforms that implement power management hooks must explicitly select
:kconfig:option:`CONFIG_HAS_PM` in Kconfig. This is now a dependency of
:kconfig:option:`CONFIG_PM`. Before this change all platforms could enable
:kconfig:option:`CONFIG_PM` because empty weak stubs were provided, however,
this is no longer supported. As a result of this change, power management
hooks are no longer defined as weaks.
* Multiple platforms no longer support powering the system off using
:c:func:`pm_state_force`. The new :c:func:`sys_poweroff` API must be used.
Migrated platforms include Nordic nRF, STM32, ESP32 and TI CC13XX/26XX. The
new API is independent from :kconfig:option:`CONFIG_PM`. It requires
:kconfig:option:`CONFIG_POWEROFF` to be enabled, which depends on
:kconfig:option:`CONFIG_HAS_POWEROFF`, an option selected by platforms
implementing the required new hooks.
Bootloader
==========
* The :kconfig:option:`CONFIG_BOOTLOADER_SRAM_SIZE` default value is now ``0`` (was
``16``). Bootloaders that use a part of the SRAM should set this value to an
appropriate size. :github:`60371`
Bluetooth
=========
* The ``accept()`` callback's signature in :c:struct:`bt_l2cap_server` has
changed to ``int (*accept)(struct bt_conn *conn, struct bt_l2cap_server
*server, struct bt_l2cap_chan **chan)``,
adding a new ``server`` parameter pointing to the :c:struct:`bt_l2cap_server`
structure instance the callback relates to. :github:`60536`
Networking
==========
* A new networking Kconfig option :kconfig:option:`CONFIG_NET_INTERFACE_NAME`
defaults to ``y``. The option allows user to set a name to a network interface.
During system startup a default name is assigned to the network interface like
``eth0`` to the first Ethernet network interface. The option affects the behavior
of ``SO_BINDTODEVICE`` BSD socket option. If the Kconfig option is set to ``n``,
which is how the system worked earlier, then the name of the device assigned
to the network interface is used by the ``SO_BINDTODEVICE`` socket option.
If the Kconfig option is set to ``y`` (current default), then the network
interface name is used by the ``SO_BINDTODEVICE`` socket option.
* Ethernet PHY devicetree bindings were updated to use the standard ``reg``
property for the PHY address instead of a custom ``address`` property. As a
result, MDIO controller nodes now require ``#address-cells`` and
``#size-cells`` properties. Similarly, Ethernet PHY devicetree nodes and
corresponding driver were updated to consistently use the node name
``ethernet-phy`` instead of ``phy``. Devicetrees and overlays must be updated
accordingly:
.. code-block:: devicetree
mdio {
compatible = "mdio-controller";
#address-cells = <1>;
#size-cells = <0>;
ethernet-phy@0 {
compatible = "ethernet-phy";
reg = <0>;
};
};
Other Subsystems
================
* ZBus runtime observers implementation now relies on the HEAP memory instead of a memory slab.
Thus, zbus' configuration (kconfig) related to runtime observers has changed. To keep your runtime
observers code working correctly, you need to:
- Replace the integer ``CONFIG_ZBUS_RUNTIME_OBSERVERS_POOL_SIZE`` with the boolean
:kconfig:option:`CONFIG_ZBUS_RUNTIME_OBSERVERS`;
- Set the HEAP size with the :kconfig:option:`CONFIG_HEAP_MEM_POOL_SIZE`.
* The zbus VDED delivery sequence has changed. Check the :ref:`documentation<zbus delivery
sequence>` to verify if it will affect your code.
* MCUmgr SMP version 2 error codes entry has changed due to a collision with an
existing response in shell_mgmt. Previously, these errors had the entry ``ret``
but now have the entry ``err``. ``smp_add_cmd_ret()`` is now deprecated and
:c:func:`smp_add_cmd_err` should be used instead, ``MGMT_CB_ERROR_RET`` is
now deprecated and :c:enumerator:`MGMT_CB_ERROR_ERR` should be used instead.
SMP version 2 error code defines for in-tree modules have been updated to
replace the ``*_RET_RC_*`` parts with ``*_ERR_*``.
* MCUmgr SMP version 2 error translation (to legacy MCUmgr error code) is now
handled in function handlers by setting the ``mg_translate_error`` function
pointer of :c:struct:`mgmt_group` when registering a group. See
:c:type:`smp_translate_error_fn` for function details. Any SMP version 2
handlers made for Zephyr 3.4 need to be updated to include these translation
functions when the groups are registered.
ARM
===
* ARM SoC initialization routines no longer need to call `NMI_INIT()`. The
macro call has been removed as it was not doing anything useful.
RISC V
======
* The :kconfig:option:`CONFIG_RISCV_MTVEC_VECTORED_MODE` Kconfig option was renamed to
:kconfig:option:`CONFIG_RISCV_VECTORED_MODE`.
Recommended Changes
*******************
* Setting the GIC architecture version by selecting
:kconfig:option:`CONFIG_GIC_V1`, :kconfig:option:`CONFIG_GIC_V2` and
:kconfig:option:`CONFIG_GIC_V3` directly in Kconfig has been deprecated.
The GIC version should now be specified by adding the appropriate compatible, for
example :dtcompatible:`arm,gic-v2`, to the GIC node in the device tree.
* Nordic nRF based boards using :kconfig:option:`CONFIG_NFCT_PINS_AS_GPIOS`
to configure NFCT pins as GPIOs, should instead set the new UICR
``nfct-pins-as-gpios`` property in devicetree. It can be set like this in the
board devicetree files:
.. code-block:: devicetree
&uicr {
nfct-pins-as-gpios;
};
* Nordic nRF based boards using :kconfig:option:`CONFIG_GPIO_AS_PINRESET`
to configure reset GPIO as nRESET, should instead set the new UICR
``gpio-as-nreset`` property in devicetree. It can be set like this in the
board devicetree files:
.. code-block:: devicetree
&uicr {
gpio-as-nreset;
};
* The :kconfig:option:`CONFIG_MODEM_GSM_PPP` modem driver is obsolete.
Instead the new :kconfig:option:`CONFIG_MODEM_CELLULAR` driver should be used.
As part of this :kconfig:option:`CONFIG_GSM_MUX` and :kconfig:option:`CONFIG_UART_MUX` are being
marked as deprecated as well. The new modem subsystem :kconfig:option:`CONFIG_MODEM_CMUX`
and :kconfig:option:`CONFIG_MODEM_PPP` should be used instead.
* Device drivers should now be restricted to ``PRE_KERNEL_1``, ``PRE_KERNEL_2``
and ``POST_KERNEL`` initialization levels. Other device initialization levels,
including ``EARLY``, ``APPLICATION``, and ``SMP``, have been deprecated and
will be removed in future releases. Note that these changes do not apply to
initialization levels used in the context of the ``init.h`` API,
e.g. :c:macro:`SYS_INIT`.
* The following CAN controller devicetree properties are now deprecated in favor specifying the
initial CAN bitrate using the ``bus-speed``, ``sample-point``, ``bus-speed-data``, and
``sample-point-data`` properties:
* ``sjw``
* ``prop-seg``
* ``phase-seg1``
* ``phase-seg1``
* ``sjw-data``
* ``prop-seg-data``
* ``phase-seg1-data``
* ``phase-seg1-data``
* ``<zephyr/arch/arm/aarch32/cortex_a_r/cmsis.h>`` and
``<zephyr/arch/arm/aarch32/cortex_m/cmsis.h>`` are now deprecated in favor of
including ``<cmsis_core.h>`` instead. The new header is part of the CMSIS glue
code in the ``modules`` directory.
* Random API header ``<zephyr/random/rand32.h>`` is deprecated in favor of
``<zephyr/random/random.h>``. The old header will be removed in future releases
and its usage should be avoided.
Part 3
한국어 전문 번역
이 문서는 application을 Zephyr v3.4.0에서 v3.5.0으로 옮길 때 필수이거나 권장되는 변경을 설명합니다. Application migration과 직접 관련 없는 변경은 Zephyr 3.5 release note에서 확인합니다.
필수 변경
Kernel
- Kernel
k_mem_slab_free()signature가void **memdouble pointer 대신void *mempointer를 받도록 바뀌었습니다. 새 signature는 즉시 compiler error·warning을 내지 않고 runtime의 invalid memory access로 이어질 수 있습니다.CONFIG_ASSERT로 새_ASSERT를 켜면 slab memory block에 속하지 않는 memory를 전달했는지 검출합니다. CONTAINER_OF가 type checking을 수행합니다.k_work_delayable을 거치지 않고k_workpointer에서 user structure를 얻던 잘못된 사용은 build error가 됩니다.k_work_delayable_from_work()를 사용해야 합니다.
C Library
대부분 target의 default C library가 built-in minimal C library에서 Picolibc로 바뀌었습니다. 둘 다 standard C interface를 제공하므로 application behavior regression은 없어야 하지만 다음 부수 효과를 확인해야 합니다.
- 지원되는 곳에서 Picolibc는
CONFIG_THREAD_LOCAL_STORAGE를 활성화합니다. Kernel 내부 operation 일부가 TLS variable로 성능을 높이며, Zephyr는 TLS variable을 stack용 memory에 두므로 thread마다 stack usage가 8~16 byte 늘어납니다. - Picolibc와 minimal C library는 같은 malloc implementation을 사용하지만 default heap size가 다릅니다. Minimal C library는 0 byte라 malloc이 항상 실패합니다. Picolibc는
CONFIG_MMU또는ARCH_POSIX에서 16kB,CONFIG_USERSPACE와CONFIG_MPU_REQUIRES_POWER_OF_TWO_ALIGNMENT에서 2kB이며 다른 target에서는 남은 system memory 전체를 사용합니다.CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE로 바꿀 수 있습니다. - Picolibc를 OS build 일부로 build하거나 toolchain에서 가져올 수 있습니다. OS와 함께 build하면 file 약 1,000개가 추가됩니다.
- Picolibc와 standard C++ library를 함께 쓰면 C++ library가 C-library ABI에 의존하므로 둘 다 toolchain에서 와야 합니다.
- Picolibc는
-ffreestandingcompiler option을 제거합니다. Compiler optimization이 크게 좋아지지만 Zephyr가 요구하는int main(void)와 다른maindeclaration에는 compiler warning이 발생합니다. - Zephyr의 Picolibc printf/scanf variant는
double,long long,integer,minimal네 가지입니다. Double은 decimal·hex exact floating point, long long을 포함한 전체 integer, C99 size specifier(j, z, t), POSIX positional argument를 지원합니다. Long long mode는 float를, integer mode는 long long을, minimal mode는 format modifier와 positional argument까지 제거합니다. Module build를 사용하면 level별 feature set을 더 세밀하게 제어할 수 있습니다. - Picolibc의 default floating-point I/O code는 C language round-trip requirement를 지키기 때문에 minimal C library보다 큽니다.
CONFIG_CBPRINTF_FP_SUPPORT를 쓰면 memory usage가 늘어납니다. Picolibc를 module로 build하고CONFIG_PICOLIBC_IO_FLOAT_EXACT를 끄면 더 작지만 부정확한 conversion algorithm으로 전환할 수 있습니다.
Optional Modules
다음 module은 optional이 되어 기본 west update에서 더 이상 내려받지 않습니다.
chrelz4nanopbpsa-arch-testssoftf-m-teststflite-microthriftzscilib
개별 module은 west config manifest.project-filter -- +<module name>으로, 전체 optional module은 west config manifest.group-filter -- +optional로 다시 활성화한 뒤 west update를 실행합니다.
Device Drivers와 Device Tree
zephyr,memory-region-mpu가 zephyr,memory-attr로 rename되고 type이 enum에서 int로 바뀌었습니다. DT 값은 다음과 같이 변환합니다.
- "RAM" -> <( DT_MEM_ARM(ATTR_MPU_RAM) )>
- "RAM_NOCACHE" -> <( DT_MEM_ARM(ATTR_MPU_RAM_NOCACHE) )>
- "FLASH" -> <( DT_MEM_ARM(ATTR_MPU_FLASH) )>
- "PPB" -> <( DT_MEM_ARM(ATTR_MPU_PPB) )>
- "IO" -> <( DT_MEM_ARM(ATTR_MPU_IO) )>
- "EXTMEM" -> <( DT_MEM_ARM(ATTR_MPU_EXTMEM) )>- Device dependency(일부 영역에서 잘못 device handle이라 부름)는
CONFIG_DEVICE_DEPS가 켜는 optional feature입니다. 이 option을 끄면 추가 linker stage가 필요 없습니다. - 모든 STM32 ADC에서 Vref, Vbat, temperature sensor channel을 ADC driver로 읽을 수 없습니다. Dedicated sensor driver를 사용합니다. STM32F4에서 temperature와 Vbat channel이 같아 ADC API만으로 측정 대상을 구분할 수 없는 제약 때문입니다.
- RAM disk driver가 multiple instance와 Devicetree instantiation을 지원합니다.
CONFIG_DISK_RAM_VOLUME_SIZE와CONFIG_DISK_RAM_VOLUME_NAME은 제거됐으므로 application이 다음처럼 Devicetree로 instance를 만들어야 합니다.
/ {
ramdisk0 {
compatible = "zephyr,ram-disk";
disk-name = "RAM";
sector-size = <512>;
sector-count = <192>;
};
};goodix,gt911,xptek,xpt2046,hynitron,cst816sdriver는 Kscan에서 Input으로 전환됐습니다.zephyr,kscan-inputnode를 추가하면 기존 Kscan application에서 계속 사용할 수 있습니다.zephyr,gpio-keysbinding은gpio-keys로 합쳐졌고 callback macro는INPUT_LISTENER_CB_DEFINE에서INPUT_CALLBACK_DEFINE으로 rename됐습니다.ti,bq274xxdriver의 capacity·power channel unit 오류를 고쳐 이전 implementation보다 값이 1,000배 scaling됩니다. 이를 사용하는 application도 맞춰 바꿔야 합니다.- SSD1306 display 설정은
solomon,ssd1306fbDevicetree binding으로 제공합니다.CONFIG_SSD1306_DEFAULT,CONFIG_SSD1306_SH1106_COMPATIBLE,CONFIG_SSD1306_REVERSE_MODE은 제거됐습니다. DEFAULT는 다른 수정 없이 삭제하고, SH1106 node의 compatible은sinowealth,sh1106으로 바꾸며, reverse mode는 node의inversion-onproperty로 설정합니다. - IRQ operation을 구현하지 않는 GPIO driver는
pin_interrupt_configure,manage_callback,get_pending_int에NULL을 제공해야 합니다. Public API는 기능이 없을 때-ENOTSUP대신-ENOSYS를 반환합니다. - STM32 Ethernet driver가 MAC 마지막 3 byte 생성에
hwinfo_get_device_id()를 잘못 사용해 같은 lot SoC에서 collision 위험이 높았습니다. 이제 unique ID의 96-bit entropy 전체를 사용하므로 unique-ID 기반 MAC을 쓰는 device는 마지막 3 byte가 달라집니다. - F1x·F37x를 제외한 모든 STM32 ADC에 clock source와 prescaler를 설정하는 필수 property
st,adc-clock-source,st,adc-prescaler가 추가됐습니다. 허용 조합은 RefMan을 확인합니다. Asynchronous clock에서 kernel source clock은 다른 peripheral처럼clocksnode에서 고릅니다. STM32G0에서 HSI16을 선택하는 예는 다음과 같습니다.
&adc {
clocks = <&rcc STM32_CLOCK_BUS_APB1_2 0x00100000>,
<&rcc STM32_SRC_HSI ADC_SEL(2)>;
};- LPC DMA를 쓰는 NXP board는 driver allocation 구조 수를 정하려고 board DTS의
dma-channels를 override하면 안 됩니다. SoC Devicetree에 고정된 property 대신CONFIG_DMA_MCUX_LPC_NUMBER_OF_CHANNELS_ALLOCATED를 사용합니다. - LPC55S06을 제외한 LPC55XXX SoC의 default main clock이 XTAL32K 기반 144MHz PLL1 source로 변경됐습니다.
CONFIG_INIT_PLL1을 끄면 이전처럼 main clock을 FRO_HR로 mux합니다. CONFIG_GPIO_NCT38XX_INTERRUPT가CONFIG_GPIO_NCT38XX_ALERT로 rename됐습니다.- CAN timing API
can_set_timing()과can_set_timing_data()는 제거된CAN_SJW_NO_CHANGE값에서 Devicetree SJW로 fallback하지 않습니다. Caller가can_timing.sjw를 채워야 합니다.can_calc_timing()과can_calc_timing_data()는 적합한 SJW를 자동 계산하며 caller가 덮어쓸 수 있습니다.can_set_bitrate()와can_set_bitrate_data()도 자동 계산하지만 caller가 덮어쓸 수 없습니다. isotp_msg_id의 CAN ISO-TP 설정은 bit field 대신ISOTP_MSG_EXT_ADDR,ISOTP_MSG_FIXED_ADDR,ISOTP_MSG_IDEflag를 사용합니다. CAN FD용ISOTP_MSG_FDF,ISOTP_MSG_BRS도 추가됐습니다.- NXP i.MX RT board가 RT bootrom의 DCD를 쓰면 board level에서
CONFIG_DEVICE_CONFIGURATION_DATA를, SEMC external SDRAM을 쓰면CONFIG_NXP_IMX_EXTERNAL_SDRAM을 활성화해야 합니다. - NXP i.MX RT11xx SNVS pin-control identifier가 SoC source data와 맞도록
digsuffix를 사용합니다. 예를 들어iomuxc_snvs_wakeup_gpio13_io00은iomuxc_snvs_wakeup_dig_gpio13_io00으로 바뀌었습니다.
Power Management
- Power-management hook을 구현한 platform은 Kconfig에서
CONFIG_HAS_PM을 명시적으로 select해야 합니다. 이는CONFIG_PMdependency입니다. 이전 weak empty stub은 더 이상 지원하지 않으며 PM hook도 weak로 정의되지 않습니다. - Nordic nRF, STM32, ESP32, TI CC13XX/26XX 등은
pm_state_force()로 system power-off를 지원하지 않습니다.CONFIG_PM과 독립적인 새sys_poweroff()API를 사용하며CONFIG_POWEROFF가 필요합니다. 이 option은 새 hook을 구현한 platform이 select하는CONFIG_HAS_POWEROFF에 의존합니다.
Bootloader
CONFIG_BOOTLOADER_SRAM_SIZEdefault가16에서0으로 바뀌었습니다. SRAM 일부를 쓰는 bootloader는 적절한 size를 설정해야 합니다.
Bluetooth
bt_l2cap_server의accept()callback signature가int (*accept)(struct bt_conn *conn, struct bt_l2cap_server *server, struct bt_l2cap_chan **chan)으로 바뀌어 관련bt_l2cap_serverinstance를 가리키는serverparameter가 추가됐습니다.
Networking
- 새
CONFIG_NET_INTERFACE_NAME은 defaulty이며 network interface에 이름을 설정합니다. Startup 때 첫 Ethernet interface에eth0같은 default name을 지정합니다.n이면 이전처럼SO_BINDTODEVICE가 interface에 배정된 device name을 사용하고, defaulty이면 network-interface name을 사용합니다. - Ethernet PHY Devicetree binding은 custom
address대신 standardregproperty로 PHY address를 나타냅니다. MDIO controller에는#address-cells와#size-cells가 필요하고 PHY node name은phy대신ethernet-phy를 일관되게 사용합니다.
mdio {
compatible = "mdio-controller";
#address-cells = <1>;
#size-cells = <0>;
ethernet-phy@0 {
compatible = "ethernet-phy";
reg = <0>;
};
};Other Subsystems
- ZBus runtime observer가 memory slab 대신 HEAP을 사용합니다. Integer
CONFIG_ZBUS_RUNTIME_OBSERVERS_POOL_SIZE를 booleanCONFIG_ZBUS_RUNTIME_OBSERVERS로 바꾸고CONFIG_HEAP_MEM_POOL_SIZE로 heap size를 설정합니다. - ZBus VDED delivery sequence가 바뀌었으므로 documentation에서 code 영향 여부를 확인해야 합니다.
- MCUmgr SMP v2 error-code entry가 shell_mgmt response와 충돌해
ret에서err로 바뀌었습니다.smp_add_cmd_ret()대신smp_add_cmd_err(),MGMT_CB_ERROR_RET대신MGMT_CB_ERROR_ERR을 사용합니다. In-tree define의*_RET_RC_*부분도*_ERR_*로 변경됐습니다. - MCUmgr SMP v2 error를 legacy error code로 번역하는 작업은 group 등록 시
mgmt_group.mg_translate_errorfunction pointer를 설정한 handler가 담당합니다. Zephyr 3.4용 SMP v2 handler는 group 등록 때 이 translation function을 포함하도록 갱신해야 합니다.
ARM
- ARM SoC initialization routine은 더 이상
NMI_INIT()을 호출할 필요가 없습니다. 유용한 동작을 하지 않던 macro call이 제거됐습니다.
RISC V
CONFIG_RISCV_MTVEC_VECTORED_MODE가CONFIG_RISCV_VECTORED_MODE로 rename됐습니다.
권장 변경
- Kconfig에서
CONFIG_GIC_V1,CONFIG_GIC_V2,CONFIG_GIC_V3를 직접 select하는 방식은 deprecated입니다. Device Tree의 GIC node에arm,gic-v2같은 compatible을 추가해 version을 지정합니다. - Nordic nRF board의
CONFIG_NFCT_PINS_AS_GPIOS대신 UICR Devicetree propertynfct-pins-as-gpios를 사용합니다.
&uicr {
nfct-pins-as-gpios;
};- Nordic nRF board의
CONFIG_GPIO_AS_PINRESET대신 UICR Devicetree propertygpio-as-nreset을 사용합니다.
&uicr {
gpio-as-nreset;
};CONFIG_MODEM_GSM_PPP는 obsolete이므로CONFIG_MODEM_CELLULAR을 사용합니다.CONFIG_GSM_MUX와CONFIG_UART_MUX도 deprecated이며 새 modem subsystem의CONFIG_MODEM_CMUX,CONFIG_MODEM_PPP로 옮깁니다.- Device driver initialization level은
PRE_KERNEL_1,PRE_KERNEL_2,POST_KERNEL로 제한해야 합니다.EARLY,APPLICATION,SMP등은 deprecated되어 향후 제거됩니다.SYS_INIT같은init.hAPI context의 initialization level에는 적용되지 않습니다. - 초기 CAN bitrate는
bus-speed,sample-point,bus-speed-data,sample-point-dataproperty로 지정합니다. 기존sjw,prop-seg,phase-seg1,sjw-data,prop-seg-data,phase-seg1-data는 deprecated입니다. <zephyr/arch/arm/aarch32/cortex_a_r/cmsis.h>와<zephyr/arch/arm/aarch32/cortex_m/cmsis.h>대신 modules directory의 CMSIS glue code에 포함된<cmsis_core.h>를 include합니다.- Random API header
<zephyr/random/rand32.h>는 deprecated이므로<zephyr/random/random.h>를 사용합니다. 이전 header는 향후 제거됩니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.