Features:
- Uses the SPI bus to communicate with the card
- Detects and safely rejects SDSC (<= 2 GiB) cards
- Uses the optional CRC support for data integrity
- Retries resumable errors like CRC failure or temporary IO failure
- Works well with ELMFAT
- When used on a device with a FIFO or DMA, achieves >= 310 KiB/s on a
4 MHz bus
Tested on a mix of SanDisk, Samsung, 4V, and ADATA cards from 4 GiB to
32 GiB.
Signed-off-by: Michael Hope <mlhx@google.com>
Used as a checksum on command messages when talking with MMC cards.
Implemented using the unwound bytewise implementation from
https://en.wikipedia.org/wiki/Computation_of_cyclic_redundancy_checks
which is a good mix of size and speed.
The API and naming matches lib/crc7.c in Linux.
Signed-off-by: Michael Hope <mlhx@google.com>
This fixes intercompatibility issues with controllers supporting
privacy feature.
Core Spec requires to use network privacy mode as a default when
peer device provides its IRK during bonding when LL Privacy is used,
which is the case for Zephyr. We've seen devices including PTS
which exchanges it's IRK but is not aware about network privacy
mode. This results in Zephyr not able do be reconnect to such bonded
devices.
This workaround sets device privacy mode to be able to reconnect
to such devices.
Fixes#4989Fixes#5486
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The Linux Foundation has been assigned a Company Identifier, and with it
a means of identifying Zephyr over the air. Default to the LF Company
Identifier, which can be overridden by silicon vendors.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Logic for sending chunks of data is incompatible with adding
Content-Length: header.
Per https://tools.ietf.org/html/rfc7230#section-3.3.1:
"A sender MUST NOT send a Content-Length header field in any
message that contains a Transfer-Encoding header field."
Going a bit further in my mind: also don't send Transfer-Encoded
chunked data either when the Content-Length header is present.
In general, there will be problems if the http client library
makes payload changes without the user code knowing about it.
This patch removes the use of http_send_chunk() from the new
HTTP client code and instead sends the payload directly to
http_prepare_and_send()
This fixes an issue where every available buffer would be allocated
with repeating payload data because the for loop in http_request()
wasn't ending until we ran out of memory.
NOTE: This patch was previously applied but was lost when
commit d1675bf3e6 ("net: http: Remove the old legacy API")
moved code around.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
It's added in subsys/net/lib/http/http_client.c:http_request():95
after adding the protocol header. If we add 2 CRLF it ends the
header block and causes an HTTP error.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
In commit 9489fa54cc ("net: http: Fix http_prepare_and_send"),
the logic for when to call http_send_flush() was incorrect. This
is causing a call to http_send_flush() every time
http_prepare_and_send() is called.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
We should not use the user suppied timeout setting in
http_client_send_req() for the connection timeout. In the
previous API the call to tcp_connect() used
CONFIG_HTTP_CLIENT_NETWORK_TIMEOUT as the timeout setting.
Let's do that here too.
This fixes -ETIMEDOUT error generation when using K_NO_WAIT
for http_client_send_req().
NOTE: This patch was previously applied but was lost when
commit d1675bf3e6 ("net: http: Remove the old legacy API")
moved code around.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
In previous version of the HTTP API, commit 8ebaf29927 ("net: http:
dont timeout on HTTP requests w/o body") fixed handling of HTTP
responses without body content.
For the new API, let's add a specific fix for when PUT/POST requests
are responded to with just the status code.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Initially this sample was intended to be very simple and schematic,
but as this sample going to become a base for stream API conversion,
time to handle all the edge conditions.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Fixed the controller implementation for the missing advDelay
for connectable directed advertising events used in a low
duty cycle mode.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add HCI error code definitions based on the Bluetooth 5.0 specification.
That allows for example that disconnection reasons can be checked
against the constants.
Signed-off-by: Johannes Hutter <johannes.5494@gmail.com>
This fixes a bug in the cdc_ecm Ethernet over USB driver. The ECM
spec (section 3.3.1) says that the end of an Ethernet frame is marked
using the USB short packet mechanisim, where the last packet is less
than the maximum packet size. If the Ethernet frame is a multiple of
the USB maximum packet size then a final zero length packet must be
sent.
Linux however sends a one byte packet (usbnet.c:1393) to work
around hardware issues with zero length packets.
The current Zephyr driver works most of the time except when you send
an Ethernet frame of the right length where the last byte is zero,
such as:
$ ping 192.0.2.1 -s 23 -p 0
Zephyr then drops the last byte, creating a short frame which gets
dropped higher up in the stack.
Signed-off-by: Michael Hope <mlhx@google.com>
This commit fixes the crash of echo server from unsolicited RA with
reachable time set to 2147483648. The crash was in
net_if_ipv6_calc_reachable_time because such large value resulted in
modulus by zero due to integer overflow.
Fixes#6382
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
Use ccache when building OpenThread. When the cache is warm, I was
able to observe that this patch sped up a clean build from 45 seconds
to 33 seconds.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Moving the ccache build script earlier in allows us to export ccache
to external projects. Using ccache with external projects, such as
OpenThread, can significantly speed up the build time.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Assertions should only be used to check invariants. Things that may
change value in runtime are better left to proper checks.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Assertions should only be used to check invariants. Things that may
change value in runtime are better left to proper checks.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Assertions should only be used to check invariants. Things that may
change value in runtime are better left to proper checks.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Assertions should only be used to check invariants. Things that may
change value in runtime are better left to proper checks.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Assertions should only be used to check invariants. Things that may
change value in runtime are better left to proper checks.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Assertions should only be used to check invariants. Things that may
change value in runtime are better left to proper checks.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This doesn't appear to be used by anything in Zephyr. Remove it,
as it doesn't perform correct bounds checking.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
If net_icmpv6_get_na_hdr() returns NULL (which is possible with a
specially crafted packet), utility functions net_is_solicited(),
net_is_router(), and net_is_override() will attempt to read invalid
memory.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Assertions should only be used to check invariants. Things that may
change value in runtime are better left to proper checks.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Assertions should only be used to check invariants. Things that may
change value in runtime are better left to proper checks.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
During system initialization, the global static variable (to
mem_domain.c) is initialized with the number of maximum partitions per
domain. This variable is of u8_t type.
Assertions throughout the code will check ranges and test for overflow
by relying on implicit type conversion.
Use an u8_t instead of u32_t to avoid doubts. Also, reorder the
k_mem_partition struct to remove the alignment hole created by reducing
sizeof(num_partitions).
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Multiple partitions can be added to a domain, and if they overlap, they
can have different attributes. The previous check would only check for
W^X for individual partitions, and this is insufficient. Overlapping
partitions could have W^X attributes, but in the end, a memory region
would be writable and executable.
The way this is performed is quite "heavyweight", as it is implemented
in a O(n^2) operation. The number of partitions per domain is small on
most devices, so this isn't an issue. CONFIG_EXECUTE_XOR_WRITE is
still an optional feature.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
This patch does following:-
1. Default scheduling policy should be set to SCHED_RR only when
Preemptive is enabled.
2. Default priority in attr object should equivalent to
K_LOWEST_APPLICATION_THREAD_PRIO. Posix priority corresponding
to K_LOWEST_APPLICATION_THREAD_PRIO is 1.
Signed-off-by: Youvedeep Singh <youvedeep.singh@intel.com>
We assumed that ${BOARD} and ${BOARD_FAMILY} are always the same and
thus interchangeable. That isn't always the case so use ${BOARD} proper
for when we mean the exact BOARD name we are building for vs the
BOARD_FAMILY.
We also add .dts files for board variants within a board family, such
that we have a .dts matching each board name.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
In ARMv7-M (and ARMv8-M) architecture it is
implementation defined whether separate MMFAR and BFAR are
implemented. This commit ensures that we always get the true
faulting address displayed in case of MemManage- or BusFault.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Move common SoC dts.fixup defines into arch/arm/soc/<SOC>/dts.fixup so
we remove duplication in the boards and only have board specific
defines in boards/arm/<FOO>/dts.fixup.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move common SoC dts.fixup defines into arch/x86/soc/atom/dts.fixup so we
remove duplication in the boards and only have board specific defines in
boards/x86/<FOO>/dts.fixup.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move common SoC dts.fixup defines into arch/x86/soc/ia32/dts.fixup so we
remove duplication in the boards and only have board specific defines in
boards/x86/<FOO>/dts.fixup.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move common SoC dts.fixup defines into
arch/x86/soc/intel_quark/quark_se/dts.fixup so we remove duplication in
the boards and only have board specific defines in
boards/x86/<FOO>/dts.fixup.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move common SoC dts.fixup defines into
arch/arc/soc/quark_se_c1000_ss/dts.fixup so we remove duplication in the
boards and only have board specific defines in
boards/arc/<FOO>/dts.fixup.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Initially this sample was intended to be very simple and schematic,
but as this sample going to become a base for stream API conversion,
time to handle all the edge conditions.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
In order to address anomalies 102, 106 and 107 in nRF52, add a generic
hal_radio_reset() that does additional processing when required by a
particular IC or IC family. Implement the fix for the nRF52.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>