Commit graph

42249 commits

Author SHA1 Message Date
3d078f3e59 boards: arm: configure and document the bootloader on the Trinket M0
The Trinket M0 has a Adafruit UF2 bootloader.  Configure and document
how to use it.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-12 13:20:47 +02:00
a816eeba2f soc: sam0: add support for the BOSSA bootloader
This adds a new config option for SAM0 targets that use the BOSSA
bootloader.  If the CDC ACM driver is also enabled, then the
programmer can automatically reset the board into the bootloader for
programming.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-12 13:20:47 +02:00
0d16a9a801 usb: cdc_acm: add a DTE rate changed callback
This is called when the USB host changes the virtual baud rate.

This is used by Arduino style boards to signal that the board should
reset into the bootloader.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-12 13:20:47 +02:00
Steven Slupsky
a18a73c19b drivers: wdt: sam0: fix register access in feed()
The wdt CLEAR register is a write synchronized register.
To avoid bus stall, check the status of SYNCBUSY before
accessing the register.

Use SYNCBUSY register for SAM E.
If the wdt is syncing, return -EAGAIN to avoid bus stall.

Signed-off-by: Steven Slupsky <sslupsky@gmail.com>
2020-07-11 12:40:18 -04:00
Maureen Helm
5c603d9edf tests: gen_isr_table: Disable gpio on lpcxpresso54114
One of the interrupts used by the gen_isr_table test conflicts with a
gpio interrupt on the lpc54114 soc, so disable gpio for this test on the
corresponding board. We do this for only the m4 core because the test is
not supported on the m0 core.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-11 08:49:50 -04:00
Alexander Kozhinov
830f72b91c samples: net: sockets: big_http_download: Extend progress metrics
extended download progress metrics to Bytes, KiB and MiB
separate number of download iterations for INF and numeric case

Signed-off-by: Alexander Kozhinov <AlexanderKozhinov@yandex.com>
2020-07-11 14:56:13 +04:00
Armando Visconti
485f2d410c drivers/sensors: Add iis2dh accelerometer sensor support
Add support to STM IIS2DH the ultra-low-power highperformance
three-axis linear accelerometer.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-07-10 11:49:40 -05:00
Jared Wolff
126a5678a6 boards: arm: nrf: Adding board.c to nRF9160 Feather def
Allows the Circuit Dojo nRF9160 Feather to remain powered on
battery power.

Signed-off-by: Jared Wolff <hello@jaredwolff.com>
2020-07-10 17:56:00 +02:00
Jared Wolff
11966acdd3 boards: arm: nrf: Adding Circuit Dojo nRF9160 Feather definitions.
Adding the Circuit Dojo nRF9160 Feather device tree definitions.
Both secure and non secure targets.

Signed-off-by: Jared Wolff <hello@jaredwolff.com>
2020-07-10 17:56:00 +02:00
Mieszko Mierunski
5d00616bf3 drivers: nrf: Add concatenation buffer to i2c nrfx TWIM driver.
Add option to concatenate i2c transfers. If concatenation buffer size is
provided then transfers will be concatenated as long as there is space
left in buffer.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2020-07-10 15:40:26 +02:00
Asbjørn Sæbø
1886cb4b4e Bluetooth: Shell: Add shell command to output the ATT MTU size
It is sometimes useful to know what the ATT MTU size is.

Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
2020-07-10 13:14:30 +02:00
Kamil Piszczek
d19e21fb01 drivers: bluetooth: rpmsg: validate heap size configuration
Added a build-time assert to check if heap memory configuration to
make sure that it can accomodate RPMsg queue allocations.

Ref: NCSDK-5479

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2020-07-10 13:13:46 +02:00
Alexandre Bourdiol
e09fcca8a8 boards: arm: nucleo_f767zi: ethernet restriction on cut-A
nucleo_f767zi with soc cut-A (Device marking A) has some ethernet
restrictions.
Use of cut-Z is adviced.

fixes #26519

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-07-10 12:05:54 +02:00
Oleg Zhurakivskyy
fda94f7d06 net: tcp2: Fix dereference after null check in tcp_in()
Fix dereference after null check in tcp_in().

