Commit graph

495 commits

Author SHA1 Message Date
YuLong Yao 2086acfa0e soc: gd32a50x: introduce gd32a50x soc series
soc: gd32a50x: introduce gd32a50x soc series

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-01-12 21:45:38 +01:00
Jamie McCrae fd4090819a tinycbor: Remove deprecated/obsolete module
This removes the tinycbor module and replaces references in it
e.g. in sample text to use the zcbor replacement.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-01-10 09:26:12 +01:00
Artur Hadasz 4400540d15 modules: hal_nordic: nrf_802154: RNG xor-shift algorithm
The LCG method used earlier in the random number generator was problematic,
as the lowest bits repeated periodically (for example, the generated number
always resulted in an odd-even-odd-even-.. sequence, or the last three bits
formed an cycle of the length 8). This is because the LCG was done module
2^32. Any LCG using a power of 2 as the modulus will cause the same issue.
The used RNG method was changed to Marsaglia's xor shift-algorithm,
which does not have this issue.

Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
2023-01-04 11:44:07 +00:00
Piotr Jasiński ceb7ca7e80 modules: build segger debugmon code with config
Updated segger module CMake to build code added by
https://github.com/zephyrproject-rtos/segger/pull/14 when relevant
config is provided.

Signed-off-by: Piotr Jasiński <piotr.jasinski@nordicsemi.no>
2022-12-28 12:00:46 +01:00
Reto Schneider cb7791baf1 soc: nrf52: Kconfig option for nRF52840 anomaly 198
Enabling by default (if SPI3 used) because it affects all revisions
since "Engineering B", including the most recent one as of today
(revision 3).

Size changes when enabled:
 - -Og: flash +160 bytes (+0.02%), RAM +8 bytes (+0.01%)
 - -Os: flash +144 bytes (+0.02%), no change to RAM usage

Signed-off-by: Reto Schneider <reto.schneider@husqvarnagroup.com>
2022-12-27 15:32:22 +01:00
Arkadiusz Balys 3afd564bba modules: openthread: platform: Added setting default tx power
There were some requests from users for adding the possibility
of setting default openthread tx output power using kConfig.
It is possible by adding the CONFIG_OPENTHREAD_DEFAULT_TX_POWER
kConfig and assigning it to the tx_power variable in the radio.c
file in the Openthread module.

Added the possibility to set default openthread power using
kConfig.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
2022-12-21 12:21:09 +01:00
Erwan Gouriou 66d4c64966 all: Fix "#if IS_ENABLED(CONFIG_FOO)" occurrences
Clean up occurrences of "#if IS_ENABLED(CONFIG_FOO)" an replace
with classical "#if defined(CONFIG_FOO)".

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2022-12-21 10:09:23 +01:00
Andriy Gelman 2d3493bff0 drivers: adc: Add ADC xmc4xxx drivers
The ADC module has four conversion groups, each one is set up as a zephyr
device. The start-up calibration is initiated globally for all groups
and it is run in each device init function. The ADC module supports post
calibration per group. Post calibration is run automatically after each
group acquires the samples.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-12-20 14:17:23 +01:00
Armin Brauns c1cc2c4a26 modules: lvgl: change mentions of "LittleVGL" to "LVGL"
The project was renamed to LVGL with release 7.0.0, from 2020-05-18.

Signed-off-by: Armin Brauns <armin.brauns@embedded-solutions.at>
2022-12-16 09:31:41 +01:00
Dominik Ermel a724ebe7f7 fs/fatfs: Update FAT FS support code for version 0.15 w/patch1
The commit applies small changes in ELM FAT driver support code,
required by the driver update to version 0.15.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-13 10:44:01 -06:00
Andriy Gelman 727e589448 drivers: interrupt_controller: Add XMC4XXX ERU driver
In Infineon XMC4XXX SoCs, gpio interrupts are triggered via an
Event Request Unit (ERU) module. A subset of the gpios are
connected to the ERU. The ERU monitors edge triggers and creates
a SR.

This driver configures the ERU for a target port/pin combination
for rising/falling edge events. Note that the ERU module does
not generate SR based on the gpio level. Internally the ERU
tracks the *status* of an event. The status is set on a positive
edge and unset on a negative edge (or vice-versa depending on
the configuration). The value of the status is used to implement
a level triggered interrupt; The ISR checks the status flag and
calls the callback function if the status is set.

