If there is some error during connection creation, just bail
out in order to avoid null pointer access.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we try to send data but the sending window is full, then
try to kick the resend of the pending data.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If there is no space in the sending window, then return -EAGAIN
so that the caller may try later.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We should have a max value for sending window so that application
is not able to use all our net_bufs for queueing packets.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The socket layer expects to receive -ENOBUFS if we do not have
any network buffers so cannot build a network message to be sent.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If there is an error, the net_context.c:context_sendto() will
free the net_pkt, so we must not do it here.
This commit fixes this error message:
<err> net_pkt: *** ERROR *** pkt 0x20421908 is freed already
(context_sendto():1672)
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Usually the out-of-memory situation will clear itself eventually,
so if that happens in TCP, then keep the connection running and
let the user to decide what to do next.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we run out of network buffers and cannot send data, and if
we have a blocking socket, then wait until new buffers are
available before returning. As this might lead to deadlock,
wait only max 10 seconds and return ENOMEM if we cannot get
buffers in a reasonable amount of time.
Fixes#28216
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of hardcoded value of 3, use the value from Kconfig file
so that user can tweak the TCP retry count.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Use SYS_SLIST_FOR_EACH_CONTAINER_SAFE() macro when searching
the connection list so that we notice if new entries are added
or removed in the list.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Instead of forcing the slist node to be first in the tcp struct,
use the pointer to node when accessing the slist. This way we
can change the ordering of fields in tcp struct.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The action is currently being aborted due to a very low value. Trying
something larger to get more operation done per day.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
* Add missing the PINMUX macros for UART5 pins.
* Correct a typo in STM32F1_PINMUX_FUNC_PC5_ADC12_IN15; the macro
used PC4 instead of PC5 for ADC12_IN15.
Signed-off-by: Paul Fagerburg <pfagerburg@google.com>
Update the CANopenNode library to latest upstream branch v1.3-master
to bring in SDO and LSS fixes.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
HAS_DTS_I2C is now selected by I2C and
always used as I2C && HAS_DTS_I2C.
It could then be purely removed.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Newer QEMU (5.1) hangs / timeouts on a number of tests on x86_64. In
debugging the issue this is related to a fix in QEMU 5.1 that
validates memory region access. QEMU has the APIC region only allowing
1 to 4 byte access. 64-bit access is treated as an error.
Change the APIC EOI access in locore.S back to just doing a 32-bit
access.
Fixes # 28453
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
If we kill qemu because of a timeout, capture this as the reason instead
of reporting the exit code.
Fixes#28040
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Align to ticks so the first iteration sleeps long enough
(k_timer_start() rounds its duration argument down, not up,
to a tick boundary)
Fixes#28319
Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
Re-structures the `bt_conn_recv()` to support more generic appending of
new ACL data. This also handles the possibility of receiving 0-length
ACL_START and ACL_CONT fragments, whilst maintaining existing
error-checking functionality.
Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
Fixes issue #26900.
A controller may fragment an L2CAP SDUs in any way it sees fit,
including fragmenting the L2CAP header. Likewise, the receiving
controller may send the fragmented header as ACL data to the host.
The Zephyr host assumed that a `BT_ACL_START` was at least 2 bytes long,
and consequently read the two-byte length field from the buffer without
length checks.
This commit allows the `BT_ACL_START` to be less than two bytes,
updating the `conn->rx_len` onces the `BT_ACL_CONT` with the remaining
part of the length field has been received.
Signed-off-by: Thomas Stenersen <thomas.stenersen@nordicsemi.no>
Fix Kconfig dependencies for enabling the controller PHY options
for LE 2M Phy and LE Coded Phy. These options should be selectable
without connections enabled when extended advertising has been enabled.
The issue affects out-of-tree controllers that wish to use the
BT_CTLR_PHY_CODED and BT_CTLR_PHY_2M options.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Select the controller feature support for data length and LE 2M PHY
based on the SoC hardware capabilities instead of relying on SoC
family.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Link roles, aka :zephyr_file: and :zephyr_raw: use a repo's git describe
information to create links but the baseurl is fixed to the upstream
repo. This breaks links created in repos that are forks located
somewhere else.
This commits tries to get the baseurl from west if available so it will
work correctly for forks. If fallbacks to the upstream repo if no
information can be gathered by West, or West is not available.
Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
osdp_build_ctx() was returning fixed NULL and the subsequent code did
not check if ctx was NULL due to osdp_build_ctx() failures. Fix both
these issues.
Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
Change how we handle the case of
CONFIG_CMSIS_V2_THREAD_DYNAMIC_MAX_COUNT=0 so that we don't create
a zero length array. Instead we can just ifdef out the code associated
with handling a dynamic stack allocation.
Fixes#28397
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit fixes the default partitioning of flash
in nrf5340 Application MCU, to comply with the nRF SPU
region boundaries. To properly align the partition start
addresses with SPU requirements we modify the start of the
slot0 and slot1 partitions. This leaves some extra space
available for MCUboot, whose size is now changed from
0xc000 to 0x10000. In addition, the non-secure partition
size (slot0_nonsecure) is decreased, and as a consequence
of that we also modify the board's .yaml file to reflect
the new image size of the non-secure version of the board.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit fixes the default partitioning of flash
in nrf9160 Cortex-M33 MCU, to comply with the nRF SPU
region boundaries. To properly align the partition start
addresses with SPU requirements we modify the start of the
slot0 and slot1 partitions. This leaves some extra space
available for MCUboot, whose size is now changed from
0xc000 to 0x10000. In addition, the non-secure partition
size (slot0_nonsecure) is decreased, and as a consequence
of that we also modify the board's .yaml file to reflect
the new image size of the non-secure version of the board.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
As discussed in #22668, there is additional risk ascociated with
splitting linker files, as one may update one script and not be
aware of the other. Especially related to updating GNU ld, and
not mwdt could break code for mwdt unnoticed, as mwdt is not
part of CI.
Let's create a single entry point for linker template.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Align multiline string definition syntax in ASSERT in linker
script. This allows to use linker script with ASSERT provided
by linker (i.e GNU toolchain) or dummy ASSERT defined as
preprocessor macros (ARC MWDT toolchain).
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
When attempting to bind a channel if it fails the code will attempt to
cleanup calling bt_iso_cleanup which expects connections of
BT_CONN_TYPE_ISO.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
ISO connection does not initialize its tx_complete_work nor it uses for
anything so calling into tx_notify will likely cause a crash.
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Commit 770f232a67 removes an array
termination from the shell_make_argv function. This function was
called from two functions: execute and tab_handle. In the mentioned
commit termination was added only in the execute function.
As a result calling tab_handle function was causing a segmentation
fault. This fix adds array termination to the tab_handle function.
Fixes#28434
Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>