It is defined as spis120 rather than spi120,
because spi120 is already used for SPIM120 hardware instance,
but their base address is different.
Signed-off-by: Nikodem Kastelik <nikodem.kastelik@nordicsemi.no>
Add support for the STM32WB0 series to the existing STM32 driver for
Independent Watchdog peripheral.
NOTE: this commit only includes basic support for the watchdog.
STM32WB0 specificities such as the different possible clock sources, LSI
frequency measurement or window support are left for future implementation.
Signed-off-by: Mathieu Choplain <mathieu.choplain@st.com>
In 9d7ee123a5
the regex used to verify the sample is doing what it should was changed
in a way in which it cannot possibly pass.
Let's fix it.
While at it, in the same commit, the simulator version of the test was
merged with the real_hw version, but the test name kept "real_hw" which
is now missleading => let's fix it.
And let's set as integration platform the simulated target, so it
can actually be runtime tested in CI.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
Make reading and writing string values more flexible:
1. Eliminate the intermediate buffer when saving a string
setting. This needlessly limited the maximum string
length that could be saved using the shell command.
2. Do not add nor assume that a string saved in the settings
includes the null-terminator. The settings subsystem uses
metadata for encoding the value length, so there it is
redundant to also store the null-terminator in flash.
By the way, also make sure the command handlers only return
-EINVAL and -ENOEXEC error codes as documented in the
handler type description.
Signed-off-by: Damian Krolik <damian.krolik@nordicsemi.no>
When loading an extension, read-only sections that do not have
relocations and whose data is accessible from the ELF buffer can be
directly mapped as-is in the extension memory. This avoids the need to
allocate and copy unmodified data from the ELF buffer to the LLEXT heap.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This patch moves the alignment checks for MPU and MMU regions to the
beginning of the llext_copy_region() function. This is done to ensure
that the correct region alignment and size are used even in the case
where the region is reused from the ELF file buffer, avoiding MMU/MPU
configuration issues.
This also relaxes the same checks for regions that are accessed by the
kernel only (e.g. symbol and string tables), which do not need special
MMU/MPU treatment. This exposed an inconsistency in the MMU code, which
was setting the permission on the correct regions, but later restoring
the default permissions on every region, including the now-unaligned
ones.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This patch adds three new macros to initialize an llext_buf_loader
structure with a specific storage type. The existing LLEXT_BUF_LOADER
macro is discouraged, since its storage type is not explicitly defined
in the code but relies on the CONFIG_LLEXT_STORAGE_WRITABLE option.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
This patch introduces an 'enum llext_storage_type' that defines the
storage type of the ELF data that will be loaded:
- LLEXT_STORAGE_TEMPORARY: ELF data is only available during
llext_load(); even when the loader supports directly accessing the
memory via llext_peek(), the buffer contents will be discarded
afterwards.
LLEXT will allocate copies of all required data into its heap.
- LLEXT_STORAGE_PERSISTENT: ELF data is stored in a *read-only* buffer
that is guaranteed to be always accessible for as long as the
extension is loaded.
LLEXT may directly reuse constant data from the buffer, but may still
allocate copies if relocations need to be applied.
- LLEXT_STORAGE_WRITABLE: ELF data is stored in a *writable* memory
buffer that is guaranteed to be always accessible for as long as the
extension is loaded.
LLEXT may freely modify and reuse data in the buffer; so, after the
extension is unloaded, the contents should be re-initialized before a
subsequent llext_load() call.
To keep full compatibility with existing code, the storage type of
LLEXT_BUF_LOADER is determined by the CONFIG_LLEXT_STORAGE_WRITABLE Kconfig
option between LLEXT_STORAGE_PERSISTENT and LLEXT_STORAGE_WRITABLE.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Adding this information allows easy cross-reference of the effects of
memory optimization changes between subsequent commits.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Since we are using ZTest, if we use the ZTest paradigm properly, we
don't need a logging module, since ZTest already logs what it does.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Instead of having a bunch of giant if conditions and just running
all the test cases from one actual ZTest case, convert all the test
cases into proper ZTest test cases.
Removing the returns is now required because otherwise there will be
compiler warnings, and they were never doing anything anyways in the
event of zassert fail. ZTest cases are meant to report pass or fail with
ztest paradigm, not with return values and log messages.
Also move the test of the spi lock/release to a separate test suite
since it is not really testing an actual bus transfer, but rather a
that a feature in the SPI API is respected.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
More boy scout rule, I noticed every single test case was using
different variations of C syntax to declare the buffers, this is
inconvenient to the reader, make a standard way to declare buffers used
for the test.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
There was a lot of copy paste of this code:
int ret;
ret = spi_transceive_dt(spec, &tx, &rx);
if (ret) {
LOG_ERR("Code %d", ret);
zassert_false(ret, "SPI transceive failed");
return ret;
}
This is quite redundant and can be simplified.
Also, return is not needed because a failed zassert
will not continue to return anyways.
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Following the boy scout rule, since I am using this test a lot lately
and going to improve it, the first step will be to clean up the
structure of the file. The following changes are made:
- Remove unused #includes
- Condense some #if #else macro defines or make into single line, to
simplify the readability of the preprocessor code
- Move definitions around so that related things are all next to
each other, instead of randomly scattered around the file
- Create section header comments for broadly related things in the file
to improve developer navigation experience
- Introduce macro for copy pasted print buf size calculation
- A few minor comment edits
Signed-off-by: Declan Snyder <declan.snyder@nxp.com>
Remove the inline attribute from stm32 clock drivers functions
especially for functions that are only referenced in the clock API
operation structure and therefore cannot be inline. As a generic
comment, today compiler are smart enough to optimize embedded software
without needing inline function attributes in the source files.
This change hopes that next stm32 clock driver will no more replicate
this bad habit when using existing source files as implementation
examples.
No functional change.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
IN_RANGE() macro from zephyr/sys/util.h returns a boolean value
so it should be treated as such and not compared to a decimal value.
Fix stm32 clock drivers accordingly and simplify places where the
value is compared to true.
No functional change.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Correct typo in STM32H7 HSI clock calibration directives introduced
in commit 6b167f2596 ("drivers: clock_control: add calibration for
h7 pllx_hsi") that currently has no functionnal impact but is worth
to be fixed for consistency.
No functional change,
Fixes: 6b167f2596
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Remove function exported stm32_system_clock_update() defined in
STM32H7RS series clock driver but that is not used and not even declared.
There already exists a CMSIS SystemCoreClockUpdate() function in
STM32 HAL drivers for the exact same purpose one may use if needed.
No functional change.
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Integrate codeql code scanning from github to do basic static code
analysis on python, actions, js.
c/cpp to be added later.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Moved away from a texlive docker container to a vanilla ubuntu runner
so that we can better track the actual dependencies a user needs to
build the PDF rather than relying on the gigabytes of random stuff
that the texlive docker container pulls in.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Removed coverxygen installation from the CI workflow and added it to the
requirements.txt/.in files and make it easier for anyone to potentially
use it locally.
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
It was added in commit 7a8a4c9b3e,
but then, presumably unintentionally, was removed in commit
4c4e2c5213.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
For Kconfig auto-configuration of the FEM in the MPSL,
the node in the device tree MUST be named
"nrf_radio_fem".
Signed-off-by: Randy Scott <randy.scott@ezurio.com>
This clarifies the documentation of `bt_le_ext_adv_start_param` and
`bt_le_ext_adv_cb.sent`, and links them by via references.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Add ULP directory for samples related to the
Ultra Low Power Coprocessor.
Add a sample to demonstrate the debug process of the LP Core
Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
Add ULP Coprocessor board support for C6.
This requires a change in the board qualifier depending on the build
target.
Update esp32c6 overlay and configuration files to the proper name.
Signed-off-by: Lucas Tamborrino <lucas.tamborrino@espressif.com>
Following warning is printed if using strncpy(), so use memcpy()
instead. Note that this is false positive as there is no error here but
in order to avoid the warning, change the copy function.
subsys/net/lib/dns/mdns_responder.c:1371:25: warning:
'strncpy' output may be truncated copying 7 bytes from a string
of length 8 [-Wstringop-truncation]
1468 | strncpy(if_req.ifr_name, name, sizeof(if_req.ifr_name) - 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
subsys/net/lib/dns/mdns_responder.c:1468:25: warning:
'strncpy' output may be truncated copying 7 bytes from a string
of length 8 [-Wstringop-truncation]
1468 | strncpy(if_req.ifr_name, name, sizeof(if_req.ifr_name) - 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add support for the IPV6_MULTICAST_LOOP socket option.
This option allows enabling or disabling the consumption of multicast
packets by the sender. By default, the socket option will be enabled.
Co-authored-by: Pieter De Gendt <pieter.degendt@gmail.com>
Signed-off-by: Sayooj K Karun <sayooj@aerlync.com>
TLS_CREDENTIAL_SERVER_CERTIFICATE credential type is misleading, as in
fact it just represents a public certificate, it does not matter if the
certificate belongs to a server or a client. And actually, it was
already used in-tree for clients as well, for example in LwM2M.
Therefore rename the credential type to a more generic
TLS_CREDENTIAL_PUBLIC_CERTIFICATE and deprecate the old one.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
If there are no virtual interfaces attached to this virtual
interface, check if there is a RX handler for this virtual
interface and pass data to it.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Clear all previous events when register is called a second time. This is
the same behavior as before, if the call happens with `len` equal or
greater then the previous call but in the case if `len` is less then the
first call, now, all events are cleared. This is more predictable behavior.
Signed-off-by: Cla Mattia Galliard <cla-mattia.galliard@zuehlke.com>
- Define alarm_set_callback() only when CONFIG_RTC_ALARM is set otherwise
a warning will be generated at runtime for the function not being
used.
- add "static" keyword to all internal functions.
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Clear display only when display pixel format is actually supported
since buffer size depends on it.
Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>