The ERU configurations for supported port/pin combinations are
stored in a devicetree file dts/arm/infineon/xmc4xxx_x_x-intc.dtsi.
The configurations are stored in the opaque array
uint16 port_line_mapping[].

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-12-12 10:51:29 +01:00
Jon Escombe 9cf2b20415 modules: lvgl: Enable for CPU_CORTEX_M0/M0PLUS
Cortex M0 support was previously disabled due to a compiler bug.
SDK 15.1 includes GCC 12.1 which solves this issue.

Fixes: #52788

Signed-off-by: Jon Escombe <jone@dresco.co.uk>
2022-12-07 10:23:32 +00:00
Dominik Ermel 043cea12e5 fs/fatfs: Add CONFIG_FS_FATFS_MIN_SS
The Kconfig option allows to set minimum expected sector size
to be supported by FAT fs driver.
When this value differs from CONFIG_FS_FATFS_MAX_SS the driver
will query device for actual sector size, expecting different
sector sizes for different device. When CONFIG_FS_FATFS_MIN_SS
and CONFIG_FS_FATFS_MAX_SS are the same, then there is slight
reduction if FAT driver size, as the query logic is removed
and CONFIG_FS_FATFS_MAX_SS is used for all devices.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-12-05 15:18:05 +01:00
Yuval Peress b38445eaa0 math: Introduce a DSP basicmath subsystem with a cmsis backend
Introduce an API mirroring the CMSIS-DSP's basicmath. If CMSIS_DSP is
enabled, then it will by default be used as a backend. Developers may
opt into a custom backend by setting CONFIG_DSP_BACKEND_CMSIS=n. If
done, the application must provide `zdsp_backend/dsp.h` and optionally
implement the functions in its own .c files.

Signed-off-by: Yuval Peress <peress@google.com>
2022-12-02 20:15:55 +01:00
Anas Nashif cffe98d9de crc: Make the build of crc function dependent on a Kconfig
Add CONFIG_CRC for building CRC related routines.
CRC routines are now being built for each application, whether used or
not and are add in the build system unconditionally.

Keep CONFIG_CRC enabled by default for now and until all users have
converted to use the new option.

Partial fix for #50654

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-11-23 13:30:00 +01:00
Eduardo Montoya 78cf49e0fd net: openthread: fix otPlatRadioSetMacKey when asserts are disabled
Ensure `otPlatRadioSetMacKey` is properly implemented when asserts are
disabled.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2022-11-23 11:37:24 +01:00
Andrzej Głąbek 010730aff6 modules: mbedtls: Provide mbedtls_hardware_poll() conditionally
This is a follow-up to commit c7327f5f70.

Wrap implementation of the `mbedtls_hardware_poll()` function in
`#if defined(CONFIG_MBEDTLS_ZEPHYR_ENTROPY)` so that the function
is provided only when that option is activated.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2022-11-22 13:17:43 +09:00
Dominik Ermel d41832f830 modules/fatfs: Move FATFS Zephyr specific code and cmake
The code moves Zephyr specific code and CMakeLists.txt
under modules/fatfs/.

The commit also adds zephyr_fatfs_config.h header file, that
is now used to override FF_ options of ffconf.h file within
fatfs repository.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-21 16:48:14 +01:00
Robert Lubos 387a66131e net: pkt: Introduce minimum length requirement to net_pkt_get_frag()
net_pkt_get_frag() and a few other functions did not specify the
allocated fragment length, incorrectly assuming that fixed-sized
buffers are always used.

In order to make the function work properly also with variable-sized
buffers, extend the function argument list with minimum expected
fragment length parameter. This allows to use net_buf_alloc_len()
allocator in variable buffer length configuration, as well as verify if
the fixed-sized buffer is large enough to satisfy the requirements
otherwise.

Update the existing codebase to provide the expected fragment length,
based on the context.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-11-19 07:39:32 -05:00
Eduardo Montoya 257df2e21c net: openthread: implement PSA support for ECDSA API
Implement the four new ECDSA platform functions required by OT.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2022-11-17 11:20:03 +01:00
Kristofer Jonsson 02d4714aff modules: add an Arm Ethos-U HAL module
Adding module files for building the Arm Ethos-U Core driver.
Updating TFLU module file to build Ethos-U operator.

Adding hal_ethos_u to west manifest.