Coverity CID :210051

Fixes #25783

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2020-07-10 11:46:20 +02:00
Alexandre Bourdiol
e520f35453 drivers: flash: stm32wb return in case of control register locked
In case of control register lock, driver should return the error
immediately. Otherwise, error is later overwritten by
'rc = flash_stm32_wait_flash_idle(dev);'

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-07-10 11:46:05 +02:00
Johann Fischer
6d76bd8a9f drivers: usb_dc_sam0: rename ep_num to common ep_idx
ep_idx is common used designator for endpoint index,
rename ep_num to ep_idx in usb_dc_sam0 driver.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-07-10 11:45:46 +02:00
Johann Fischer
b95558dd9f drivers: usb: unify endpoint helper macros
Unify endpoint index and direction helper macros
across all usb device drivers.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2020-07-10 11:45:46 +02:00
Vincent Wan
3b126e30e2 drivers: entropy: cc13xx_cc26xx: add power management support
This commit adds a dependency on the TRNG resource in the TI Power
module, prevents the system policy from entering standby when TRNG is
active, and adds support for device PM.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-07-10 11:45:31 +02:00
Martí Bolívar
b08309e992 cmake: fix kconfig targets
Commit 269f350487 introduced a new
mechanism for loading the edtlib.EDT representation of the devicetree
from kconfigfunctions.py.

While this works for running kconfig.py from kconfig.cmake using
execute_process(), it doesn't work when kconfigfunctions.py is loaded
by the menuconfig target or any other Kconfig targets that use
add_custom_target().

The reason why is that these targets' environments do not have the
location of the EDT pickle file available. This is unlike kconfig.py,
which executes using the same environment as cmake itself, where
edt.pickle's location is already available in the environment.

Fix that by adding EDT_PICKLE to the environment for menuconfig and
friends.

Reported-by: Simon Guinot <simon.guinot@seagate.com>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-10 11:26:11 +02:00
Martí Bolívar
a043d48c54 cmake: fix the build on windows
Commit ef3c5e5516 changed the way
WEST_TOPDIR is initialized from calling 'west topdir' as a subprocess
to using the west API.

However, WEST_TOPDIR is a cmake variable and must be a cmake-style
path, with forward slashes. While 'west topdir' as a command does
output a forward slash separated path (basically in order to make the
zephyr build system work), west_topdir() as an API returns the path in
the host environment path style, which on Windows uses backslashes.

This turns out to be the ultimate cause of the following build error:

CMake Error at C:/.../CheckCCompilerFlag.cmake:41 (set):
  Syntax error in cmake code when parsing string
    -fmacro-prefix-map=C:\Users\Marti\zp=WEST_TOPDIR

Fix it by converting to POSIX style in Python. We could have
potentially also done this using file(TO_CMAKE_PATH "${WEST_TOPDIR}"
...), but I'm intentionally repeating the old way of doing things
since it was known to work.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-09 18:13:44 -04:00
Spoorthy Priya Yerabolu
0e599be5fc sanitycheck: Updating README file
Updated readme with coverage commands and
organization of tests

Signed-off-by: Spoorthy Priya Yerabolu <spoorthy.priya.yerabolu@intel.com>
2020-07-09 16:03:57 -05:00
Henrik Brix Andersen
99c7597874 drivers: i2c: mcux: return to idle on failed transfers
Abort I2C transfers through the MCUX HAL if a transfer fails to avoid
deadlock in the driver/HAL.

Fixes #25098

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-07-09 16:03:01 -05:00
Anas Nashif
dc43c298a2 sanitycheck: do not retry build errors with --retry-failed
restore how --only-failed works by allow rebuilds in case of build
errors, however, do not rebuild when --retry-failed is used, which is a
CI usecase and nothing would change in the second iteration.

Fixes #26685

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-09 16:46:24 -04:00
Daniel Leung
d0e36f2cac boards: intel_s1000_crb: add zephyr,flash-controller to DTS
The board has a SPI NOR flash enabled by default but was missing
the "zephyr,flash-controller" in DTS. This prevents the flash
shell sample to compile. So add the DTS entry.

