Simplify use of property values that have multiple elements by
providing all of them in an initializer list, in addition to each one
as an enumerated value.
For example if a driver requires a sequence of operations with
instance-specific delays between stages the durations can be specified
with:
delays = <30000 20 45000>;
and the driver can use:
static u32_t delays[] = DT_INST_0_COMPAT_DELAYS;
rather than enumerating the instances. This is particularly useful
when the number of entries in the array varies per instance, in which
case such an initialization is not easily expressed in code.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Remove ifdef guard around inclusion of nrf_clock_control.h in bluetooth
controller as the defines in this header are needed anyway.
Signed-off-by: Solveig Fure <solveig.fure@nordicsemi.no>
Add bindings for Nordic nRF family peripherals:
- IPC (Interprocessor Communication)
- RNG (Random Number Generator)
Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Add a common definition for NUM_IRQS in arch/arm/core/Kconfig and
arch/riscv/Kconfig. That way, the type doesn't have to be given for
NUM_IRQS in all the Kconfig.defconfig files.
Trying to get rid of unnecessary "full" symbol definitions in
Kconfig.defconfig files, to make the organization clearer. It can also
help with finding unused symbols.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
User could telnet to zephyr only once and the second connection
was denied. The reason was that the telnet socket was not properly
marked as accepting a new connection.
Fixes#20042
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Quit the accept loop if there is a socket related error as there
is no point of continuing in this case.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In order to avoid net_pkt ref count going to <0, do not unref
the packet if it was not sent in the first place. This can happen
if the connection was closed while we are waiting packets to be sent.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Do not print warning if transitioning from LISTEN -> CLOSED which
happens when the socket is closed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The initial state from CLOSED -> ESTABLISHED caused error
to be printed by state validator. This is unnecessary, so add
this as a valid state to validator.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Handle this corner case with TCP connection closing:
1) Client A connects, it is accepted and can send data to us
2) Client B connects, the application needs to call accept()
before we will receive any data from client A to the application.
The app has not yet called accept() at this point (for
whatever reason).
3) Client B then disconnects and we receive FIN. The connection
cleanup is a bit tricky as the client is in half-connected state
meaning that the connection is in established state but the
accept_q in socket queue contains still data which needs to be
cleared.
4) Client A then disconnects, all data is sent etc
The above was not working correctly as the system did not handle the
step 3) properly. The client B was accepted in the application even
if the connection was closing.
After this commit, the commit called "net: tcp: Accept connections
only in LISTENING state" and related other commits are no longer
needed and are reverted.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add CONFIG_NET_TCP_AUTO_ACCEPT option which can be used to
automatically accept incoming data connection even if the
application has not yet called accept(). This can speed up
data transfer from peer to the application.
Problem with this is that if the peer sends lot of data and
we have limited amount of net_buf's available, then we can
run out of them which is very bad situation and can lead to
deadlocks. Because of this, the setting is turned off by default.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This reverts commit d70a854904.
The next commit fixes the original issue so this commit is no
longer needed.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Otherwise, depending on the order of includes, different parts of code
may get different values for these constants.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Achieved using CONFIG_NET_CONFIG_CLOCK_SNTP_INIT option, i.e. querying
time over network using SNTP.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
With this feature enabled (via CONFIG_NET_CONFIG_CLOCK_SNTP_INIT), an
application will automagically get correct absolute time via POSIX
functions like time(), gettimeofday(), etc.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
PSK support is added to echo-client.c and echo-server.c.
If enabled, a header is included which contains the PSK.
If the default dummy PSK header is used, a warning is issued.
The header can be changed via Kconfig.
Signed-off-by: Torstein Grindvik <torstein.grindvik@nordicsemi.no>
Use the newest version of the OpenThread project, as updated in
https://github.com/zephyrproject-rtos/openthread/pull/2.
Introduce the following fixes along with the update (they're squashed to
retain bisectability of OT samples):
* Update configs and flags used
Some OT configs were renamed, some new were introduced that Zephyr port
needs to set.
* Add entropy platform driver
OpenThreads `random` platform subsystem was replaced with `entropy`
subsystem which is supposed to serve as an entropy source for the
generic OpenThread's random generator.
* Halt OT thread when OT command is processed
OpenThread can currently be processed from two threads - a
genuine OpenThread thread and shell thread, which processes CLI
commands. This could cause trouble, when context was switched
during OT command processing (i.e. switched to process an incomming OT
message, while still in unfinished command handler).
In result, it was not possible to turn the commissioner role on via
CLI, as the commissioner petition response was handled before the
Commissioner::Start function finished its execution (if the
petitioner is also the network leader, all messages are passed
internally within the stack).
Fix this by suspending the OT thread for the time of an OT command
processing.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Not a top-level zephyr core API and tied to third party environment, so
move it to where the code is in lib/updatehub.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
There are two set of code supporting x86_64: x86_64 using x32 ABI,
and x86 long mode, and this consolidates both into one x86_64
architecture and SoC supporting truly 64-bit mode.
() Removes the x86_64:x32 architecture and SoC, and replaces
them with the existing x86 long mode arch and SoC.
() Replace qemu_x86_64 with qemu_x86_long as qemu_x86_64.
() Updates samples and tests to remove reference to
qemu_x86_long.
() Renames CONFIG_X86_LONGMODE to CONFIG_X86_64.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Fix missing doxygen comment before function
which resulted in excluding it from doxygen
output.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Define FP_FPU_DA in arch/arc/Kconfig to make it always available. That
way, the Kconfig.defconfig definitions can skip the type, making them
incomplete if the base definition of the symbol disappears. That makes
the organization easier to understand and errors easier to spot.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Define CPU_EM4* and CPU_EM6 in arch/arc/Kconfig to make them always
available. That way, the Kconfig.defconfig definitions can skip the
type, making them incomplete if the base definition of the symbol
disappears. That makes the organization easier to understand and errors
easier to spot.
The help texts were taken from
https://gcc.gnu.org/onlinedocs/gcc/ARC-Options.html. Help texts for
invisible symbols can be checked in the menuconfig too if you go into
show-all mode, so they're better than adding a comment.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This samples captures frames from video capture device (in any format),
and sends them to its TCP client.
Tested with:
- mimxrt1064 + MT9M114 video sensor.
- Gstreamer 1.8.3 running on host
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Simple video sample getting frames from video capture device.
Tested with mimxrt1064_evk and MT9M114 sensor.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
This is a virtual device generating video pattern for testing
purpose. It supports colobar pattern for now.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
MT9M114 is a CMOS digital image sensor.
Implement video interface.
Only VGA (640x480) supported for now.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
This generic video API can be used to capture/output video frames.
Once a video buffer is enqueued to a video device endpoint, device owns
the buffer and can process to capture (camera), output (disk, display),
convert (hw encoder)... User can then call dequeue to retrieve
the processed buffer (video driver ensure cache coherency).
Once dequeued, video buffer is owned by user (e.g. for frame
processing, display buffer update, write to media, etc...).
For each video-buffer, user needs allocate the associated frame buffer
via video_buffer_alloc. Buffer format is defined by video device
endpoint configuration. Video device can be controlled (e.g. contrast,
brightness, flip...) via controls.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
posix_soc_if.h is meant to be a private header between
the POSIX ARCH, SOC, and maybe boards,
it should not contain definitions meant to be used directly
by the kernel or app.
Some definitions were placed here due to a dependency moebius
loop.
Unravel that by removing all header dependencies in posix_soc_if.h,
move those definitions out to a more logical place,
and while we are here reduce the amount of users of
irq_offload.h in POSIX arch related code
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
The Thingy:52 has a LIS2DH12 low-power accelerometer on the external
I2C bus. Add the necessary description to devicetree.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
The default I2C driver on Nordic platforms does not support the I2C
burst operations, so replace those calls with ones that work on the
platform.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
Reduces SPI RX buffer read overhead by a byte and further reduces the
SPI use by automatically clearing the associated receive flag RXxIF.
Signed-off-by: Nick Ward <nix.ward@gmail.com>
In order to properly remove struct tcp and its data, net_context
needs to be supplied as k_timer user data. Modify net_tcp_unref()
to take a net_context argument when removing, and add ifdefs
around code that after this will only be used by TCP testing
functionality.
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Add a net_context backpointer and receiver user data to the tcp
structure. Once the desired callback and user data is set in
net_tcp_recv(), net_context_packet_received() can be called at
TCP reception in tcp_data_get(), moving the TCP data to the
recipient. IP and TCP protocol headers are sent as NULL, they
are not used by e.g. the socket code.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Since TCP needs to be able to decide how much data is to be sent
in a TCP segment and when the segment needs to be sent, the TCP
data buffer needs to be passed down to the TCP stack. For tcp2
this causes a new function handling the data as a buffer or as an
iov to be implemented and only that function is called when
sending data out via the new TCP stack. net_tcp_send_data() is
invoked as the caller expects to be informed when the data has
been sent.
For the current stack keep the sending functions as is.
Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>