Signed-off-by: Kristofer Jonsson <kristofer.jonsson@arm.com>
Signed-off-by: Fredrik Knutsson <fredrik.knutsson@arm.com>
2022-11-15 14:47:43 +01:00
Nikodem Kastelik 67718641bf modules: hal_nordic: nrfx: switch to 2.10 API
Switch to use newest 2.10 API version in nrfx by default.
It changes signature of user callback in the nrfx_ipc driver.

Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
2022-11-08 10:48:38 +01:00
Rafał Kuźnia fe4ed1b871 boards: nrf5340dk_nrf5340: Add chosen node for nrf-802154 spinel
Currently, the nrf-802154-spinel IPC service requires that the IPC
service node has a specific name (ipc0). This makes it impossible to
overwrite the IPC service node to be used by the Spinel serialization
without completely redefining the ipc0 node. Create a `chosen` property
called nordic,802154-spinel-ipc that can be reassigned with any IPC
service node.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2022-11-05 19:57:25 +01:00
Adam Wojasinski f762aa9aa2 modules: hal_nordic: Add API version symbol to nrfx_config.h
This commit adds API version symbols. The symbol is used in nrfx
drivers, where new API-breaking changes are introduced. Symbol
guards conflicting API.

Signed-off-by: Adam Wojasinski <adam.wojasinski@nordicsemi.no>
2022-11-03 11:39:01 +01:00
Yonatan Schachter 3a3cfbb652 hal: nxp: Check Kconfig before including HAL
hal_nxp was added to cmake's include directories globally, without
checking if the hal is enabled. This made all Zephyr builds end up
including hal_nxp, even for other vendors.

Signed-off-by: Yonatan Schachter <yonatan.schachter@gmail.com>
2022-11-01 21:41:55 -05:00
Carles Cufi 8e4d499fa0 treewide: Use CONFIG_*_ENDIAN instead of __BYTE_ORDER__
In order to avoid using multiple sources of truth for the platfom's
endianness, convert the in-tree code to use the (BIG|LITTLE)_ENDIAN
Kconfig variables exclusively, instead of the compiler's
__BYTE_ORDER__.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-10-28 19:23:46 +09:00
Carles Cufi f38c283c42 modules: littlefs: Fix the endianness conversion functions
See full description in the upstream PR:
https://github.com/littlefs-project/littlefs/pull/742

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2022-10-28 19:23:46 +09:00
Henrik Brix Andersen f8a88cdb27 drivers: can: use flags fields for can_frame and can_filter structs
The can_frame and can_filter structs support a number of different flags
(standard/extended CAN ID type, Remote Transmission Request, CAN-FD format,
Bit Rate Switch, ...). Each of these flags is represented as a discrete bit
in the given structure.

This design pattern requires every user of these structs to initialize all
of these flags to either 0 or 1, which does not scale well for future flag
additions.

Some of these flags have associated enumerations to be used for assignment,
some do not. CAN drivers and protocols tend to rely on the logical value of
the flag instead of using the enumeration, leading to a very fragile
API. The enumerations are used inconsistently between the can_frame and
can_filter structures, which further complicates the API.

Instead, convert these flags to bitfields with separate flag definitions
for the can_frame and can_filter structures. This API allows for future
extensions without having to revisit existing users of the two
structures. Furthermore, this allows driver to easily check for unsupported
flags in the respective API calls.

As this change leads to the "id_mask" field of the can_filter to be the
only mask present in that structure, rename it to "mask" for simplicity.

Fixes: #50776

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-10-25 16:32:10 +02:00
Henrik Brix Andersen 05455c3d23 modules: canopennode: storage: fix size_t format specifier
Fix the format specifier for logging size_t values.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2022-10-22 14:36:11 +09:00
Florian Grandel f1e9dd2930 drivers: ieee802154: properly announce promisc mode
Most IEEE 802.15.4 drivers do not support promiscuous mode, some do.
There is a dedicated L2 flag to signal this capability to clients.

Unfortunately the IEEE 802.15.4 L2 stack does not announce this flag
even for drivers that correctly expose it in their HW capabilities.
Some clients (notably the OpenThread L2) even uses promiscuous mode
without checking whether the driver actually supports it.

This change lets the vanilla IEEE 802.15.4 L2 check the driver's
HW capabilities to announce promiscuous mode on its 'get_flags()'
interface if supported.

The OpenThread L2 uses a constant (potentially incorrect) response
to 'get_flags()'. Fixing the OpenThread L2 is out of scope of this
change. This change just introduces TODO messages to the OpenThread code
so that the OpenThread team may fix the issue (or delete the TODO if they
deem it irrelevant).

Fixes: #51263

