Changes the implementation of `bt_gatt_is_subscribed` to use the
attribute read method instead of casting the user data pointer when
extracting the CCC Attribute Value.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
Refactors `bt_gatt_is_subscribed` by changing a CHECKIF to an if
statement to avoid undefined behavior if CHECKIFs are "disabled".
Uses sizeof(a uint8_t) instead of 1 to avoid magic numbers.
Initializes `properties` to 0 to avoid undefined behavior.
Signed-off-by: Håvard Reierstad <haavard.reierstad@nordicsemi.no>
This commit enables the TPIU clock source in Apollo3 and
Apollo4 soc initialization if LOG_BACKEND_SWO is used.
Signed-off-by: Aaron Ye <aye@ambiq.com>
This commit defines the default pinctrl of ITM for Apollo3 and
Apollo4 EVB. Also configures the default SWO frequency.
Signed-off-by: Aaron Ye <aye@ambiq.com>
-fuse-ld=lld is currently specified twice through the baremetal property
(in cmake/linker/lld/linker_flags.cmake) and TOOLCHAIN_LD_FLAGS (in
cmake/linker/lld/target.cmake). This doesn't really harm anything as
it isn't duplicated on the link line (and specifying it multiple times
wouldn't hurt even if it was), but it also doesn't really help anything.
-fuse-ld isn't baremetal-specific and setting it via TOOLCHAIN_LD_FLAGS
will cover this case anyway, so remove this duplicate.
Signed-off-by: Jonathon Penix <jpenix@quicinc.com>
What is changed?
Use CMSIS SystemCoreClock via a dedicated flag instead of using
soc flags.
Why do we need this change?
This change is part of cleaning soc specific code out of arch folder.
Signed-off-by: Sudan Landge <sudan.landge@arm.com>
The default policy currently directly references the private
variable next_event from policy_events.c to then convert the cycle
of said event (if exists) to a kernel tick in the future, something
policy_events.c already implements and exposes through
pm_policy_next_event_ticks().
Additionally, the implementation of pm_policy_next_state() in
policy_default.c already gets the nearest kernel tick, wherein
the next event has already been accounted for in, see
implementation of pm_system_suspend().
This commit removes the redundant and layer violating computation
if the tick of the next event from policy_default.c and updates
the test test_pm_policy_events to not use default policy to
determine if pm_policy_next_event_ticks() is correct.
Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
The short sleep (10ms) was not enough any more. Increase the sleep
to 100ms so that system stabilizes between checks.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Print information in "net ipv6" command how the SLAAC addresses
are generated. There is the default legacy EUI-64 method (RFC 4862) or
the stable method described in RFC 7217.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
Add tests that verify that stable IIDs generate a proper IPv6
interface identifier described in RFC 7217.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This implements support for RFC 7217 which describes a method
to have stable IPv6 Interface Identifiers to be used with IPv6
Stateless Address Autoconfiguration (SLAAC). The stable IIDs are used
to provide enhanced privacy so that an IPv6 address configured using
this method is stable within each subnet, but the corresponding
Interface Identifier changes when the host moves from one network
to another. This method is meant to be an alternative to generating
Interface Identifiers based on hardware (MAC) addresses,
such that the benefits of stable addresses can be achieved without
sacrificing the security and privacy of users.
Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
- Refactoring of the cmake code so LinkServer can be invoked with the
correct switches.
- Documentation update
Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
LinkServer manages port numbers for gdb and semihost as separate linear
sequences when invoked to debug multi-core applications, e.g the
gdb-server instance for cpu0 will have the default GDB port 3333 and the
next gdb-server instance will be assigned the port 3334. The latter will
conflict with the default port for semihost which is 3334.
This patch changes the default port for semihost to 8888.
Port numbers can be changed when invoking the linkserver runner.
Signed-off-by: Yves Vandervennet <yves.vandervennet@nxp.com>
The alloc_buf callback is not used when `seg_recv` is set, so it is
never called in this test. Remove it.
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
Allowing an invalid address to be "freed" when asserts are disabled
is dangerous and can lead to a very hard class of bugs (and potential
security issues) to troubleshoot. This change always validates the
address before adding it to the free list and calls k_panic() if
asserts are not enabled.
Signed-off-by: Corey Wharton <xodus7@cwharton.com>
Due to addition of busy threads running on other cores, and
the simulator runs in single thread bouncing through all cores,
we are wasting quite a bit of time just busy waiting. This makes
each simulator run too long for CI. So limit CPU number to 1.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Native builds uses system libraries per default.
Instead of handling this in each linker_libraries.cmake files, then the
check for native build is moved one level up and for native build a
dedicated linker_libraries_native.cmake is sourced.
This simplifies the linker_libraries.cmake files as they no longer need
to check for native builds.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
The property based toolchain integration allows a cleaner design by
letting the toolchain define its properties and values and let CMake
implementation of Zephyr provided C and C++ libraries adjust those
properties when minimal C or C++ libraries are used.
This commit moves handling of C++ linker library properties into
the minimal C++ CMake implementation.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Now that section header cache is persistent, it can be used for
finding sections. Add a new function, similar to llext_find_section()
to use it and deprecate llext_find_section().
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Move cached section headers to struct llext from struct llext_loader
to preserve them after llext_load() returns.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Currently when building LLEXT for Xtensa we use the -fPIC compiler
option, but this cannot be used when using detached sections in
extensions. Add a Kconfig option to switch between the two
compilation modes and switch -fPIC off when building relocatable
(partially linked) ELF binaries.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When detached sections are used, STB_GLOBAL relocations also have to
be processed depending on the relocation type. This commit unified
STB_GLOBAL and STB_LOCAL flows by making them use the same relocation
type parser, adds support for R_XTENSA_GLOB_DAT and R_XTENSA_JMP_SLOT
type relocations on Xtensa and fixes STT_SECTION address calculation
for such sections.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Detached sections are used in situ without being copied to or
referenced from ext->mem[] LLEXT region arrays. Their caches must be
synchronised accordingly.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The newest AN1760 application note - Revision F (DS60001760G - June 2024)
is recommending to not write the node count to PLCA_CTRL1 register when
the node is not the PLCA coordinator (i.e. its ID is not zero).
Signed-off-by: Lukasz Majewski <lukma@denx.de>
This patch brings update of the procedure to initially configure the
LAN865x devices. It follows setup guidelines from newest AN1760 [*].
The values from "TABLE1" on the [*] must be written to the device in the
indicated order with recommended values.
This was not the case previously, as first values from in-flash allocated
(const) table were written and only afterwards calculated configuration
parameters (cfgparams) were updated.
With this patch the lan865x_conf[] table is allocated in-RAM, so
placeholder values can be updated and it can be written at once at the
end of configuration process.
Its single entry has been reduced from 8B to only 4B. Moreover, moving
it out of flash saves 512B of flash memory.
Note:
[*] - AN1760 Revision F (DS60001760G - June 2024)
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Update FAE table type from array of uint8_t to int8_t. From Vol 6.0,
Part B, section 2.4.2.52: "The ChFAE field contains the per-channel
mode-0 FAE table of the local Controller. Every per-channel mode-0
FAE value is represented by an 8-bit signed integer"
Signed-off-by: Adam Cavender <adam.cavender@nordicsemi.no>
CONFIG_ENTROPY_DEVICE_RANDOM_GENERATOR is on
by default, if the device supports that, so there is no need
to enable it explicit.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
use auto init for networking, dhcp and sntp.
This simplifys the code of this sample by using the
auto init feature of the networking stack.
Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
The it8xxx2_kbd KSO pins can be used as both keyboard scan and GPIO. By
default the keyboard scanning driver controls the output level of all
the KSO signals from 0 to (col-size - 1), meaning that any line in
between used as GPIO is going to have its output value overridden.
Add a kso-ignore-mask property to the keyboard scan driver to allow
specifiying extra pins that should not be controlled by the driver.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
For SIGEV_SIGNAL, the function zephyr_timer_wrapper() is the handler
between kernel and posix layer.
Here, for one-time timer, reload is equal to 0 and function returns.
As a consequence, handler function was never called.
Signed-off-by: Noemie Gillet <ngillet@sequans.com>
The tx fifo empty interrupt is a edge driven interrupt, so if it
is already empty then and the interrupt is enabled, it will not
fire so the isr needs to be triggered manually for the callback.
This also removes the unnecessary interrupt locking in the isr and
removes the receiver timeout interrupt.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
Refined `can_sja1000_read_frame` and `can_sja1000_write_frame` by
reducing `frame->id` pointer dereferences.
Using a local `id` variable aims to improve efficiency, given
the frequent execution of this code in CAN applications.
Signed-off-by: Pisit Sawangvonganan <pisit@ndrsolution.com>
bt_conn_le_create logs an error if the provided conn is
not NULL. This small change cleans up the log a bit to
avoid the warning.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Everything else is defined as hex, so it makes sense to
be consistent. This will also make it easier to find the
service IDs in the logs that primarily already log
commands and events as hex.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Since the values are defined as hex, e.g. 0x82, it is easier
to compare with the log if they also log them as such.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>