The variable needs to be an atomic_t, and in one case it was
being incremented outside of an atomic_inc/atomic_add.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The test itself handles correctly whether gen_isr_table
style dynamic interrupts are supported or not, there's
no need for an alternate scenario.
The tests work fine on riscv32 now, remove the exclusion.
Add a github link as to why Nios II is still excluded.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The author of this test case seems to have been under the
mistaken impression that interrupts are locked in ISRs, which
is untrue.
The only reason this ever passed, anywhere, was a race between
the timer firing and the zassert_not_equal() check in
offload_function. If the busy_wait call is moved after the timer
is started, this fails everywhere.
We do not re-use the timer object from the previous case,
resolving some crashes observed on riscv.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
The test tries to mask CPU interrupts and then enable a k_timer,
passing if it didn't fire.
This is totally defeated if the interrupt just fires on another
CPU that doesn't have interrupts masked.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This logic should be using the sched_lock and not its own
separate lock for these two functions.
Some simplications were made; z_thread_single_resume and
z_thread_single_suspend were only used in one place, and there was
some redundant logic for whether to reschedule in the suspend case.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This was silently corrupting memory on x86-64.
Enable CONFIG_TEST so that this is detected properly,
and increase the stack size appropriately.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
User is currently able to enable verbose packet debugging for
received packets. This commit enables the same for sent packets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Adding the ability to set and get pthread names by defining
some non-standard extension functions that were first
introduced by Glibc.
Similar to zephyr thread naming, these allow for thread
tracking and debugging even when using the more portable
posix API.
Though Glibc was the originator, the current POSIX functions
have return codes based on Oracle's adopted spec, so these
functions follow suit. The Oracle and Glibc function
prototypes match.
Signed-off-by: Nicholas Lowell <nlowell@lexmark.com>
With this patch, the specific flag IWDG_STM32_START_AT_BOOT
is replaced by the zephyr generic WDT_DISABLE_AT_BOOT.
Signed-off-by: Francois Ramu <francois.ramu@st.com>
Improve settings example snippet so that it builds and works as
expected. For usability purposes, add print of stored value.
Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
More clear and detailed description of choices, and explicit
recommendations for users. Based on a question on the mailing list.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Refactor old state handling in bt_conn_set_state to use switch statement
instead of if statements.
This will give us warning about enum values not covered.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix connection complete event handling when the local RPA is not valid.
This can happen when the controller was not instructed to use an RPA
address, or the local IRK was set to an all zero IRK.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This allows flash_img.c to be used outside of mcuboot scope.
Add new call to not break existing code.
Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
In Core v5.2, Vol 6, Part B, Section 4.6.9 it is stated that it is
mandatory to support the PHY procedure if any PHY other than 1M is
supported.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
For the time being this 2M is only selectable for !nRF51 platforms.
Coded PHY is only selectable for nRF platforms supporting Coded PHY.
Signed-off-by: Rubin Gerritsen <rubin.gerritsen@nordicsemi.no>
Currently only supports Unix time.
‘get’ subcommand returns date in format “Y-m-d H:M:S”
‘set’ subcommand format is ‘[Y-m-d] <H:M:S>’
The ‘set’ subcommand is implemented with basic date validation.
For user convenience of small adjustments to time the time argument
will accept H:M:S, :M:S or ::S where the missing field(s) will be
filled in by the previous time state.
Signed-off-by: Nick Ward <nix.ward@gmail.com>
While CONFIG_ARCH_POSIX in general isn't compatible with Zephyr POSIX
subsys (because CONFIG_ARCH_POSIX itself is implemented on top of
POSIX, so there're obvious conflicts), apply workaround to allow to
at least use clock_gettime() and clock_settime() functions.
This change is grounded in upcoming support for date manipulation
commands for Zephyr shell, which are implemented using functions
above. There's no guarantee that CONFIG_ARCH_POSIX and Zephyr POSIX
subsys will coexist for any other usecase. (But the change is
relatively clean and is definitely in the right direction of
prototyping ways of such a coexistance.)
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
(cherry picked from commit 4a05644bce81f4792c018964d29c1158f1982d1e)
According to the Zephyr VS HCI specification:
Only Read_Version_Information and Read_Supported_Commands commands are
mandatory.
Check for supported Read Supported Features command before issuing this
command to the controller.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Make BT_CTLR_OPTIMIZE_FOR_SPEED option so that it is not
user selectable for nRF51x series SoC with encrypted
connections support.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Newer XDS firmware fails to flash correctly with higher adapter clock
speed. Using a slower speed for now to prevent errors.
Fixes#21372
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
Newer XDS firmware fails to flash correctly with higher adapter clock
speed. Using a slower speed for now to prevent errors.
Fixes#21372
Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
OpenThread has api to make use of radios energy scan feature.
Implemented this api in zephyr. This allows thread to perform energy
scan when needed.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
Implement function and necessary callbacks to handle Energy Scan feature
of the nRF radio driver needed by some radio stacks.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
Add the Energy Scan capability to the possible capabilities list.
Create new energy scan callback function type to make its usage
more readable.
Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
Add a simple test to verify that the bind() can be called multiple
times if AF_PACKET is set and there are multiple network interfaces
in the system.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the system has more than one network interface, then it should
be possible to bind a AF_PACKET socket to each interface if the
network interface index is set when bind() is called. This was
not possible earlier as the code was always using default network
interface with AF_PACKET socket bind().
Fixes#23153
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
According to LWM2M specification, when Queue Mode is used, the LWM2M
client should keep the reciever on for specified time after sending A
CoAP message. This commit adds a new LWM2M event,
`LWM2M_RD_CLIENT_EVENT_QUEUE_MODE_RX_OFF`, to facilitate the process by
notifying the application when it's safe to turn the receiver off.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add Kconfig option to enable Queue Mode binding. With this option
enabled, the LWM2M client will register with `UQ` binding, instead of
`U`.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
timespec_to_timeoutms calls clock_gettime that requires
CONFIG_POSIX_CLOCK. ifdef this function to avoid undefined reference.
Fixes#20137
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Fix to return the max tx/rx time back to set default time
after using mandatory minimum PDU length and time while
switching back from Coded PHY to 1M PHY.
Also fixes#23109.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Data Length Update transmit and receive time calculation
on PHY update procedure completion.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
When an unsupported SCSI command is received, an error status reply
is sent even if the Host expects data prior to the status.
This fix stalls the data reply before sending the error status.
Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
Data toggle should be reset after SetConfiguration or
SetInterface request.
Always reset data toggle in usb_dc_ep_enable.
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
USB Host expects dtoggle to be cleared after ClearFeature(Halt):
"[...] clearing the Halt feature via a ClearFeature(ENDPOINT_HALT)
request results in the endpoint no longer returning a STALL.
For endpoints using data toggle, regardless of whether an endpoint
has the Halt feature set, a ClearFeature(ENDPOINT_HALT) request always
results in the data toggle being reinitialized to DATA0."
- Subsection 9.4.5 of usb 2.0 spec (usb_20.pdf)
Signed-off-by: Audun Korneliussen <audun.korneliussen@nordicsemi.no>
Print the name of the discovered toolchain as well as the variable
used to initialize it.
This is nice to know when doing remote support, since users will
sometimes misconfigure their toolchain and not know what that means.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The header printed at the beginning of every west build is kind of
annoying. Let's remove it and just print the application source
directory at cmake time instead. The build directory and board are
already printed there, anyway, and that's all IDE users will see.
Let's clean up the BOARD to make it say "board" instead. That matches
the west build --board option name a bit more closely and is still
legible.
Likewise, let's not print any west build messages if we're just
incrementally recompiling. That's noisy.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Add I2C and SPI bus communication routines in separate files,
and register one or the other as read/write callbacks based
on bus selection in DTS.
This commit is fixing issue #22348 as well, as the SPI part
is handling in the proper way the CS GPIO part.
Signed-off-by: Armando Visconti <armando.visconti@st.com>