Signed-off-by: Florian Grandel <jerico.dev@gmail.com>
2022-10-17 16:54:37 +02:00
Manuel Arguelles 41c36357bd soc: arm: introduce NXP S32Z/E support
This patch introduces support for NXP S32 devices, specifically for
S32Z27 from S32Z/E family.

NXP S32Z27 processors are composed of two Real-Time Units (RTU)
containing each four ARM Cortex-R52 cores with flexible split/lock
configuration, and dedicated internal SRAM.

Signed-off-by: Manuel Arguelles <manuel.arguelles@nxp.com>
2022-10-14 09:51:14 +02:00
Robert Lubos b76c35d809 modules: mbedtls: Replace select statement with depends on for EC
Instead of using "select" on certain EC configurations, which is
considered unsafe for various reasons, use a "depends on" and rely on
the user to set a proper configuration in the config file.

Update the respective project configurations to comply with the new
configuration scheme.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2022-10-07 15:12:42 +02:00
Yuval Peress 7c48900d14 modules: Remove fff tests
I've update FFF to run tests in the native CI for GitHub, so we no
longer need to run these extra tests. Remove the fff module from
west.yml since the module was only used in the CI and the header
was directly included in the Zephyr tree.

See https://github.com/zephyrproject-rtos/fff/pull/2

Signed-off-by: Yuval Peress <peress@google.com>
2022-10-04 14:24:09 -04:00
TOKITA Hiroshi 2e3cfec25d modules: Add option for enabling HAL debug functions
Add GD32_DBG_SUPPORT options to enable HAL debug functions.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-10-03 18:07:16 +02:00
TOKITA Hiroshi db6d8c92ff modules: Add IRC configurations
Add options about Internal RC(IRC) oscillator.

- GD32_HAS_IRC_32K/40K indicates IRC types.
- GD32_LOW_SPEED_IRC_FREQUENCY is the numeric value of frequency

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
2022-10-03 18:07:16 +02:00
Andriy Gelman 072a428f78 drivers: flash: Add xmc4xxx flash drivers
Add xmc4xxx flash drivers.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
2022-10-03 13:56:49 +02:00
Joakim Andersson 3abcc19fd7 tfm: Add option to enable the SFN model
Add option to enable the SFN model when building TF-M.
The SFN model will eventually replace the Library model.

Change the default model to be IPC, which follows the default
configuration of TF-M.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2022-10-03 10:17:45 +02:00
Jordan Yates e35d95b88e modules: loramac-node: fix CN470 linking
Update the source files compiled when `CONFIG_LORAMAC_REGION_CN470` is
enabled to link. Despite the naming, a `RegionBaseUS.c` function
(`RegionBaseUSVerifyFrequencyGroup`) is used by all four of the CN470
band implementations.

Validated by compiling `samples/subsys/lorawan/class_a` with
`CONFIG_LORAMAC_REGION_CN470` instead of `CONFIG_LORAMAC_REGION_IN865`.

Fixes #49960.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2022-09-26 09:38:49 +00:00
Artur Hadasz 2314d971e7 modules: hal_nordic: nrf_802154 serialization race condition fix
Fixed a race condition resulting in a serialization error.

Signed-off-by: Artur Hadasz <artur.hadasz@nordicsemi.no>
2022-09-19 10:31:50 +00:00
Henrik Brix Andersen 180cdc105e drivers: can: add start and stop CAN controller API functions
Up until now, the Zephyr CAN controller drivers set a default bitrate (or
timing) specified via devicetree and start the CAN controller in their
respective driver initialization functions.

This is fine for CAN nodes using only one fixed bitrate, but if the bitrate
is set by the user (e.g. via a DIP-switch or other HMI which is very
common), the CAN driver will still initialise with the default
bitrate/timing at boot and use this until the application has determined
the requested bitrate/timing and set it using
can_set_bitrate()/can_set_timing().

During this period, the CAN node will potentially destroy valid CAN frames
on the CAN bus (which is using the soon-to-be-set-by-the-application
bitrate) by sending error frames. This causes interruptions to the ongoing
CAN bus traffic when a Zephyr-based CAN node connected to the bus is
(re-)booted.

Instead, require all configuration (setting bitrate, timing, or mode) to
take place when the CAN controller is stopped. This maps nicely to entering
"reset mode" (called "configuration mode" or "freeze mode" for some CAN
controller implementations) when stopping and exiting this mode when
starting the CAN controller.

