Correct DT property to set correct STM32_PLL_XTPRE value.
The driver bindings defined `xtpre` instead of used `xtre`
in the `DT_PROP` macro.
That allows to use F1 PLL clock with division by 2.
Signed-off-by: Georgij Cernysiov <geo.cgv@gmail.com>
These functions help the code to be more self-documenting. Use them to
make the code's intent clearer.
Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
Logging v2 is utilizing complex preprocessing operations to
prepare message at compile time. Multiple operations are peformed
on log message arguments. However, it is expected that argument
will be evaluated only once (e.g. it can be a call to a function
with side effects). Adding additional layer which creates copies
of user arguments on stack and passes them to further processing.
Updated test for log_msg2 which is using internal macro which
got renamed.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
many functions in the lwm2m librarys api take a pathstr argument
that is never written to, so make it const
Signed-off-by: Henning Fleddermann <henning.fleddermann@grandcentrix.net>
XCC (which is based on GCC 4.2) needs the initializer of one of the
union elements to be enclosed in brackets.
Signed-off-by: Maureen Helm <maureen.helm@intel.com>
As described in #42403, there was an issue with the existing crc16_ansi()
implementation, since it was not calculating the CRC-16-ANSI (aka
CRC-16-MODBUS). This is because the existing crc16() function only
supported non-reflected input and output (and the CRC-16-ANSI requires
reflection on both) and also it did not seem to support correctly inial
seeds different from 0x0000 (and, again, the CRC-16-ANSI requires 0xffff
as an initial seed).
This commit replaces the existing crc16() with a functional pair,
crc16() and crc16_reflect(), that also work with any poly, any initial seed
and allow to select whether reflection is performed.
It also adapts crc16_ansi() so that it actually returns the correct CRC.
Fixes#42403.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The crc16_ccitt and crc16_itu_t functions' documentation could lead to
slight misunderstandings because of the fact that, although they bear
those names, those functions are actually able to compute CRCs that bear
other names, depending on the inital seed provided and an optional XOR
on the result.
In order to avoid confusion, document thoroughly with links to the
standard reveng page that lists all existing CRCs.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This adds to the cbprintf_packaged library to allow external
formatters to be used by the way of callback. This will allow
logging backends to use their own formatter for output if
needed.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Add the handler function's name to the generated
sub command handler. Without it, it's not possible
to generate to dictionary matching items in a file.
Fixes#42398
Signed-off-by: Guillaume Lager <g.lager@innoseis.com>
Fix the formatting and what looks like a copy/paste error
in the DT_CLOCKS_CTLR_BY_NAME doxygen docstring.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The new macro USBD_STRING_DESCR_USER_DEFINE works like
USBD_STRING_DESCR_DEFINE with the exception of being
ordered strictly after it. The new macro is needed to
ensures that user defined string descriptors can be added
without disturbing the order of string descriptors
defined by the usb subsystem.
Signed-off-by: Alexander Mihajlovic <a@abxy.se>
In order to use functions orginating from C libs in C++ context, their
definitions must be declared as "C" functions
Signed-off-by: Kim Bøndergaard <kim@fam-boendergaard.dk>
The skip field in the bt_le_per_adv_sync_param structure did not
document the acceptable range. Add it, directly from the
specification.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Deprecate the can_write() API wrapper function in favor of using
can_send() directly.
The can_write() API wrapper function:
- Does not support CAN-FD data lengths.
- Auto-selects between standard/extended CAN identifiers based on the
CAN ID (something which should be selected by the caller as the
selection affects filters on the receiving end).
- Does not support callbacks for frame transmission results.
- Has no in-tree users.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
On nRF53 Series SoCs, the highest SCK frequencies can only be achieved
when the HFCLK192M clock divider is changed from the default /4 setting.
Such change results in increased power consumption, so the divider needs
to be changed only for periods when it is actually necessary.
This commit modifies the driver behavior so that it changes the divider
only when a QSPI bus operation is performed.
However, when XIP accesses to the flash chip are also used, it may be
needed to keep the divider changed even when the driver is idle so that
the XIP access speed is not reduced, hence a custom API function that
allows forcing this is introduced for the driver.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Use the @deprecated Doxygen command for documenting alternatives to
deprecated CAN API functions and macros.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Fix a failure to compile a C++ file including "pm/device_runtime.h"
A quick grep on all .h shows that net/tftp.h also needs to be fixed.
Signed-off-by: Arnaud Mouiche <arnaud.mouiche@invoxia.com>
The CAN_BUS_UNKNOWN CAN controller state is only used to indicate that
the current CAN controller state could not be read.
Remove it and change the signature of the can_get_state() API function
to return an integer indicating success or failure.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
Document the deadlock avoidance in ATT request queueing.
Add more precise description of the callback and how long the argument
must be kept valid for.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Added new LE Feature Support bit mask as documented in
Bluetooth Spec. v5.3 Vol 6, Part B, Section 4.6 Feature
Support.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add support for the BAP broadcast sink role. This role
allows a device to sync to a broadcast ISO stream.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add the Basic Audio Profile (BAP) unicast server
functionality. This allows a device to act as the
unicast server role, which can accept unicast streams
initiated by a unicast client.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Fixed a dependency from printk.h to logging headers which in
certain configurations could lead to circular dependencies.
Cleaned up printk.c to call z_log_vprintk from vprintk.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
The DT_SPI_DEV_CS_GPIOS_DT_SPEC_GET macro belongs in drivers/spi.h,
not devicetree.h.
It is creating a struct gpio_dt_spec, but the devicetree.h API does
not (other than in this case) and should not depend on structures that
are defined in the GPIO API. This is because the GPIO API already
depends on the devicetree.h API, so making a dependency in the reverse
direction creates a needless circular dependency.
This macro should have been added to the drivers/spi.h API from the
beginning. Move it there under a new name, SPI_CS_GPIOS_DT_SPEC_GET.
We haven't created a Zephyr release with
DT_SPI_DEV_CS_GPIOS_DT_SPEC_GET in it, so there is no need to go
through the stable API change process for devicetree.h to deprecate
and eventually remove it. We can just remove it directly.
Fixes: #42149
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Current solution throws an error during build if IGMP module is
disabled (statement with no effect).
Update the stubs in a similar fashion as other network modules implement
them.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Officially, designated initializers for struct are not valid
until C++20. Strangely enough, XCC only complains about this
particular initializer. So use anonymous struct initializer
instead.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Clang under XCC does not like Z_TIMEOUT_NO_WAIT's initializer
to be simple "{}". So change it to "{0}", which is functionally
the same and XCC-Clang likes it.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The #if to use static_assert() for BUILD_ASSERT() only checks
whether compiler is in C++ mode, but does not check what
C++ standard is being used. Since static_assert() is only
valid since C++11, for compilers not supporting C++11 (XCC...),
this will result in error. So add the correct #if to also
check for C++ standard being used.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Instead of redefining own `struct zsock_timeval` type at the socket
layer, use a standard type provided by libc. This prevents the
compliation errors when application includes both, `net/socket.h` and
standard C header defining `struct timeval` (sys/time.h).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Periodic advertising synchronization create had a timeout set
to fixed value of 10 seconds. BT 5.3 Core specification defines
synchronization timeout as 6 consecutive periodic advertising
events. When advertiser set the periodic interval to be more than
1.6 second it was possible the application timeout is reached
before time allowed by BT Core specification.
Changed implementation of timeout to depend on the periodic
advertising interval.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
There were no handling of HCI_LE_CTE_Request_Failed event.
The commit adds missing implementation. An application will
be notified about failed request by cte_report_cb. It is the
same callback that is used for reporting collected CTE IQ
samples. The same callback was used to avoid creation new callback.
To give an application possibility to distinguish between regular
IQ samples report and request failed additional member err was added
to bf_df_conn_iq_samples_report structure.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
CTE request control procedure may failed due to rejection by
peer device or due to receive of LL_CTE_RSP PDU without CTE.
These events has to be reported to host by HCI_LE_CTE_Request_Failed.
The commit adds missing functionalit.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
Request interval is a number of connection events that
is used to periodically run CTE request control procedure.
BT 5.3 Core Specification defines it as 2 octets long.
It had wrong type uint8_t. Changed to correct one uint16_t.
The commit also changes type of cte_rsp_en field of lll_df_conn_tx_cfg
to state that it is a boolean flag.
Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
- Added config BT_HCI_SETUP to enable HCI vendor-specific Setup feature,
- Added pointer to 'setup' function in bt_hci_driver structure.
BT_HCI_SETUP feature is useful when the BT Controller requires execution
of the vendor-specific commands sequence to initialize the BT Controller
before the BT Host executes a Reset sequence. To enable this feature the
CONFIG_BT_HCI_SETUP should be enable.
Fixes#41140
Signed-off-by: Nazar Palamar <nazar.palamar@infineon.com>
Algorithm was failing in case when overflow mode was enabled
but allocation of new message failed. It could happen if message
size exceeded buffer size. Losing track of buffered messages
can lead to logging processing freeze.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
1. Update to add support for Flexcomm8-13.
2. Fix the clock control driver, the enclosing #define
was incorrect.
3. Identify HS_SPI port using the appropriate Register
define
Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
DMA between a host os and processor (such as an x86 processor running
linux) and vice versa is used and supported by Intel's HDA DMA
Controller. This provides a method to transfer data, using hardware,
between the host and the local processor running Zephyr. The enums
added here are used to extend the dma_status direction enum
which provides information back to the DMA user and driver the
direction of the DMA transfer for a particular channel. This can
then be used, where needed, to add logic around the direction of the
transfer.
In addition to adding the two directions it adds enums to account for
cases where additional DMA directions that are IP and driver specific
may exist.
Signed-off-by: Tom Burdick <thomas.burdick@intel.com>