For some reasons SOC_SERIES_SAME70 was selected in civetweb sample,
which prevents build on other platforms.
This issue was silent since sample yaml file limits sample testing on
sam_e70_xplained.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Adds a deeper hierarchy to the Bluetooth Mesh documentation by moving
the modules in separate pages with a brief description of the concepts
in each module.
Adds the full list of specification defined Health model faults.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
The HiFive1 boards power up using a 32 KiHz low frequency kernel, so
have a cycle rate of 32768 Hz. The board definitions have not been
revisited since the Zephyr default for ticks-per-second increased from
100 to 10000. The timer system on the board does not operate
correctly at 4 cycles per tick, but does at 328 cycles per tick.
To support functional timers while keeping system milliseconds in sync
with clock time set ticks-per-second to 128.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Fix an issue discovered by Coverity where there is a potential
out of bound access on the divisor arrays.
Fixes#20495Fixes#20496
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Some early tickless drivers had a common pattern where they would
compute a tick maximum for the request (i.e. the maximum the hardware
counter can handle) but apply it only on the input tick value and not
on the adjusted final value, opening up the overflow condition it was
supposed to have prevented.
Fixes#20939 (Strictly it fixes the specific pattern that was
discovered in that bug. It's not impossible that other drivers with
alternative implementations have a similar issue, though they look OK
to me via a quick audit).
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
If LL Connection Parameter Request or LL Connection Update
or LL PHY Update procedure is started by the local device
while a LL Length Update Request PDU has been sent by peer
then a Rx node has been stored in the llcp_rx place holder
for generation of Length Update procedure complete.
The failing assert check is incorrect in the above scenario
hence remove. Instead a missing append of the allocated Rx
node to the llcp_rx list has been added to the controller
implementation.
This issue relates to commit d12c53f89f ("Bluetooth:
controller: split: Fix missing data len update event").
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
On watchdog-triggered reboot, the SAM platforms
reset RAM, so the wdt_basic_api cannot be completed
successfully, as it relies on RAM retention (relies
on variables stored in RAM retaining their values
across different boot cycles). Exclude the platforms
with the SAM Watchdog from this test.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Add an implementation for `sendmsg`, so secure sockets can be used
together with the WebSocket module to implement secure WebSockets
("wss").
Fixes#20431
Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
event_index must be lower than NRFX_IPC_ID_MAX_VALUE.
As of now, maximum index is 16.
Fixes#20962, #20964, #20967
Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
Szymon was removed from all Bluetooth paths a while ago, and this is
simply an overlooked leftover.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that the TX path and TX context (bt_conn_tx) has been redesigned
to free the contexts always in the system workqueue, it means the
system workqueue is the only context where their allocation may also
fail. This is particularly problematic with us having all L2CAP
channels (fixed & CoC alike) deferred to the system workqueue. It is
especially bad for fixed channels where being able to send responses
for SM, L2CAP signaling and ATT is critical to avoid timeouts for the
connection.
This patch moves the processing of all fixed L2CAP channels back to
the RX thread, thereby making it possible (and safe) to block while
waiting for a TX context to become available.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Now that we've removed the TX allocation dependency from the TX thread
we no longer have the need to do special-casing for the system
workqueue when allocating buffers. Instead, we do have to special-case
the system workqueue when allocating TX contexts since the system
workqueue is the only place where they get freed up.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This is a moderate redesign of the pending TX packet handling that
aims to eliminate potential deadlocks between the TX thread and the
system workqueue thread. The main changes are:
- TX context (bt_conn_tx) is allocated during buffer allocation, i.e.
not in the TX thread.
- We don't allocate a TX context unless there's an associated
callback. When there's no callback simple integer counters are used
for tracking.
- The TX thread is no longer responsible for TX callbacks or
scheduling of TX callbacks. Instead, the callbacks get directly
scheduled (k_work_submit) from the RX priority thread.
- CONFIG_BT_CONN_TX_MAX defaults to CONFIG_BT_L2CAP_TX_BUF_COUNT,
and in most cases wont need changing. The value now only indicates
how many pending packets with a callback are possible.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The `node` and `work` members are never used simultaneously.
Additionally k_work already has built-in support for being in a linked
list, however a union makes this change a bit cleaner.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
For consistency with all other boards, make the `buttons` node a child
of the root node, not the `leds` one.
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
In seg_tx_reset() in transport.c, set the busy flag to 0U
before doing adv buf unref, which will avoid sending
unnecessary adv packets in case the adv buf is already put
in the mesh adv_queue.
Fixes#20970
Signed-off-by: Maximus Liu <maximus.liu@gmail.com>
echo_server crashes if the coverage is enabled due to the insufficient
stack size.
Use bigger stack size when the coverage is enabled.
Fixes#20797
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Similar to what we do in other timer drivers, the maximum ticks
supplied in z_clock_set_timeout(..) needs to be MAX_TICKS at
maximum, when K_FOREVER is supplied as argument to the function.
In addition to that, the value we load onto the SysTick LOAD
register shall be truncated to MAX_CYCLES. This is required
to prevent loading a trash value to LOAD register, as only
the lowest 24 bits may be safely written.
Finally, we move the enforcement of the minimum delay to be
programmed on LOAD (i.e. MIN_DELAY) at the end step of the
calculation of the cycles-to-be-programmed. This prevents
from misscalculating the delay, as any required adjustment
is applied at the end, after the delay is rounded up to
the next tick boundary.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
When setting a timeout measure the number of accumulated unannounced
ticks. If this value exceeds half the 32-bit cycle counter range
force an announcement so the unannounced cycles are incorporated into
the system tick counter.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The commit fixes the update of the absolute counter of HW cycles
in the SysTick ISR for TICKLESS mode.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The previous solution depended on a magic number and was inefficient
(entered the second-wrap conditional even when a second wrap hadn't
been observed). Replace with an algorithm that is deterministic.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Add detailed documentation for the internal 'elapsed()'
function, as well as for the local counter variables used
in the SysTick driver.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Unsupported bits of the Current Value Register
are read as zero, so we remove the redundant
ANDing with the max supported counter value.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Adding kernel tag in tests/kernel/early_sleep and sleep tag
in tests/kernel/sleep. So both early_sleep and sleep suites
have the same tags.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Use malloc/free instead of k_malloc/k_free in operator new/delete
implementation or use libstdc++ implementation when available.
Further updated cpp_synchronization sample to enable minimal libc heap
as virtual destructor requires operator delete which depends on free.
Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
A recent patch increased struct cmd_data from 8 to 12 bytes, which is
more than the default user data for Bluetooth. We generally don't want
the core stack to require more than 8, so instead of increasing the
requirement, move the data out from the buffer into its own array with
the help of the net_buf_id() API.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The instructions for samples/usb/dfu fail on Nordic platforms if the
erase is not progressive. Default to enable that on Nordic.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
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>