Fixes: #45304

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-09-13 16:06:50 +00:00
Przemyslaw Bida 2636bb4e4a net: openthread: priortize usec timer for openthread port.
This commit prioritizes usec timer over msec. Doing so improves
CSL by helping scheduling timeslots on IEEE 802.15.4 with lower miss
rate.

Signed-off-by: Przemyslaw Bida <przemyslaw.bida@nordicsemi.no>
2022-09-12 10:54:56 +00:00
Huifeng Zhang 97897a003d modules: tfa: integrate trusted-firmware-a
This commit integrates trusted-firmware-a as a zephyr module

Signed-off-by: Huifeng Zhang <Huifeng.Zhang@arm.com>
2022-09-09 16:36:37 +00:00
Mahesh Mahadevan 9966181510 drivers: usb: mcux: Restructure driver for SDK updates
1. Move the defines from usb_dc_mcux.h to usb_device_config.h
   and fsl_os_abstraction.h. These headers are used by
   the SDK USB driver. usb_dc_mcux.h header file is not longer
   needed and hence deleted.
2. Delete the Zephyr implementation of the usb_device_struct
   driver and use the one implemented inside the SDK USB
   driver. This requires updating the references to
   usb_device_struct inside the USB driver
3. Move defines and structures used by the driver
   out of the header file that is included by the SDK and
   into the MCUX USB driver.
4. Use end point defines provided by Zephyr instead of adding
   them locally.
5. Add a Kconfig to set the thread stack size
6. Move code to enable interrupts back to usb_attach function.
   Interrupts should be enabled after the init is successful,
   else we see errors of the ISR getting called before the
   init is complete causing Faults
6. Update west.yml to update the NXP HAL to get the updated
   SDK USB driver.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2022-09-09 09:44:46 -05:00
Øyvind Rønningstad 1ec015daa1 modules: zcbor: Fix ZCBOR_ASSERT kconfig typo
It should define ZCBOR_ASSERTS, not ZCBOR_ASSERT

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2022-09-08 15:30:47 +00:00
TOKITA Hiroshi 725aa4759a modules: hal_rpi_pico: Enable ADC driver
Enable ADC driver.
Add the path of the ADC driver header into include paths.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
2022-09-06 17:11:19 +02:00
Dominik Ermel f4398e1ad6 modules: canopennode: Switch to FIXED_PARTITION_ macros
The commit switches flash area access from FLASH_AREA_ macros
to FIXED_PARTITION_ macros and to usage of DTS node labels,
to identify partitions, instead of label property.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-09-06 09:56:37 +02:00
Gerard Marull-Paretas 79e6b0e0f6 includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h>
As of today <zephyr/zephyr.h> is 100% equivalent to <zephyr/kernel.h>.
This patch proposes to then include <zephyr/kernel.h> instead of
<zephyr/zephyr.h> since it is more clear that you are including the
Kernel APIs and (probably) nothing else. <zephyr/zephyr.h> sounds like a
catch-all header that may be confusing. Most applications need to
include a bunch of other things to compile, e.g. driver headers or
subsystem headers like BT, logging, etc.

The idea of a catch-all header in Zephyr is probably not feasible
anyway. Reason is that Zephyr is not a library, like it could be for
example `libpython`. Zephyr provides many utilities nowadays: a kernel,
drivers, subsystems, etc and things will likely grow. A catch-all header
would be massive, difficult to keep up-to-date. It is also likely that
an application will only build a small subset. Note that subsystem-level
headers may use a catch-all approach to make things easier, though.

NOTE: This patch is **NOT** removing the header, just removing its usage
in-tree. I'd advocate for its deprecation (add a #warning on it), but I
understand many people will have concerns.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-09-05 16:31:47 +02:00
Fabio Baltieri 6114a72c38 modules: littlefs: use ##__VA_ARGS__ for littlefs log wrappers
LittleFS has some macros resolving to the Zephyr LOG_* ones, use
the ##__VA_ARGS__ for these so that they don't leave a trailing comma if
called with a single argument.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-09-05 13:41:19 +00:00
Pieter De Gendt 8563744997 modules: openthread: Build FTD/MTD libraries based on device type
Set OpenThread specific cmake options depending on the selected
device type.
This reduces the number of libraries to build.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2022-09-02 17:48:50 +02:00
Yannick Thesen ffdd428419 modules: Added hal_wurthelektronik module.
Added hal_wurthelektronik module (contains drivers provided by
Würth Elektronik eiSos GmbH & Co. KG).

Signed-off-by: Yannick Thesen <Yannick.Thesen@we-online.de>
2022-08-31 21:47:58 +00:00