Fixes #26764

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-09 14:03:14 -04:00
Stephanos Ioannidis
3322489d22 config: Rename TEXT_SECTION_OFFSET to ROM_START_OFFSET
The `TEXT_SECTION_OFFSET` symbol is used to specify the offset between
the beginning of the ROM area and the address of the first ROM section.

This commit renames `TEXT_SECTION_OFFSET` to `ROM_START_OFFSET` because
the first ROM section is not always the `.text` section.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-07-09 14:02:38 -04:00
Marek Pieta
4e43e00c4c Bluetooth: controller: Safe default value of BT_CTLR_LLCP_CONN
Change sets default value of Kconfig option BT_CTLR_LLCP_CONN to
BT_MAX_CONN. The default value should properly handle the worst case.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2020-07-09 19:08:50 +02:00
Vinayak Kariappa Chettimada
dc55538645 Bluetooth: controller: Fix missing skip value calculation
Fix missing recalculation of skip value of the ticker being
inserted into ordered list, when it collides and is being
attempted to be inserted at next periodic interval.
This fix is for ticker compatibility mode which is used as
default for nRF51 series.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-09 19:08:35 +02:00
Marcin Niestroj
af0bb8835b net: l2: ppp: ipv6cp: remove wrong Configure-Rej handling
Currently there is a single function that handles both Configure-Ack and
Configure-Rej messages. This is obviously wrong for Configure-Rej,
because implementation applies options received in the message.

Remove Configure-Rej callback, so those frames are simply ignored for
the time no valid handling code exists.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-09 12:47:12 -04:00
Francois Ramu
4d9dd59310 soc: arm: stm32wb has no PWR clock to enable
The stm32wb soc does not have any PWR clock
for its power IP block when initializing the module.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-07-09 17:35:43 +02:00
Andrzej Głąbek
48b693596e modules: hal_nordic: Fix minor issues
Update the hal_nordic module revision to include the following commits:
- CMakelists: missing "src" in one path
- nrfx_glue: Fix NRFX_PPI_GROUPS_USED_BY_BT_CTLR definition

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-07-09 16:57:04 +02:00
Kumar Gala
fec3c6984e west.yml: Update to pull in TFM v1.1-rc2
Update to sync with TFM v1.1-rc2 which adds support for the LPC55S69 and
STM32L5 SoCs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-09 08:34:25 -05:00
Erwan Gouriou
f7b8175be9 west.yml: Update hal_stm32 to include License root file
Update hal_stm32 module in master manifest to include
latest changes around License information

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-07-09 08:16:19 -05:00
Maureen Helm
18bb0b8904 boards: arm: Clean up lpcxpresso55s16 board.cmake
Cleans up the lpcxpresso55s16 board.cmake to make it consistent with
other lpc boards. jlink.board.cmake sets the default runner to jlink if
not already set.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:58:50 -05:00
Maureen Helm
8a8b90d6d1 boards: arm: Clean up zephyr-app-commands usage in frdm_k82f board doc
Cleans up the frdm_k82f board document to make its usage of
zephyr-app-commands consistent with other frdm boards.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:58:50 -05:00
Maureen Helm
877997e71f boards: arm: Remove OPENSDA_FW cmake variables from nxp boards
The OPENSDA_FW and LPCLINK_FW cmake variables are remnants of pre-west
days where we used an environment variable to set the desired debug host
tool, such as jlink or pyocd, based on which debug probe firmware was
loaded on the board. We now have two possible ways to do this, neither
of which requires the nxp-specific OPENSDA_FW or LPCLINK_FW variables:

1. Set standardized cmake runner variables when generating the build
   system:
   $ west build -- -DBOARD_FLASH_RUNNER=jlink -DBOARD_DEBUG_RUNNER=jlink

2. Use the west "--runner" argument with the debug and flash commands:
   $ west debug -r jlink

Remove the now unnecessary OPENSDA_FW ond LPCLINK_FW variables and
update board documentation accordingly.

