Let's make the nrf rtc kconfig depend on the SOC_COMPATIBLE
options which are set both by the real and simulated targets
so the configuration matches in both cases.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
_k_neg_eagain is there for used in assembly where including
errno.h is not possible. However, the usage in ARM was simply
to assign value to swap_return_value in a C file, which is
no need to use _k_neg_eagain as errno.h can be included.
So change that to use -EAGAIN directly. Saves 4 bytes in
built binaries in rodata.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This fixes an issue where the DFU client could get stuck trying to
transmit a message to servers if the DFU client was misconfigured, for
instance missing application key or network key.
Signed-off-by: Ludvig Jordet <ludvig.jordet@nordicsemi.no>
The call to bt_micp_mic_ctlr_mute_get function will return the value of
mute state in bt_micp_mic_ctlr_cb.mute callback. This fixes invalid
function calls by storing the recent mute state value in the
application.
Fixes: MICP/CL/SPE/BI-01-C
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
If instantiated models don't have any relations at all, then the
extensions list will be empty. We should allow to disable it at all
to not waste RAM.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
The test delegates putting the server socket into listening (i. e.
calling listen() on the socket) to a separate thread, which did have a
chance to run before client attempted to establish TCP connection.
This was not visible before, as we did not reply with RST to a
connection attempt on a closed port, so the connection was eventually
establish after SYN retransmission. But as we do reject such a
connection now with RST, the connection attempt failed. Therefore, a
small delay was added after spawning the server thread, to give it a
chance to configure the server socket.
Additionally, lower the CONFIG_NET_TCP_TIME_WAIT_DELAY value so that TCP
contexts are released earlier, and add a respective delay in the test
teardown function. Not doing so also triggered unneeded SYN
retransmissions, as there were no enough TCP context to accept the
incoming connection, before freeing the resources allocated for the
previous one.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add Kconfig option to control TCP RST behavior on connection attempts on
unbound ports. If enabled, TCP stack will reply with RST packet (enabled
by default).
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Send RST as a reply for unexpected TCP packets in the following
scenarios:
1) Unexpected ACK value received during handshake (connection still open
on the peer side),
2) Unexpected data packet on a listening port (accepted connection
closed),
3) SYN received on a closed port.
This allows the other end to detect that the connection is no longer
valid (for example due to reboot) and release the resources.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Add a helper function which allows to send a RST packet in response to
an unexpected TCP packet, w/o associated connection or net context.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This contribution addresses the support for various types of modems in
gsm driver. As some 4G modems have failed to return correct output
from AT+CREG?, so AT+CEREG? is the right AT command in such situation.
This commit provides the possibility for user to select one type of
AT command. This PR fixes zephyrproject-rtos#63917
Signed-off-by: Tahir Akram <mtahirbutt@hotmail.com>
This patch contains small refactor of lpsram init function (defines
registers and adds new macro).
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
As composite operations don't have path in CoAP packet,
it wrongly triggered a check for security object and got
denied the access.
Fixes#64012
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When objects are initialized, empty strings should be set to length of
zero, instead of length of the full buffer.
So use INIT_OBJ_RES_DATA_LEN() to give both, the buffer size and data
length.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
When resource instances are initialized, we must calculate
beginning of the data buffer using the index and maximum
data length. Otherwise buffers would overlap with previous.
Fixes#64011
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
As the lwm2m_registry.c and specificly lwm2m_set()
functions already ensure null-terminator on string and
count that into string lenght, the content type handlers
should do the same.
When string is written, strlen()+1 is the data length.
When string is read, use the data length, so we don't
leak uninitialized strings. If buffer overrun have
removed the null-terminator the strlen() migh be larger
than data_len.
Signed-off-by: Seppo Takalo <seppo.takalo@nordicsemi.no>
The Kconfig option HAS_PM, which must be needed for SoCs providing PM
hooks, is missing in npcx4.
This commit adds it to soc/arm/nuvoton_npcx/npcx4/Kconfig.series.
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Since there are multiple static analysis tools being used
now, it is better to change references for a particular one
and just point to static analysis section in the documentation.
JIRA is no longer used for tracking security issues. Update it
to Github.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Add a test for the broadcast sink that uses the BAP
Scan Delegator functionality with a Broadcast Assistant
device adding the broadcast source.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
If a receive state is removed, then the bis_syn_req callback
will be called with 0x00000000, to indicate to the application
that the sink should be desynced.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
The flag was not properly set when the broadcast sink
did not add the source (e.g. if a broadcast assistant
added it).
This also downgrades two LOG_WRN to LOG_DBG as they may
happen without indicating an issue.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add ADC support for longan nano.
Tested using samples/drivers/adc. Also added longan_nano.overlay
and updated documentation.
Signed-off-by: Maxin John <maxin.john@gmail.com>
Cleanup of script and change how we assign PR in general:
Make sure that when multiple areas are changed, including platform or
driver changes, we set assignee of the general areas and not the
platform maintainers. For example, if I change 100 SoC files and touch
the kernel file, the assignee is set to the kernel maintainer.
First, we should as much possible try and split such changes and not
have common area changes with platform changes at the same time. Second,
it is important that such changes which affect everyone are reviewed and
approved by the maintainer of the general areas rather than leave them
to the platform maintainer.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Resend the request with Echo option and the received Echo
option value when receiving a 4.01 (Unauthorized) response
with the Echo option.
Add missing header file kernel.h to coap_client.h.
Signed-off-by: Juha Ylinen <juha.ylinen@nordicsemi.no>
The exclusive load/store instructions don't work well when MMU and cache
are disabled on some cores e.g. Cortex-A72. Change it to voting lock[1]
to select the primary core when multi-cores boot simultaneously.
The voting lock has reasonable but minimal requirements on the memory
system.
[1] https://www.kernel.org/doc/html/next/arch/arm/vlocks.html
Signed-off-by: Jaxson Han <jaxson.han@arm.com>
When the BLOB server is in Pull mode and all chunks were received for
the current block, and the current block is the last block, then
according to section 5.2.4 of MshMBTv1.0 the server should stop sending
BLOB Partial Block Report messages if it determines that the client
knows that the transfer is complete:
```
While the Pull BLOB State Machine is in the All Chunks Received state,
the Pull BLOB State Machine continues to send the BLOB Partial Block
Report messages until one of the following happens:
• The Receive BLOB Timeout timer expires.
• If the current block is not the last block, then the client starts a
new block, in which case a new Pull BLOB State Machine is instantiated.
• If the current block is the last block, then the server determines
that the client knows the transfer is complete. For example, a
higher-layer model may indicate that the client considers the transfer
complete.
```
We currently don't have any OOB mean (for example, API) to determine
whether the client knows that the transfer is complete. We also need to
keep in mind that the Partial Block Report message can get lost so one
transmission may not be enough. The client could immediately send BLOB
Transfer Get message to get the transfer status, but this goes against
its state machine defined in section 6.2.4.2, where a Block transmission
completes when a BLOB Partial Block Report message is received with an
empty list of requested chunks (table 6.4, figure 6.1).
Because of this, we need to keep sending Partial Block Report messages.
We can keep sending them at least until Block Report timer expires.
If the client sends BLOB Transfer Get message, then it finished with
sending the block and we can change the phase and finish the transfer.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
PTS uses BLOB server model instantiated by DFD server for MBT tests as
it is the first BLOB server model in the device composition data. DFU
server, which also has BLOB server model, is instantiated after DFD
server.
Signed-off-by: Pavel Vasilyev <pavel.vasilyev@nordicsemi.no>
"const k_tid_t" is "struct k_thread * const" and not
"const struct k_thread *" as the code may be assuming. Just
drop it.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This provides custom memory range check functions as
it gets a bit complicated with cached/uncached regions.
These functions are marked as __weak so SoC or board
can override these if needed.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Sometimes the generic address range checker is not adequate
(think Xtensa cached/uncached pointers). This provides a way
to implement custom memory range checkers for those
situations. When enabled, sys_mm_is_phys_addr_in_range()
and sys_mm_is_virt_addr_in_range() must be implemented.
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
The stack size was previously hardcoded in the source code, making it
difficult to change when enabling options that require a larger stack.
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
According to IEEE Std 802.1AS-2011 11.3.3, gPTP messages are not
VLAN-tagged.
Remove the use of VLAN headers for gPTP messages on the TX path.
The RX path is handled by the drivers. The network drivers in Zephyr
might need to be updated as well in order to accept receiving
non-VLAN-tagged gPTP messages when the CONFIG_NET_VLAN option is
selected.
Continue sending gPTP packets with VLAN tags when CONFIG_NET_GPTP_VLAN
is enabled. Specify that this option is for testing purposes.
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
The previous implementation was setting priority 3 (Critical
applications) for Sync, Pdelay and Pdelay_Resp messages; and priority 6
(Internetwork control) for the other PTP messages. This might have been
done under the incorrect understanding that "Critical applications" was
the highest priority.
This resulted in the Pdelay_Resp_Follow_Up getting sent before the
Pdelay_Resp message when enough TC_TX queues were being used
(NET_TC_TX_COUNT >= 2), which is an inversion compared to the intended
order.
Invert the priority of the outgoing PTP packets so that the PTP event
messages are sent with higher priority, as was originally intended.
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
The priority 3 (Critical applications) was incorrectly marked as
"highest priority", which might have led to incorrect use of
NET_PRIORITY_CA in some cases.
Note that this is already correctly advertized in other places, as it
was partially fixed in af8a0b1a5d.
NET_TC_SKIP_FOR_HIGH_PRIO was previously only allowing to push priority
3 (Critical applications) packets directly to the driver, but not the
ones with a higher priority. Change it so that it is now in effect for
priority 3 and above.
Signed-off-by: Ambroise Vincent <ambroise.vincent@arm.com>
PTS requires IUT to send requests with page number with
0xFF or the highest supported page number in order to
retrieve all the composition data pages from the lower
tester.
This commit add the page number to the response, thus
the upper tester can follow the last page number and
send the next page request until page 0 is requested.
Signed-off-by: Alperen Şener <alperen.sener@nordicsemi.no>
I have seen the CI hang (both downstream and upstream) as the executable
doesn't always respond to the SIGTERM sent by `timeout`.
This will prevent that behavior. 5 whole seconds ought to be enough to
clean-up a small program.
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
Adds Bsim test that verifies private beacon cache functionality.
The test checks that replays of the same private beacon
message is discarded.
Signed-off-by: Anders Storrø <anders.storro@nordicsemi.no>