The original code assumed that limiting the tick count to the maximum
cycle value representable without wrapping would guarantee that adding
the resulting cycle offset to last_count would not lap the counter.
This is not true when elapsed time, which is also added to the cycle
offset, exceeds one tick. Cap the maximum offset at the number of
cycles corresponding to the maximum number of ticks without wrapping.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Fix unintended sign extension (SIGN_EXTENSION).
The result of "coap_block_size_to_bytes() * (iter - 1)"
extending the sign type.
Issue is the conversion of iter from u8_t to int because it's
an unsigned operand in an binary subtraction with 1 which is
a signed operand with higher conversion rank (int).
Fixes#20880Fixes#20881Fixes#20882Fixes#20883
Coverity CID :205780
Coverity CID :205786
Coverity CID :205806
Coverity CID :205808
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Corrected & improved transition implementation so that
no_transition_work thread will not get triggered twice at the
end of transition.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
User can set transition time as Zero & delay as non-zero value.
In that case, we have to depend upon timer.
Signed-off-by: Vikrant More <vikrant8051@gmail.com>
Add clearing error event to UART and UARTE drivers.
Without it driver goes into infinite interrupt loop.
Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
Fixed bug in parsing testnames from source files. We added 1cpu testing
but did not update the regex and we have been passing wrong path to the
glob as well, meaning tests were not parsed at all.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add test cases to make sure that a thread that suspends itself stops
executing immediately, and that a thread suspended while sleeping does
not wake up unexpectedly when its timeout expires.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
When suspending a thread, cancel any pending timeouts which might wake
it up unexpectedly. Also, make suspending the current thread
(specifically) a schedule point, as callers are clearly going to
expect that to be synchronous.
Also fix a documentation weirdness. The phrasing in the earlier docs
for k_thread_suspend() was confusing: it could be interpreted as
either document the current (essentially buggy) behavior that threads
will "wake up" due to preexisting timeouts, OR to mean that thread
timeouts will continue to be tracked so that resuming a thread that
was sleeping will continue to sleep until the timeout (something that
has never been implemented: k_sleep() is implemented on top of
suspend). Rewrite to document what we actually implement.
Fixes#20033
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Coverity's analysis is not happy about using a volatile variable
in an assert, even if the assert is not optionally compiled in.
Avoid the issue by loading the value in an automatic varible before
using it in the assert.
CID: 206016
CID: 206018
CID: 206019
CID: 206021
Fixes: #20968Fixes: #20966Fixes: #20965Fixes: #20963
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fix race condition in bt_conn_create_le for the state of the scanner in
the Host. This leads to the host issuing a create connection command
without stopping the scanner first. This leads to command disallowed and
failing to establish connection. As well as inconsistent state in the
host which does not allow to stop the running scanner.
The race condition exists because the processing of le_adv_report
handler is done before the thread that called bt_conn_create_le was
woken up to continue after the command_complete event.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
When storing an updated hardware list remove the serial property value
from entries that are not connected, to reduce confusion about exactly
what ttyACM0 is connected to.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Confirm to the user what devices were found and where they are before
starting a long run that might not have found everything it was supposed
to test.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Boards like mimxrt1060_evk are recognized by the scanner through their
USB device which has an ID, but in some cases the board may be
programmed using an external J-Link probe. Support this by adding a
probe_id key that can be added to the yaml dictionary to override the
use of id for this purpose.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Add manufacturer and product identifiers to produce board information
for SiLabs and NXP hardware when using --generate-hardware-map.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
When generating the dependency file for DTS (${BOARD}.dts.pre.d),
some toolchains would use the source file for the file name stem.
So, the resulting dependency file is empty_file.d instead of one
with the board name. Fix this by passing -MF to explicitly tell
the compiler the name of the dependency file.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit fixes the issue, that --enable-coverage alone did not create
coverage information. It also required to give --coverage-platform.
Now the fallback for coverage-platform to platform works as documented
also for enable-coverage, not only for coverage option.
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
We've added some new capabilities for documentation writers such as the
tabbed interface and numbered instruction steps, as used in the updated
Getting Started Guide.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Adding a release notes section for the ARM Cortex-M
architecture, to be part of the Zephyr v2.1.0 release notes.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
In nvs writing addresses are u32_t. Coverty reports two situations
where the address could be converted (unwanted) to a signed value.
Both have been corrected.
There is however a general problem with flash API where the addresses
are defined as off_t which is a s32_t. These are converted in the flash
hal to u32_t. As a result of this only half of the possible range can
be used.
Solves #20867 and #20866
Signed-off-by: Laczen JMS <laczenjms@gmail.com>
Noticed that <p> within a responsive table (as found in the kconfig docs
generated by the new genrest.py script in PR #20322) weren't displaying
using the same font size as table cells without <p> content. This
situation occurs when the help text in the Kconfig file is more than one
paragraph.
Also added a comment explaining why a previous CSS tweak was added.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
On LSM6DSO sensor the INT1 pin is used for both generating the drdy
interrupt and for switching to I3C hotjoin mode just after reset if
it is at logical '1' level. If you reset the x_nucleo_shield3 board
the LSM6DSO enter in hot join, as INT1 '1' level is preserved by
the level shifter.
This commit switch to INT2 to generate DRDY interrupt, so that INT1
always remain to logical '0' level.
Fixes: #20933
Signed-off-by: Armando Visconti <armando.visconti@st.com>
When we build without support for user mode, we do not need
a large number of MPU regions, so we should not allow having
MPU_GAP_FILLING unset. This would allow PRIV code execute from
SRAM, which is an unnecessary compromise on ARMv8-M builds
without USERSPACE support. We update the Kconfig dependencies
and add a sentence for clarification.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
mps2_an521 is the default board for ARMv8-M architecture with
support for Security Extension, and CI should test building and
running samples and tests on this board by default. As the focus
is on kernel, userspace, and arm test suites, certain tags are
set to be ignored when testing on this platform.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Fix the initiator so that connection request PDU is not abort
mid-air by preemption by the overalapping first connection
event.
If the connection establishment is in progress, then the
first connection event trying to abort the initiator will
wait the connection request to be transmited completely.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Enable ticker job mayfly as soon as possible when
establishing connection. This is required so as to not miss
the first connection event in slow CPU like in nRF51 series.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Size argument must be smaller than strTo buffer size since
strncpy terminates string with NULL.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>