Adds CLAMP macro to complement the current min/max macros, as well as a
gcc specific Z_CLAMP macro for single-evaluation expansion.
CLAMP combines the functionality of MIN and MAX, eliminating the
bug-prone usage of MIN(MAX(value, FLOOR), CEIL) found throughout the
codebase in every possible combination.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
We should clear the pvm interrupts (snoop and pcie pmon lite interrupt)
at source before handling them.
This will make sure that we do not lose any interrupts that may have
been asserted to interrupt controller during the handling routine.
Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
k_object_alloc(K_OBJ_THREAD) returns a usable struct k_thread pointer.
This pointer is 4 byte aligned. On x86 and x86_64 struct _thread_arch
has a member which requires alignment. Since this is currently not
supported k_object_alloc(K_OBJ_THREAD) now returns an error instead of
a misaligned pointer.
Signed-off-by: Maximilian Bachmann <m.bachmann@acontis.com>
The current MMU code is assuming that both kernel and threads are both
running in EL1, not supporting EL0. Extend the support to EL0 by adding
the missing attribute to mirror the access / execute permissions to EL0.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
We are probably going to do more work on the MMU side and more files
will be added. Create a new sub-directory to host all the MMU related
files.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
Add support for the recently introduced STM32CubeProgrammer runner.
Updated documentation to mention its availability as latest official
OpenOCD releases do not support H7 series.
Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
Github has deprecated add-path, so update the workflows that use it to
the new method of setting the PATH.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
There is no user USB port available on these boards.
Remove support and remove files when no more needed.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit corrects the maximum allowed amount of children to
match Thread specification.
Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
The objects should be const-qualified for consistency with other uses,
including declarations in headers.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
If the peer ACKs data when it closes the connection, update
our sequence number accordinly. The connection would eventually
be terminated but this will avoid extra resends by the peer.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
When a connection is being closed, it is possible that the application
will have a lock to net_context and TCP2 connection lock. If we then
receive a final TCP2 ACK and close the connection, the locking order
get switched and TCP2 will first try to get its own lock and then the
net_context lock. This will lead to deadlock as the locking ordering
is now mixed.
The solution is to unref the TCP connection after releasing the
connection lock. The TCP connection unref function will anyway get the
lock so no need to do double locking.
Fixes#29444
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Introduce TagoIO IoT Cloud HTTP post client example. This explorer
Zephyr network resources to demonstrate an end to end application.
The TagoIO allows that any user can test on a easy way Ethernet, WIFI
and Modem (PPP) with BSD sockets. The example provides overlays to
configure WIFI and Modem.
The application consists an a pseudo temperature sensor that sends
periodically data to TagoIO IoT Cloud platform. The data can be
visualized on a web browser dashboard, cellphone or tablet. The
steps to configure TagoIO are described on the example documentation.
Special Variables:
- CONFIG_TAGOIO_DEVICE_TOKEN DEVID token generated by TagoIO
- CONFIG_TAGOIO_HTTP_WIFI_SSID SSID when using WIFI
- CONFIG_TAGOIO_HTTP_WIFI_PSK PASSWD when using WIFI
- CONFIG_MODEM_GSM_UART_NAME UART label when using MODEM
- CONFIG_MODEM_GSM_APN APN when using MODEM
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
So far there was 100ms timeout on allocation of RX net_pkt. This is too
little for cases when lots of data are incoming on pretty
fast (e.g. 1Mbps) UART interface and application layer does not consume
received network packets fast enough. Up to now in such cases all
incoming data was processed from UART and there was no data loss when
utilizing hardware flow control. However there was high chance that data
processed from UART could not be passed further to network stack,
because of the 100ms net_pkt allocation timeout. This happens for
example when low priority application does not have enough time to run.
Increase default RX net_pkt allocation timeout from 100ms to 5s, so
there is much more time to process network packets. Such timeout should
not harm, because only a dedicated RX thread will be suspended for that
time, resulting in suspending UART traffic if hardware flow control is
supported.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
There is now a hardcoded 100ms timeout on allocating new net_pkt for
received data. Move that configuration to Kconfig, so that value can be
tuned according to application needs.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Fixes: #29758
Commit 7165b77a81 ("scripts: edtlib:
refactor for first class bindings") introduced a Binding class.
Its child_binding instance attribute has a compatible which can be
None. Adjust this behavior so the child Binding object has the same
compatible as the parent binding which ultimately has a compatible.
Without this, sanitycheck's expr_parser is doing some matching on
compatibles in child nodes that is producing unexpected results.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
The child_binding object should default to having a path and
compatible that matches the parent's. Mark it as xfail because the
compatible part is failing.
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
When building the osdsp control_panel sample we get the following
compile error:
subsys/mgmt/osdp/src/osdp_cp.c:993:10: error: implicit declaration of
function 'osdp_cp_send_command_keyset'
Fix by adding ifdef protection around the call to
osdp_cp_send_command_keyset
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
If there are enough tls_context objects in the system (configured by
CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS), but there are not enough file
descriptors (configured by CONFIG_POSIX_MAX_FDS) to create underneath
TCP/UDP socket, then TLS socket creation fails with leaked tls_context.
Call tls_release() in ztls_socket() error path whenever underneath
TCP/UDP socket creation fails.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
Enables the fat_fs sample on the mm_swiftio board by adding a
board-specific Kconfig overlay, and adding sdhc to the list of
board-supported features.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The power and chip detect gpios are optional device tree properties for
the nxp usdhc driver. Fixes a build error on the mm_swiftio board, which
does not set the power gpio property.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The filters were updated to match the 3.3.0 generated text, so update
the sphinx requirement to exclude versions that use different text.
Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
There is no reason to keep active stream socket when there was some data
loss. Mark such socket for closing and close it when all (so far)
received packets have been processed.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
According to LwM2M specfication v1.0.2, par. 5.3.2, the LwM2M client
MUST send an “Update” operation to the LwM2M Server whenever the
lifetime parameter of the Server object changes the server). The same
applies for the object instances created/deleted. The changes in objects
seem to already be handled, but the lifetime was not.
Additionally, the "Update" message shall only contain these parameters
which changed since the last update (including objects). As it's
straightforward to determine if the liftime changed but it's not easy
to tell if there were updates in the object instances, add an
additional parameter to the engine_trigger_update() function, indicating
that new object information shall be sent in the "Update" message.
Eventually add a proper error checking in `sm_send_registration` as the
function is reworked anyway.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The memset on firmware_ctx during PULL FW update initialization will
set the socket descriptor to a valid value of 0. This leads to an error
if parsing of the URI provided by the server fails, and the firware_ctx
is closed - the socket with a descriptor 0 will be accidently closed.
Fix this by invalidating the socket FD after the memset on
initialization.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The sample was producing quite a few `<log_strdup alloc failed>`
warnings when running in default configuration on qemu_x86. Increase the
log_strdup buffer count to prevent that.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add bootstrap section to the documentation, explaining how to configure
the Leshan Demo Bootstrap Server locally and run the sample.
Update the download link for the Leshan Demo Server, according to the
upstream Leshan documentation.
Fix bullet list with Leshan security parameters.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add overlay-bootstrap.conf which allows to easily configure the sample
to use the bootstrap server.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
It shouldn't be optional to handle separate response, as it's a
mandatory requirement according to the RFC7252:
"The protocol leaves the decision whether to
piggyback a response or not (i.e., send a separate response) to
the server. The client MUST be prepared to receive either."
Therefore, remove the flag as separate responses are handled now
properly.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Separate response handling implemented in the engine was faulty. The
separate response was not acknowledged by the client, resulting in
spurious retransmissions from the server side.
Also, the pending CON message was retransmitted by the client even after
it was acknowledged by an empty ACK, but the respnse haven't arrived
yet. Fix this by adding a new `acknowledged` flag to the `lwm2m_message`
structure. Once acknowledged, the flag is set and the confirmable
message is no longer retransmitted. We keep the message on the pending
list in order to timeout properly in case separate response does not
arrive in time.
Finally, prevent the reply callback from being called twice in case
the response is transmitted separately from ACk. The callback should
only be called on the actual reply, not the empty ACK.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
So far this function existed as a static function in LwM2M PULL FOTA
module. Since such functionality will be needed in other places, make it
an internal API function.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Changing .known-issues/doc should always trigger a documentation build
so add it to the filters.
Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
Sphinx==3.3.0 slightly changed the warning messages, which causes fails
on filter-known-issues. Update to the new messages.
Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
The decision to set aszmic = 1 in the net_tx structure was made after
the variable was passed to the crypto context, creating a discrepancy
between the two when aszmic is 1.
Extracts transport encryption to a separate function.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Following migration of pinctrl configuration from pinmux.c files
to device tree and deprecation of pinctrl defines, remove
pinmux.c files when possible.
Additionally remove the CMakeLists.txt files when it makes sense.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following migration of all in-tree boards to device tree bindings
for SDMMC pins configuration, deprecate SDMMC related macros.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following migration of all in-tree boards to device tree bindings
for I2S pins configuration, deprecate I2S related macros.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following migration of all in-tree boards to device tree bindings
for USB pins configuration, deprecate USB related macros.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following migration of all in-tree boards to device tree bindings
for ETH pins configuration, deprecate ETH related macros.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following migration of all in-tree boards to device tree bindings
for ADC pins configuration, deprecate ADC related macros.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following migration of all in-tree boards to device tree bindings
for SPI pins configuration, deprecate SPI related macros.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following migration of all in-tree boards to device tree bindings
for I2C pins configuration, deprecate I2C related macros.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following migration of all in-tree boards to device tree bindings
for CAN pins configuration, deprecate DAC related macros.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Following migration of all in-tree boards to device tree bindings
for serial pins configuration, deprecate CAN related macros.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>