The sample was bitrotted because sample.yaml was missing and no
build checks were done, so we missed the case when TCP header
API function was removed. This is now fixed by using still available
UDP header API (to get the port numbers). Also fixing debug print
as it were giving compile warnings.
Fixes#14608
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The sanitychecker needs sample.yaml in order to compile test
the promiscuous mode sample application.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
A note in the Modules (External projects) section indicated
that in the future it would be possible to do something that
can be already done.
So, let's clarify the note with how it can be done.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Backend was not initialized to work in synchronous mode if LOG_IMMEDIATE
was enabled. That causes use of rtt_lock which uses mutex. That lead to
assert in application.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Make descriptions a bit more clear, emphasizing the primary
operation, and de-emphsizing (but still describing) prerequisites
and side effects.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
It's not necessary for this sample to output to the user
(it uses printf) and saves over 5K of ROM size, eliminating
some build failures on Quark D2000.
Fixes: #14476
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Fix issue #14618.
The I2S controller may generate an underrun/overrun error whenever
the current sample in the Data Register (DR) has not been read/written
yet when a new one needs to be sent/received. When the DMA operation
is completed there is no much time to re-enable it for a new
transfer. For example, in the case of a PDM microphone clocked at
2MHz we only have 8us to re-program the DMA to receive the new 16-bit
sample.
Doing a complete DMA configuration using the dma_config() API is an
operation that is consuming too much time and driver is close to the
limit. Instead, the dma_reload() routine only programs the minimum
needed information (src, dst, len) for the new transfer in order
to restart the DMA.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
The dma_reload() is useful when there's the need to immediately
and quickly restart the DMA for a new transfer when the current
one is completed. If the operation is not done quickly there
might be underrun or overrun errors and the data flow is broken.
The dma_reload() just does the minimum operations required, i.e.
programming the new src/dst addresses and transfer size.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
TCP context is now created with refcount of 2, signifying that it's
jointly owned by an app and stack. Thus, net_context_put()
unconditionally calls net_context_unref() to decrement refcount on
app's behalf, and leaves stack's refcount to internal routines
which handle sending/receiving/timing out FINs, etc.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
TCP context is effectively owned by both application and the stack:
stack may detect that peer closed/aborted connection, but it must
not dispose of the context behind the application back. Likewise,
when application "closes" context, it's not disposed of immediately,
there's yet closing handshake for stack to perform.
This effectively means that TCP contexts have refcount of 2 when
they're created. Without this change, following situation is
possible: peer opens connection, an app get a context (or socket)
via accept, peer sends data, closes connection. An app still holds
a reference to connection, but stack may dispose of context, and
even reuse it for a new connection. Then application holds a reference
to either free, or completely different context.
This situation was very clearly and 100% reproducible when making
Zephyr port of open62541 library, which works in async manner using
select().
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Most CPUs have instructions like LOCK, LDREX/STREX, etc which
allows for atomic operations without locking interrupts that
can be invoked from user mode without complication. They typically
use compiler builtin atomic operations, or custom assembly
to implement them.
However, some CPUs may lack these kinds of instructions, such
as Cortex-M0 or some ARC. They use these C-based atomic
operation implementations instead. Unfortunately these require
grabbing a spinlock to ensure proper concurrency with other
threads and ISRs. Hence, they will trigger an exception when
called from user mode.
For these platforms, which support user mode but not atomic
operation instructions, the atomic API has been exposed as
system calls.
Some of the implementations in atomic_c.c which can be instead
expressed in terms of other atomic operations have been removed.
The kernel test of atomic operations now runs in user mode to
prove that this works.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
It's simpler and cleaner to move read_timer_start_of_isr to
_isr_demux. But the interrupt latency may be not accurate.
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
Added some more content to the section about how to simulate
with BabbleSim and a couple of extra links.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Fix bug in LL encryption procedure, controller was
using the wrong pointer to connection state.
Function event_enc_prep is called from
slave_event_prepare, where _radio.curr_conn has not
been assigned yet.
The connection ended up sending LL_START_ENC_RSP
unencrypted, resulting in disconnect on the peer
side with reason MIC failure.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
This test isn't SMP-safe and won't pass reliably on x86_64 by default
(though it does pass often enough to get CI passes on most things, it
fails spuriously in ways that aren't timing related). Turn off the
second CPU. Fixes#14501
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Since #14545 was merged building with USERSPACE and NO_OPTIMIZATIONS
has been broken due to #5226.
To fix#5226 we increase the size of KOBJECT_TEXT_AREA when
NO_OPTIMIZATIONS.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
- Remove DTFlash.extract(), which was just dispatching to either
_extract_flash() or _extract_code_partition() depending on which
magic string was passed in. Call them directly instead.
- Fold constant and globally available parameter values into functions
- Remove DTFlash._flash_node. It's easy to derive wherever it's needed,
and it makes it clearer where it comes from (and means functions can
be called in any order).
- Remove DTFlash._flash_base_address, which is unused
- Remove various unused parameters to functions
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
def_label is the name used for macros and .conf file values. It can
never have a slash in it.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
- Fix broken code that was meant to turn the
'interrupts'/'interrupts-extended' value into a list if it wasn't.
list(123) will error out instead of creating [123].
- Remove weird .split('/') on macro name
- Rename 'props' to 'vals'. It's the value of a single property.
- Get rid of a bare 'except:'
- Rename l_fqn to full_name. Accidentally stumbled upon 'fqn' probably
standing for "fully qualified name", but it's not obvious.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
- Have get_parent_path() return None for the root ('/'). This is handy
when looping over path components.
- Move _find_parent_irq_node() out of the class, call it
parent_irq_node(), and use get_parent_path() in it.
- Add a global err() function for reporting errors. Use it if a node
unexpectedly has no interrupt-parent.
Previously, this would give a Python error instead.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
CONFIG_WDT_SAM_DISABLE_AT_BOOT was removed in commit 2e01e86bdc
("drivers: watchdog: wdt_sam: use the generic disable option"), but some
comments still talked about it. Replace it with
CONFIG_WDT_DISABLE_AT_BOOT.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This is a revert of 45a4fbf2ae and
this commit removes the offending function references from
Networking chapter in 1.14 release note. After the BSD socket
documentation adds the function references we can revisit the
release note and add back the function references.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Refactors the apds9960 sensor driver to get the i2c device name, i2c
device address, gpio device name, and gpio pin from a constant device
configuration structure, rather than using hardcoded macros. This will
make it easier to change the names of the macros and to instantiate
multiple instances of the driver.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Fixes the apds9960 i2c address on the reel_board. Found while converting
the apds9960 driver to use the i2c address from device tree rather than
a hardcoded value in apds9960.h.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Initialize a local struct variable to zero, to suppress
un-initialized variable error.
Fixes#14422.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Following upgrade of newlib version in SDK 0.10.0,
time_t changed from 4 to 8 bytes structure.
As a consequence, ts requires a cast to u32_t before conversion
to us to avoid overflow.
Additionally, add a comment on RTC init value and
fix a minor alignment issue.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The current flash configurations for all nRF52840's in Zephyr is
VERY constrained when it comes to allowing samples any space for
storage or custom areas. It only leaves the last 4 pages of flash
for "storage".
The nRF52840 is also capable of using OpenThread which defaults
to using the last 4 pages of flash for storing OpenThread-related
network data.
This means that while using OpenThread under any configuration
designed to use mcuboot partition slots, there is no space left
over for storage of any kind.
Let's adjust the partition table to set storage at 8 pages of
flash (32k). This fixes the conflict with OpenThread and leaves
room for future use cases that may arise.
Signed-off-by: Michael Scott <mike@foundries.io>
The clang ARM assembler is a bit stricter than GNU as. Change mov to
movs for ARMv6 case of z_arch_switch_to_main_thread.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
It was possible to freeze the application by pressing the user button
too frequently. This was likely due to the stack not keeping up with
the send requests and running out of buffers.
Add rate-limiting to the app, so that at most one message per 500ms
can be sent. Also add a user message if the user presses the button
too many times in rapid succession, and inform the other badges of
this misbehaving user.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Updated to add support for CS. DT config names updated
to adhere to the DTS naming convention. Init and SPI
configuration now follows the device datasheet.
Signed-off-by: Henrik Malvik Halvorsen <henrik.halvorsen@nordicsemi.no>
Appears within an 'if UART_MCUMGR'.
'if FOO' is just shorthand for adding 'depends on FOO' to each item
within the 'if'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This moves BTP specification from Zephyr so that it's accessible for
all projects.
Related auto-pts PR: https://github.com/intel/auto-pts/pull/244
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The old defines make the Shippable tests fail. Convert the fixing
ups for fxos8700 to use new defines introduced in #12491.
Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
It is also possible to use 'west' to build the 'hello_world' sample
application for the UP2 (up_squared) board. This patch makes it
explicit in the documentation.
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Zephyr modules' Kconfig entries appear in a seemingly random spot
in menuconfig. This patch moves those entries at the top of the menu,
to improve their visibility and make their location predictable.
Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
To save binary size, currently just returns textual name of error
code, e.g. EAI_FAIL -> "EAI_FAIL". Based on real usecases, can be
replaced with user-friendly message later. (Current usecase is to
allow/help to elaborate sockets API by proof-of-concept porting
existing socket apps).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>