Let allow users to select the revision B of the chip on the SAM E70
Xplained Board. The same board exists with SoC revision A or B.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
The revision A and B of the chip are very close, so most of the code
will work if the wrong revision is selected. To avoid that, check that
the selected HAL and the chip CIDR match. Otherwise emit a warning
in the logs.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This patch adds support for the revision B of the SAM E70 SoC. It adds
all the rev B part numbers, and when users pick-up one of those part
numbers, the revision B HAL is used instead.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This is an import of Atmel SAM E70 HAL version 2.3.98, for the revision
B of the chip. The files have been passed through dos2unix to minimize
the differences with the revision A which seems to also have been
imported that way.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
At the moment there are two images for Nucleo-64 STM32 family board
connectors (img/nucleo_xxxxxx_connectors.png).
The images have the same canvas size (800x619) but different file
size in bytes and different color coding.
The first one (192K, 8-bit colormap) is used for
* nucleo_f070rb
* nucleo_f091rc
* nucleo_f103rb
* nucleo_l053r8
* nucleo_l073rz
The second one (464K, 8-bit/color RGBA) is used for
* nucleo_f030r8
* nucleo_f302r8
* nucleo_f334r8
Applying simultaneous black/white threshold to the images and
comparing them with imagemagick tools shows that the images
have no significant difference. Therefore we can use
nucleo_l073rz_connectors.png for nucleo_f030r8, nucleo_f302r8
and nucleo_f334r8.
Please see https://github.com/zephyrproject-rtos/zephyr/pull/15926
for details.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Add a sample application for showcasing the functionality of the
Holtek HT16K33 LED driver with keyscan functionality.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
The HT16K33 is a memory mapping, multifunction LED controller
driver. The controller supports up to 128 LEDs (up to 16 rows and 8
commons) and matrix key scan circuit of up to 13x3 keys.
This commit adds support for the keyscan functionality of the HT16K33.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Allow a device tree node to be child on one bus and parent on another
bus (e.g. an I2C slave device with multiple sub-devices).
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
The HT16K33 is a memory mapping, multifunction LED controller
driver. The controller supports up to 128 LEDs (up to 16 rows and 8
commons) and matrix key scan circuit of up to 13x3 keys.
This commit add support for the LED driver functionality of the
HT16K33.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Unfortunately, Zephyr SDK 0.10.0 ships with outdate Newlib 2.0.0
(from 2015 or earlier) which lacks sys/_timeval.h header, requiring
ugly workaround of defining struct timeval inline (the whole idea
was to standardize on sys/_timeval.h header for different libc's).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
According to POSIX, that's the header which defines this function.
Similarly, nothing in POSIX indicates that <time.h> should have
access to struct timeval, so it's removed (it's made accessible
to <sys/time.h> via <sys/_timeval.h> introduced earlier).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
This is implementation-level header which defines struct timeval, and
intended to be included by headers which need this structure. This
implementation scheme is compatible with Newlib, and thus provides a
step to use minlibc vs Newlib interchangeably.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Move PROPERTY_LINKER_SCRIPT_DEFINES to toolchain_ld_base.
No functional change expected.
This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting non-intrusive porting to other (commercial) toolchains.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
gpio-map is a property of "nexus node", defined in dts v0.3.
It allows to describe a pin connector so it can be referenced
through phandles and hence used in expansion device nodes like a
shield header (typically implemented through overlays).
This change implements gpio controller resolution through these maps.
Few assumptions were taken in order to simplify the implementation.
These assumptions bring some limitations to the use of gpio-map
but my understanding is that this should still allow to cover most
use cases.
Assumptions:
-gpio-size is the same for all gpio-controllers referenced in a map
-optional properties gpio-map-mask and gpio-map-pass-thru are
supposed to be omitted
The understanding of this last assumption is that flags provided in
the expansion device node will overwrite the connector flags.
In a latter stage, when need happen, these limitations can be
revisited to unlock fully fledged gpio-map usage.
Fixes#15637
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Some applications using DMA, such as UART RX, could
need to complete the current DMA transaction earlier than
predefined, based on other termination conditions,
like UART's IDLE interrupts.
In that case, the client needs to know how many data are
still left in DMA transfer buffer so that it can figure
out how many data has been transfered. However, the current
DMA API doesn't provide any information for the client
to learn the transfer buffer information.
And some other information, like whether DMA transfer is busy
or not, transfer direction, etc, could interest a client.
So, added a dma API function to retrieve the current DMA
runtime status.
And implemented the API for STM32F4's DMA while keeping
others unimplemented.
Signed-off-by: Jun Li <jun.r.li@intel.com>
reload function is not implemented by every DMA driver.
So, add api's NULL check to make sure it is protected if not
implemented.
Signed-off-by: Jun Li <jun.r.li@intel.com>
It is convenient to have a blocking version of
`mqtt_read_publish_payload` function, for cases when it is called from
the event handler. Therefore, extend the 'mqtt_read_publish_payload'
argument list with information whether the call should block or not.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
The ARM Cortex-M Exception Stack Frame (ESF) may consist of
several stack frame contexts (basic state context, additional
state context, FP context, etc.). To reflect these structural
properties, this commit re-factors the ESF, splitting out the
basic stack frame, holding the state context, into its own
struct container. The commit does not introduce behavioral
changes.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
If the local node keeps getting bombarded with messages, it's possible
that the storage timer gets rescheduled over and over again and never
expires. Add the necessary code to only reschedule the timer if the
new deadline is earlier than an existing one.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The default values for the timeouts, as well as non-defaults in most
Mesh samples, use a higher value for the RPL than then generic mesh
storage timeout. This hasn't had any effect in practice since the code
only uses the RPL timeout if it is *smaller* than the generic one.
The original intention of the code was to use the RPL timeout,
regardless of what the generic one is, whenever the RPL is the only
thing that needs updating. Add some helper macros to track the various
groups of pending flags, and perform the appropriate checks to apply
the RPL timeout whenever it's smaller than the generic timeout, or if
there are no other items to store besides the RPL.
Fixes#15904
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
When run as "west -v build", make sure that the underlying build tool
is run in verbose mode as well (if the generator is known to support
it, which is the case for Unix Makefiles and Ninja based generators).
The per-generator hacks here are needed to support CMake 3.13. If we
move to CMake 3.14 or later, we can just run "cmake --build BUILD -v"
and be done with it.
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
Fixed format error when compiling with gcc and newlib.
Used standard formats (%u) instead of inttypes formats (PRIxxx)
since Zephyr redefines the standard formats, that way it should always
be in line with the Zephyr types.
Compiled with and without newlib using gcc.
Signed-off-by: Dennis Wildmark <dennis.wildmark@assaabloy.com>
This adds interrupt support to the SAM0 GPIO driver. This is heavily
inspired by @nzmichaelh work in #5715. The primary difference
from that implementation is that here the External Interrupt
Controller (EIC) is separated out into an interrupt controller driver
that is less tightly coupled to the GPIO API. Instead it implements
more of a conversion from the EIC's own odd multiplexing to a more
traditional port and pin mask IRQ-like callback. Unfortunately,
through the EIC on the SAMD2x are relatively well behaved
in terms of pin to EIC line mappings, other chips that share the
peripheral interface are not. So the EIC driver implements a
per-line lookup to the pin and port pair using definitions extracted
from the ASF headers.
The EIC driver still makes some assumptions about how it will be used:
mostly it assumes exactly one callback per port. This should be fine
as the only intended user is the GPIO driver itself.
This has been tested with some simple programs and with
tests/drivers/gpio/gpio_basic_api on a SAMD21 breakout and an
adafruit_trinket_m0 board.
Signed-off-by: Derek Hageman <hageman@inthat.cloud>
This adds a SERCOM I2C driver for SAM0 series chips.
Tested with a SAMD21 chip on a SSD1306 display and a MLX90393
sensor. Only compile tested for SAMD20 and SAMR21.
Signed-off-by: Derek Hageman <hageman@inthat.cloud>
This adds generic support for any board using the SAM0 ADC driver.
The test selects the internal input from the scaled I/O voltage,
which is always available on the ADC.
Signed-off-by: Derek Hageman <hageman@inthat.cloud>
It is possible that the device driver API pointer is null.
For example if the device driver returns an error, the device
code will make the API pointer NULL so that the API would not
be used. This can cause errors in networking code where we
typically do not check the NULL value.
Fixes#15003
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
- renaming functions to better names
- reordering functions place (register, then unregister for instance)
- centralizing logs to relevant place
Fixes#8722
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Also, there is no need for unspecified address bit. If specified address
bit is not set, then it will be obvious address is unspecified. Reducing
the amount of bits from 6 to 4.
This permits to reduce net_conn structure of 4 bytes. Its size is as
before indroducing node attribute.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This will optimize path when unused an connection is required or when
looking up a used one.
That said, at this stage, it bloats up the net_conn structure with 4
added bytes. More optimization will overcome this drawback.
Fixes#8722
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Most of present #ifdef can be removed via using IS_ENABLED() macro.
Only small part of cache related logic still require #ifdef.
Fixes#8722
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
There were various flaws in it that motivated its removal:
- No hash collision handling mechanism. In case that would happen, the
behavior of the network connection would be unknown. This is the main
drawback
- The lookup is not that much more efficient than the default one. The
only difference of gain is in connection comparison (a u32t comparison
vs a full connection compare). But the list handling is the same. It's
made worse by the presence of a negatives match array which can be
easily filled in and becomes then fully usless, appart from consuming
CPU. As well as adding a new connection: it requires the whole cache
to be cleared which is unefficient.
- Not memory efficient, even compared to a proper hash table.
Two arrays instead of one etc...
All of this could be fixed by using a proper hash table, though it
remains to be seen if such object could fit in Zephyr core.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
During net_pkt/net_context API changes, some ip handling blocks were
ordered ipv4 first, ipv6 second. While it is the contrary everywhere
else. So reordering to get things consistent.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
- Not all #ifdef can be removed: those which have a dedicated attribute
in struct net_context.
- For CONFIG_NET_CONTEXT_CHECK: switching the NET_ASSERT_INFO to
NET_DBG (simpler to read and anyway an error code is returned)
Fixes#8725
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
It will help to use IS_ENABLED in place of #ifdef in relevant place.
Only struct net_if uses this structure.
In case only IPv4 is used, it will bloat up this struct by 12 bytes.
There are few reasons why this is "ok" in this case:
- On limited rom/ram system it will be unlikely to find a lot of
network interfaces so it should not harm much to raise the size of
struct net_addr.
- If IPv4 is the only enabled IP version, it gains a good amount of
rom/ram to discard IPv6 support so it is fine to steal a bit of this
gain to bloat up a bit struct net_addr.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Thit will help removing usage of #if defined(CONFIG_NET_OFFLOAD) in
relevant places.
Note that static inlines are used instead of #define foo(...), to keep
the parameter check at build time.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Partially revert commit ea177e785c
("usb: dfu: set bwPollTimeout dynamically")
Introduced fix does not work proper because there is no way to be
sure that a control stage had success before start erase process.
Instead IMG_ERASE_PROGRESSIVELY configuration should be used
if the erase of the flash takes longer time.
resolves: #15497
Signed-off-by: Johann Fischer <j.fischer@phytec.de>