A few boards (frdm_kw41z, hexiwear_k64, mimxrt10{20,50,60,64}_evk)
reordered pyocd.board.cmake and jlink.board.cmake includes to preserve
the default runner when OPENSDA_FW was not explicitly set.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:58:50 -05:00
Maureen Helm
eb43207508 disk: Remove unused variables in nxp usdhc driver
Removes unused instances of struct usdhc_priv in the nxp usdhc driver.
The DISK_ACCESS_USDHC_INIT macro is responsible for instantiating these
variables.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm
04f2ab9af1 disk: Remove extra copy of config struct in nxp usdhc driver
Updates the nxp usdhc driver data structure to keep a reference instead
of a copy of the constant config structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm
6fa92fe7da disk: Move variable from config to data struct in nxp usdhc driver
Moves the source clock frequency variable in the nxp usdhc driver from
the config structure to the data structure in preparation for removing
the writable copy of the config structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm
ec53518fa5 disk: Remove instance conditionals from nxp usdhc driver functions
Refactors the nxp usdhc driver to remove instance-specific conditionals
from driver functions. Now all instance-specific details, such as power
and card detect gpios, are contained in the driver config structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm
47463173c7 disk: Create device instance macro in nxp usdhc driver
Creates a new device instance macro in the nxp usdhc driver to use with
DT_INST_FOREACH.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Christian Taedcke
3dbe9f2960 sanitycheck: native: Add option to enable UBSAN
Add option for native platform to enable undefined behaviour sanitizer.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-07-09 07:49:57 -04:00
Trond Einar Snekvik
cb7835d18f Bluetooth: Mesh: Wait for proxy on node reset
Adds idle wait callback to proxy by counting the number of pending
notifications.

Ensures that all connected nodes have received messages before resetting
the mesh stack.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-07-09 13:49:26 +02:00
Marcin Niestroj
559cf02107 drivers: lora: sx1276: configure reset gpio only once
Reset gpio is configured during driver initialization. There is no
reason to do it repeat that process later, so replace
gpio_pin_configure() with gpio_pin_set().

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-09 13:47:42 +02:00
Marcin Niestroj
71bdb35191 drivers: lora: sx1276: rework gpio configuration
Introduce sx1276_configure_pin() helper macro, which hides lots of
boilerplate preprocessor and C code. Doing so allows to uncover
inconsistent gpio initialization flow and prevent such in future. Also
add error log whenever gpio_pin_configure() fails.

It seems like output of gpio_pin_configure() for several
gpios (antenna_enable, rfi_enable, rfo_enable) was assigned to variable,
but its values was never checked. Return value from gpio_pin_configure()
of tcxo_power gpio was even not catched. The only output gpio
configuration that was handled properly was actually reset gpio.

Fix that inconsistent behavior by always checking return value of
sx1276_configure_pin().

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-09 13:47:42 +02:00
Krzysztof Chruscinski
2809cad50e logging: Add fields initialization in z_log_msg_std_alloc
Added initialization of ids fields in the log message in
z_log_msg_std_alloc(). If user space is enabled then msg_free()
function is reading log level and previously it may have been
uninitialized.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-09 13:46:07 +02:00
Marcin Niestroj
7996f527d5 net: l2: ppp: ipcp: clear options after protocol goes down
Clear negotiated options in protocol down handler. That way all
addresses are properly requested (by sending 0.0.0.0 in Configure-Req)
in the subsequent option negotiation phases.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-09 13:45:18 +02:00
Vinayak Kariappa Chettimada
eb2a64989b drivers: flash: nrf: Fix flash operation timeout
Fix flash operation timeout due to incorrect use of
secondary ticker to abort any radio in use. Ticker id 0
is reserved for split controller's pipeline preempt timeout.
Using the same ticker id caused the secondary ticker to
not be started if controller is using the same ticker id
for pipeline preempt timeout.

Fixes #26333.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-09 07:17:41 -04:00
Peter Bigot
ca76a5be7c tests: drivers: spi_loopback: set CS GPIO flags
Hard-code the active level as there's no reason to make this
configurable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
2036bbcde4 drivers: sensor: bme280: respect devicetree cs-gpios flags
Forward flags cell from cs-gpios devicetree property into device SPI
configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
9acf7867ec drivers: spi_flash_at45: respect devicetree cs-gpios flags
Forward flags cell from cs-gpios devicetree property into device SPI
configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00