Move to latest cmake version with many bug fixes and enhancements.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
interface/stlink-v2-1.cfg and interface/stlink-v2.cfg are wrappers
around interface/stlink.cfg, their inclusion trigger warning which
this change addresses. Besides the warning there is nothing there
except sourcing iterface/stlink.cfg directly.
Signed-off-by: Vasili Slapik <vslapik@gmail.com>
Update menuconfig and Kconfiglib to upstream revision 16539b4f223fa, to
add the commit below.
menuconfig: Prompt for save if a different .config would be saved
Previously, menuconfig.py only prompted for saving the configuration
if .config didn't exist or the user changed symbol values within the
interface.
Also make it prompt for save if Kconfig symbols have been added,
removed, or have had their defaults changed, provided it would make
the saved .config differ from the loaded one.
This usually won't matter for correctness, because loading an
outdated configuration performs an implicit olddefconfig, but it's
less confusing.
Also add a Kconfig.missing_syms attribute that records all
assignments to undefined symbols in the most recently loaded .config
file. This is needed to implement the check for whether the saved
.config would be different.
As an unrelated change, always prompt for saving if a .config has
been loaded from within the menuconfig interface. The intention is
probably often to save the configuration somewhere else, even if it
isn't modified.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
When using bt_gatt_discover with BT_GATT_DISCOVER_CHARACTERISTIC the
read callback would be set to bt_gatt_attr_read_chrc which would attempt
to access the next attribute which in this case would not be set since
the value attribute is no fetched by the discovery, the spec actually
omit the value handle saying it should always be the first attribute to
appear after the characteristic thus we can assume it to be handle + 1.
Fixes#12159
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This should make it more clearer what APIs are intended to be used with
server and client instances, in addition to that mention on the function
documentation when operation is valid only for local attributes.
Fixes#12138
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This mode allows the USB driver to use MSI clock as source clock.
MSI PLL-Mode permits +/-0,25% accuracy.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
When MSI clock is available and in PLL-Mode (high accuracy), use it as
USB source clock. This allows to enable USB on STM34l475 disco iot
board without having to add external oscillator.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
Add support for Low Speed External 32.768 kHz oscillator (LSE ).
Add support for MSI PLL-Mode offering an automatic calibration feature
in combination with the LSE. This allows the MSI to reach an accurate
+/-0,25% clock perfectly suitable for USB full-speed clock.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
When walking through the coap resources in coap_handle_request, return
-EPERM if a resource exists but does not have the request method. This
allows the caller to catch the error and return a 4.05 message.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Following the recent NVS changes, the following warning now appear with
GCC 7.3 when building with -O2:
ZEPHYROOT/subsys/fs/nvs/nvs.c: In function 'nvs_reinit':
ZEPHYROOT/subsys/fs/nvs/nvs.c:92:36: warning: 'addr' may be used
uninitialized in this function [-Wmaybe-uninitialized]
offset += fs->sector_size * (addr >> ADDR_SECT_SHIFT);
~~~~~~^~~~~~~~~~~~~~~~~~~
ZEPHYROOT/subsys/fs/nvs/nvs.c:606:8: note: 'addr' was declared here
u32_t addr;
^~~~
This was already reported by Coverity earlier as CID:187903.
In practice this can only happen if fs->sector_count equals 0, which is
not possible as checked in nvs_init(). At least in the GCC case, it
believes that k_mutex_lock(&fs->nvs_lock, K_FOREVER) could modify
fs->sector_count.
Workaround the issue by initializing addr to 0.
Fixes#9767
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
The current NVS code checks for an empty ATE using th
_nvs_flash_cmp_const() function. This function loads the data and
compare them to a value. This means that when executed multiple on the
same area, the data get reloaded multiple time. This might have a
noticeable performance impact with an SPI flash.
Instead define a function _nvs_ate_cmp_const to compare an already read
struct nvs_ate with a constant value. Then replace the calls to
_nvs_flash_cmp_const() on struct nvs_ate by _nvs_flash_ate_rd() followed
by _nvs_ate_cmp_const(). This also has the advantage of explicitly
checking for errors instead of testing the error and the result of the
comparison at the same time.
Tested on a Nucleo L432KC board with the nvs sample. The maximum
initialization time (ie just before running the first garbage collector)
goes down to 6213 µs from 7350 µs.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
nucleo_l476rg uses I2C_3 rather than I2C_0, and uses special magic to
synthesize a corresponding define from a device tree node label. Update
the sample to use the Arduino binding if that's present.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The L476RG does not use the same I2C instance as the other L4 boards.
Correct the pinmux and add the peripheral.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The Nordic TWIM driver uses DMA which requires that the source address
be located in RAM. If it isn't the transfer will rejected as invalid.
Provide a RAM address even though it's never dereferenced.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
0x77 is an available device address (and is the secondary address for
the BME280). 0x78 is a reserved address.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
SPI devices almost always require chip selects, which are configured
through GPIOs. Make the GPIO infrastructure available by default when
SPI is enabled.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The Kconfig option ETH_SAM_GMAC was missing it's dependency on
NET_L2_ETHERNET. Before this patch Kconfig was allowing users to
enable the driver, but the driver was not added because the CMake code
only adds the driver when NET_L2_ETHERNET.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Don't present USE_SWITCH and SMP to user applications that are
configuring for platforms that do not support SMP or USE_SWITCH.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
SMP requires the new-style '_arch_switch' to be enabled. To prevent
users from creating invalid configurations where SMP is enabled while
_arch_switch is not, we add a dependency from SMP to USE_SWITCH.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
RETPOLINE has been enabled by default on most platforms, but it is
only supported on X86.
Features should only be enabled if they are supported and active on
the given platform. To rectify this we have RETPOLINE depend on X86,
the only platform on which it is implemented.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
As this was written before, a 'FLAOT' menu entry was present, and to
see what kind of features or configuration it had, one had to navigate
into the menu to determine if anything related to 'FLOAT' was enabled
at all.
Now there is an unchecked box on the 'FLOAT' menu when it is disabled,
which clearly expresses that it is disabled without the need to enter
the menu entry.
This change only changes the menu layout, and not the dependencies of
any options.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
As this was written before, a 'Framebuffer' menu entry was present,
and to see what kind of features or configuration it had, one had to
navigate into the menu to determine if anything related to
'Framebuffer' was enabled at all.
Now there is an unchecked box on the 'framebuffer' menu when it is
disabled, which clearly expresses that it is disabled without the need
to enter the menu entry.
This change only changes the menu layout, and not the dependencies of
any options.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Kconfig options are often either of the type 'feature' or
'configuration'. Meaning, either an option controls whether a feature
is enabled, or it adjusts/configures an already enabled feature.
Configuration of features should depend on the feature they are
configuring or else noise is created both in the Kconfig output and in
the Kconfig menu.
In this commit we add a dependency from a configuration option to it's
feature option.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
patch set the config USB_DFU_MAX_XFER_SIZE to 4096. This will
reduce the time required for flashing.
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
The bulk of implementation in the current DFU arch is done in the ISR.
This works well when the Flash device is memory mapped as these writes
get done comparatively quickly. However, in case of platforms where
the flash device is sitting on the SPI Bus, this was observed to
cause an exception. This exception may be because there are multiple
function calls consuming larger processing time inside the ISR. The
ISR stack may also end up going deeper and risk stack corruption on
devices with low RAM. To resolve this, we deferred flash write to a
worker thread. Also, some handshaking was added to have synchronization
with the host in accordance with the Host-Device DFU protocol.
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
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>
Since 2.14.1 release mbedTLS has a few API changes and deprecation which
do not affect the Zephyr code and a new MBEDTLS_CHECK_PARAMS option that
enables validation of parameters in the API. A list with all changes can
be found in:
./ext/lib/crypto/mbedtls/ChangeLog
Note that this version will become the basis of the next LTS (Long Term
Support) branch that will be maintained for the next 3 years until at
least the end of 2021.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This seems to solve the issue with GH-12033. There seems to be
some compiler optimization that was causing this issue. This
occurs only when the build is re-run by invoking cmake without
clearing the previous build.
Fixes:GH-12033
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Change arg_len to be u16_t in shell_history_get since it is returning
a value that can be hold by u16_t.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Everywhere the return of this function was being assigned to u16_t to
save space on stack. Instead of casting in all these places (and may
end up with overflow), just changing this function's return.
Note that the function itself is not checking for overflow yet since
I'm not sure this can happen and/or is a problem. Though now we have
only one single point to fix this problem.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
ENOEXEC should be used for executable file format error.
While is undertandable return it when the command is wrong, this
function is returning it two cases where other errors are more
descriptive. When parameter is NULL, is better return EINVAL.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>