Updated nrf clock control driver to use onoff service for managing
multiple users.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
When there were multiple writes to eventfd, then poll() + read() should
start behaving as just initialized. Test that by verifying poll() will
timeout first and later be notified properly when eventfd is written
once again from the other thread.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
So far semaphore was used with possible values in range 0 to
UINT32_MAX. Each write resulted in semaphore increment. As an example
after two writes and single read eventfd counter was correctly zeroed,
but semaphore counter was not. This means that poll() signalled at this
stage POLLIN (semaphore counter was > 0), but it clearly should
not (eventfd counter == 0). Blocking version of read() was also
returning immediately, returning 0 as previous eventfd counter.
Change read_sem to be a binary semaphore, which counter represents
eventfd counter being zero (when semaphore counter == 0) or
non-zero (when semaphore counter == 1). Try to take the semaphore in
eventfd read() and decrement eventfd counter when semaphore was ready.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Fix a crash in the persistent advertising handling.
This occurs because the callstack of the RX thread overflowed
due to an infinite recursion between bt_conn_unref and
bt_le_adv_resume.
This happens when starting a new advertiser is denied by the
controller, then the conn object reserved will be released again
and the host will attempt to resume advertising in the bt_conn_unerf
at the end of bt_le_adv_resume.
This situation can happen if the host supports more connections
than the controller.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Later this year I hope to overhaul the memory domain APIs,
but at least for now let's at least consolidate these checks.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Different switch was used for build to allow including all shim body
in zephyr without the need for building openthread from this repo. This
allows developer to include custom OpenThread sources as part of the
application.
This change is needed as Thread is a subject of certification and
sources provided by zephyr may not necesairly pass certification or be
precertified. User is allowed to use certified OpenThread version
this way.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
Fix compilation error when the DIAG module is enabled.
All core functionalities are provided.
Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
When this happens, ip6_addr_cb and ipv6_addr_event_handler() both look
unused, since they are passed to macros which discard them.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Since the peer isn't replying on SYN resend, update the
test to check for failed connect.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Since the connect is now blocking, update the timeout values
for the tests to pass.
In case of resend test, set the timeout to 1000ms to account
for the retransmission.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
In order to implement a blocking connect, add a semaphore
and block on it in net_tcp_connect().
The semaphore is released when ESTABLISHED state is reached.
In case tcp_conn_unref() is called while waiting on the semaphore,
defer the unreference, tcp_conn_unref() will be called from
net_tcp_connect().
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
In order to improve readability, refactor and simplify
the control flow in net_tcp_connect().
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
In order for events to be correctly interpreted in SYN_SENT,
check for SYN and ACK simultaneosly.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
net_tcp_put() can be called before ESTABLISHED state
is reached, send FIN only in ESTABLISHED state.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Previously, if the arena size was zero, malloc would always fail.
However, the log message was only visible if debug messages were
enabled. Logging an error will hopefully make it more obvious that
CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE should be >= if the minimal
libc and malloc are both used.
Fixes#26720
Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
Follow Bluetooth specification recommendation of setting the output
of the DH_Key field in the LE Generate DHKey Complete event when the
public key is invalid.
If the Remote_P-256_Public_Key parameter of the HCI_LE_Generate_DHKey
command (see Section 7.8.37) was invalid (see [Vol 3] Part H, Section
2.3.5.6.1), then all octets of the DH_Key event parameter should be
set to 0xFF.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
FLASH_TYPEERASE_PAGES is null and doesn't represent a bit in the
register, thus this instruction has no effect.
It must be replaced by FLASH_CR_PER which is the bit that should
be cleared.
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Adds a high-level documentation page for the Bluetooth Mesh Shell
subsystem, documenting all available commands and their parameters.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Updated implementation to have consistent initialization of
ret_cb use when passing it to ticker function calls.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Test include non-aligned read in nrf_qspi_nor flash and
SoC flash memory to buffer with variable size.
It checks all possible variants of alignment and size.
Signed-off-by: Mateusz Syc <Mateusz.Syc@nordicsemi.no>
Added function read_non_aligned that reads data under
non-aligned flash addres to non-aligned read buffer of any size.
Signed-off-by: Mateusz Syc <Mateusz.Syc@nordicsemi.no>
Remove cmd_ull_reset command, as this would put the host out
of sync. Also, this command is seldom used/required.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Added a feature that allows an application to request
automatic discovery of the CCCD handle when subscriping
to a characteristic. In order to preserver RAM, the application
is expected to provide the discovery parameters, and it's up
to the application whether or not it wants to reuse the
discovery parameters or use one for each characteristic.
Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
Add a sample to demonstrate and test the Wurth Elektronik WSEN-ITDS
accel sensor. Sample code covers accel and die temperature functions.
Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Add support for wsen-itds 3-axis accel sensor, provides acceleration,
temperature data reading and supports configuring of output data rate,
operating mode and scale.
Signed-off-by: Saravanan Sekar <saravanan@linumiz.com>
Single work object for whole fsm was not being able to handle more than
single packet at a time. Because of that we have overwritten already
scheduled packets, resulting in fsm timeout and net_pkt leak.
Use net_pkt work object instead, so we can safely schedule more than a
single packet.
This commit also drops workaround for qemu_x86 unit testing.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
It's not safe to assume that the data section is 8-byte aligned.
Assuming 4-byte alignment seems to work however, and results in
simpler code than arbitrary alignment support.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There is following error when compiling applications using smp:
/zephyr/include/mgmt/smp.h:77:16: error: field 'zst_work' has \
incomplete type
77 | struct k_work zst_work;
| ^~~~~~~~
/zephyr/include/mgmt/smp.h:80:16: error: field 'zst_fifo' has \
incomplete type
80 | struct k_fifo zst_fifo;
| ^~~~~~~~
Fix that by adding missing kernel.h include statement in mgmt/smp.h.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
The hardware stack overflow feature requires
CONFIG_THREAD_STACK_INFO enabled in order to distingush
stack overflows from other causes when we get an exception.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
--warnings-as-errors was basically doing nothing, it is the default.
Replace this with an option to disable erroring on warning:
-W, --disable-warnings-as-errors
Fixes#26910
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Conditional API was removed by preprocessor which violates zephyr
coding style. Removed ifdefs around conditional API.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Add devicetree overlay for connecting an Mikroe ETH click shield to an
NXP LPCXpresso55S69 development board.
The LPCXpresso55S69 uses SSEL1 (CS1) for mikroBUS SPI, whereas the
generic Mikroe ETH click board definition assumes SPI CS0.
Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
Replaces .conf type configuration with .defconfig.
Makes configuration conditional, it depends on shield definition and
networking.
Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
Transfers are cancelled on suspend event, OUT transfers
needs to be re-trigger on resume.
Rework event handling to filter out spurious resume
events and re-trigger transfer if previous event was
a suspend event.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
The parameters for this fuel gauge depend on the hardware design and
the expected battery. These should not be defaulted to a value that
may be inappropriate. Require that they be explicitly provided.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Add a note in 2.4 release notes regarding SW_VECTOR_RELAY
feature, now supported also in Mainline Cortex-M architecture.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>