Commit graph

41120 commits

Author SHA1 Message Date
Erwan Gouriou
a11405df52 scripts: requirements: Request version 0.24.0 for pyocd
pyocd 0.24.0 provides support for more user options.
This enables flashing of additional boards using pyocd.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-01-13 11:49:57 +01:00
Ahmed Hussein
d24e5e520c Bluetooth: Mesh: Enable Segmented Control Messages
The function bt_mesh_ctl_send() used to support maximum length of
11 bytes. The segmentation complies with the BLE Mesh Standard.
The ack is disabled in case of non unicast address.

Signed-off-by: Ahmed Hussein <ahmed_hussein_@hotmail.com>
2020-01-11 18:20:52 +01:00
Trond Einar Snekvik
723e14a432 Bluetooth: Mesh: Model start callback
Replaces the Mesh model settings_commit callback with a start callback,
indicating that the mesh model behavior is ready to start. Everything
that was previously done in the settings_commit callback may be moved to
this callback, which gets called just after mesh settings are committed,
instead of in the middle of the process.

This resolves an issue where models had no context in which to start
their behavior, as the previous settings_commit call fired before the
mesh was declared valid, making access APIs inaccessible.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-01-11 18:20:00 +01:00
Kim Sekkelund
9ea6e72bae Bluetooth: host: cfg_write callback to return error code
Current implementation of application's cfg_write callback only has the
possibility of returning boolean status, which in case of failure only
allows for one error code; BT_ATT_ERR_WRITE_NOT_PERMITTED.
This change makes the application able to add own security check on
characteristic subscription in the cfg_write callback and report a more
relevant error code (e.g. BT_ATT_ERR_AUTHORIZATION).

Signed-off-by: Kim Sekkelund <ksek@oticon.com>
2020-01-10 17:41:15 +01:00
Joakim Andersson
c336539249 Bluetooth: host: Remove toggling advertiser on advertise data update
Remove toggling the advertise enable state when the advertiser name has
been updated. Advertise and scan response data should be used by the
controller on subsequent advertising events.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-01-10 17:10:46 +01:00
Håkon Øye Amundsen
311b31d9f4 Bluetooth: select BT_RPMSG_NRF53 for non-secure variant of nrf5340
Prior to this you would get compilation error when building
samples for the nrf5340_dk_nrf5340_cpuappns board.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2020-01-10 16:33:00 +01:00
Jan Van Winkel
7e3f9ebf3f samples: display: Added generic display shield sample
Added a generic display shield sample.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2020-01-10 09:18:20 -06:00
Francois Ramu
6252387f00 west.yml: update hal stm32g4xx module
This updates the stm32cube/stm32g4xx/drivers
to wa the issue #21715

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-01-10 16:10:40 +01:00
Anas Nashif
89005438bc i2c: add i2c shell with scan cmd
Add a shell to interact with I2C devices. Currently scanning for devices
is supported. Example output:

uart:~$ i2c scan I2C_1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:             -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
2 devices found on I2C_1
uart:~$ i2c scan I2C_3
i2c - I2C commands
Subcommands:
  I2C_1  :I2C_1
  I2C_2  :I2C_2
uart:~$ i2c scan I2C_2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:             -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 1e --
20: -- -- -- -- -- -- -- -- -- 29 -- -- -- 2d -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- 56 -- -- -- -- -- -- 5d -- 5f
60: -- -- -- -- -- -- -- -- -- -- 6a -- -- -- -- --
70: -- -- -- -- -- -- -- --
7 devices found on I2C_2

This shell is based on the a sample that did the same thing and was
limited in support. The sample is now removed in favour of this generic
shell module.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-10 08:55:47 -05:00
Anas Nashif
7c9a87aea2 samples: remove i2c scanner
Now part of the I2C shell and works for all boards.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-10 08:55:47 -05:00
Ulf Magnusson
53e12e8a11 west.yml: Update ci-tools to add misc. new CI checks
Gets these commits in:

    check_compliance.py: Detect refs to undef. symbols in samples and
    tests

    Extend the check for references to undefined Kconfig symbols to also
    detect undefined symbols in samples and tests.

    Samples and tests were skipped due to using separate Kconfig trees,
    which hid the symbols defined in them. Work around it by grepping
    for Kconfig symbol definitions in them instead.

    Keep properly parsing the main Kconfig tree, as it's needed to see
    symbol names that are stitched together with the Kconfig
    preprocessor.

    ------------------------------------------------------------------

    check_compliance.py: Detect bad header comments and other nits

    Add a generic kitchen-sink Nits test for various minor nits that
    aren't already covered by tools like checkpatch.pl and pylint. So
    far checks this:

     - Header comments in Kconfig files

     - Missing newlines at the end of various source files (probably a
       bad editor setting)

     - Leading/trailing blank lines in files

    ------------------------------------------------------------------

    check_compliance.py: Kconfig: Flag redundant $ZEPHYR_BASE in
    'source'

    'source's like

        source "$(ZEPHYR_BASE)/Kconfig.zephyr"

    can be simplified to

        source "Kconfig.zephyr"

    since $srctree already points to the Zephyr root.

    Flag it in the Nits test.

    This also avoids absolute paths showing up in some places.

    ------------------------------------------------------------------

    check_compliance.py: Improve error reporting for Git commands

    Similar improvements to
    https://github.com/zephyrproject-rtos/zephyr/pull/21577. No custom
    potentially-missing working directory is used here, but always
    including the exception message still feels more robust.

    Use err() instead of sys.exit() in git(), and have it include the
    command name, which is helpful in logs.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-10 08:17:37 -05:00
Christian Taedcke
20aa2bcf05 boards: efr32_slwstk6061a: Add support for spi nor flash
This commit adds support for the on-board flash MX25R8035F that is
directly connected to the efr32fg soc.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2020-01-10 07:14:35 -06:00
Christian Taedcke
0201d182a8 boards: efr32mg_sltb004a: Add support for spi nor flash
This commit adds support for the on-board flash MX25R8035F that is
directly connected to the efr32mg soc.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2020-01-10 07:14:35 -06:00
Christian Taedcke
6da94af847 drivers: spi: Add Gecko SPI driver
This commit adds SPI driver and its bindings using the USART peripheral
for Silicon Labs EFM32 and EFR32 MCUs.

Signed-off-by: Christian Taedcke <hacking@taedcke.com>
2020-01-10 07:14:35 -06:00
Andries Kruithof
44daa9f15c Bluetooth: controller: Refactor time calculation for LL DLE procedure
Refactor the PKT_US macro to show more clearly where the different
fields come from

Signed-off-by: Andries Kruithof <Andries.Kruithof@nordicsemi.no>
2020-01-10 14:10:23 +01:00
Alberto Escolar Piedras
3b135bd075 CODEOWNERS: Add aescolar to tests/bluetooth/bsim_bt/
Add aescolar to be automatically added for reviews
for changes in tests/bluetooth/bsim_bt/

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2020-01-10 07:54:11 -05:00
Marcin Szymczyk
2d6c6959f9 soc: nrf91: add power management
Only System OFF mode is supported.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2020-01-10 13:09:44 +01:00
Marcin Szymczyk
32b3ab2354 soc: nrf53: add power management
Only System OFF mode is supported.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2020-01-10 13:09:44 +01:00
Ismael Fillonneau
0c3fbaa882 drivers: nrf: avoid UARTE pm infinite loop
calling UARTE power management with DEVICE_PM_SUSPEND_STATE
then DEVICE_PM_OFF_STATE causes a deadlock in while loop.
It waits for an event witch never comes

Signed-off-by: Ismael Fillonneau <ismael.fillonneau@stimio.fr>
2020-01-10 10:42:23 +01:00
Stephanos Ioannidis
d314253fbb soc: arm: xilinx_zynqmp: Relocate platform-specific initialisation.
This commit relocates the exception vector table address range
configuration routine that was previously implemented as part of
Cortex-R architecture reset function to SoC platform-specific
initialisation routine.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-01-10 10:34:17 +01:00
Stephanos Ioannidis
bc8524eb82 arch: arm: Rewrite Cortex-R reset vector function.
This commit addresses the following issues:

1. Add a new Kconfig configuration for specifying Dual-redundant Core
   Lock-step (DCLS) processor topology.

2. Register initialisation is only required when Dual-redundant Core
   Lock-step (DCLS) is implemented in hardware. This initialisation is
   required on DCLS only because the architectural registers are in an
   indeterminate state after reset and therefore the initial register
   state of the two parallel executing cores are not guaranteed to be
   identical, which can lead to DCCM detecting it as a hardware fault.
   A conditional compilation check for this hardware configuration
   using the newly added CONFIG_CPU_HAS_DCLS flag has been added.

3. The existing CPU register initialisation code did not take into
   account the banked registers for every execution mode. The new
   implementation ensures that all architectural registers of every
   mode are initialised.

4. Add VFP register initialisation for when floating-point support is
   enabled and the core is configured in DCLS topology. This
   initialisation sequence is required for the same reason given in
   the first issue.

5. Add provision for platform-specific initialisation on Cortex-R
   using PLATFORM_SPECIFIC_INIT config and z_platform_init function.

6. Remove seemingly pointless and inadequately defined STACK_MARGIN.
   Not only does it violate the 8-byte stack alignment rule, it does
   not provide any form of real stack protection.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-01-10 10:34:17 +01:00
Ulf Magnusson
513e36e312 Bluetooth: tests: Remove references to CONFIG_SYS_LOG(_DEFAULT_LEVEL)
Removed in commit 0eb6ffa3e9 ("logging: kconfig: Remove legacy SYS_LOG
symbols").

Detected by an improved CI check that also checks samples and tests.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-10 09:37:47 +01:00
Ulf Magnusson
1f59ad7aea Bluetooth: tests: Fix typo'd CONFIG_ARCH_POSIX in comment
Detected by an improved CI check that also checks samples and tests.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-10 09:37:47 +01:00
David B. Kinder
28a6f4c8c5 doc: remove documentation reviewer
As of January 2020, David is no longer working on the Zephyr
documentation, so he should not be automatically added as reviewer.
I've commented out rather than removed the lines so when a replacement
is found, the lines can easily be added back.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2020-01-09 19:52:35 -05:00
Ryan QIAN
b4d774a66d west: update the head of hal_nxp
- to get the update hal_nxp from PR #13

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2020-01-09 16:29:22 -06:00
Ryan QIAN
ef537c272f boards: arm: mimxrt1010_evk: Extend usb device support
- extend usb device support for mimxrt1010_evk

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2020-01-09 16:29:22 -06:00
Ryan QIAN
b734287c4e boards: arm: add board support for mimxrt1010_evk
Add board support files for mimxrt1010_evk, the development board for
i.MXRT1010 (CM7) SoC.

- Add pinmux, dts and doc.
- Tested samples: hello_world, philosophers, synchronization,
basic/blinky, basic/button.

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2020-01-09 16:29:22 -06:00
Ryan QIAN
7f75e4f83b soc: arm: nxp_imx: rt: add device support i.MX RT1010
- Add device support for i.MXRT1010

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2020-01-09 16:29:22 -06:00
Ryan QIAN
df12b9ee7f driver: gpio: gpio_mcux_igpio: check presence of IRQ macro first
- Check presence of GPIO IRQ related macros before enabling IRQ

Signed-off-by: Ryan QIAN <jianghao.qian@nxp.com>
2020-01-09 16:29:22 -06:00
Carles Cufi
beedf19ca4 shell: Remove deprecated macros
Remove deprecated macros and add a note to the release notes to this
effect.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-01-09 14:38:49 -05:00
Torsten Rasmussen
4b68f959b5 cmake: locating zephyr modules in CMAKE_BINARY_DIR
This commit restores the old behaviour of locating Zephyr modules under
CMAKE_BINARY_DIR instead of CMAKE_CURRENT_BINARY_DIR during building of
Zephyr modules.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-01-09 14:33:36 -05:00
Anas Nashif
e7656ea831 sanitycheck: do not log stderr from BinaryHandler
stderr from the binary handler (native_posix for example) was redirected
to the logger as errors, this is confusing the console and users, so
remove this.

Fixes #21784

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-09 14:28:32 -05:00
Laczen JMS
ab3ed439c8 drivers: eeprom: Unified simulator and native_posix
EEPROM simulator and native_posix have been unified to one solution,
the old eeprom,native_posix is removed.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2020-01-09 20:28:19 +01:00
Laczen JMS
20623dfa4c drivers: eeprom: Add support for eeprom simulator
Add support for a eeprom simulator. The PR limits the addition to
qemu_x86 but it can easily be added to other devices by defining the
eeprom simulator in the dts and setting 'CONFIG_EEPROM_SIMULATOR=y'

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-09 20:28:19 +01:00
Luiz Augusto von Dentz
708c8bae54 Bluetooth: ATT: Use k_mem_slab for connection context
This uses k_mem_slab APIs to allocate/free ATT context instead of custom
array.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-01-09 19:20:21 +01:00
Luiz Augusto von Dentz
aa7013b9bd Bluetooth: shell: Fix not reseting value_handle if subscription fails
If bt_gatt_subscirbe fails value_handle must be reset since otherwise it
will not possible to subscribe again as the parameters will be consider
in use.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-01-09 19:20:21 +01:00
Luiz Augusto von Dentz
3be9980bd6 Bluetooth: GATT: Remove _peer member from bt_gatt_subscribe_params
This further reduce the overhead on each subscription at expense of
having a dedicated array to store subscriptions, the code now maintain
a separate list for each peer which should also scale better with large
number of subscriptions to different peers.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-01-09 19:20:21 +01:00
Luiz Augusto von Dentz
d278cdc3d7 Bluetooth: GATT: Allocate request from a memory slab
This should reduce the footprint on applications that do a lot of
requests i.e have a lot of subscriptions.

Fixes #21103

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-01-09 19:20:21 +01:00
Benoit Leforestier
f256625ad4 Driver: Flash STM32: Don't use semaphore if multithreading isn't defined
In STM32 flash driver, don't use semaphore if multithreading
isn't defined.
If multithreading isn't defined, a call to sem_give function
generates a hardware fault exception.

Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
2020-01-09 19:14:32 +01:00
Andrew Boie
9b34ecd0c8 userspace: fix incorrect linker routing
The _thread_idx_map bitfield which has '1' set for free
thread indexes really needs to live in the
data section reserved for kernel object metadata, as this
is a part of memory that is allowed to shift addresses
between zephyr_prebuilt.elf and zephyr.elf.

However, if an application defines enough static threads
that there are no free indexes, the entire bitfield will
be zeroed and the bitfield will end up in the main BSS
section.

Force this data to always be in the .kobject_data.data
section regardless of its contents.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-01-09 09:13:23 -08:00
Henrik Brix Andersen
105dc72dff samples: shields: lmp90100_evb: add rtd sample
Add sample for reading the temperature of a 3-wire PT100 sensor using
the Texas Instruments LMP90100 Sensor Analog Frontend (AFE) Evaluation
Board (EVB) shield.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-09 17:27:52 +01:00
Henrik Brix Andersen
ade6bb24e8 boards: shields: lmp90100_evb: add TI LMP90100 EVB shield
Add shield definition for the Texas Instruments LMP90100 Sensor Analog
Frontend (AFE) Evaluation Board (EVB).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-09 17:27:52 +01:00
Henrik Brix Andersen
bc2113bd46 drivers: adc: add LMP90xxx ADC driver with GPIO
Add driver for the Texas Instruments LMP90xxx series of multi-channel,
low-power 16-/24-bit sensor analog frontends (AFEs).

The functionality is split into two drivers; an ADC driver and a GPIO
driver.

Tested with LMP90080 and LMP90100.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-09 17:27:52 +01:00
Henrik Brix Andersen
9d71384e50 drivers: adc: support for adc channel gain factor of 128
Support specifying a gain factor of 128 when configuring ADC channels.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-09 17:27:52 +01:00
Anas Nashif
599aac42f9 tracing: ctf: fix arguments to ctf_top_thread_info
Arguments where reveresed, first we expect the base then the stack size.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-09 11:21:19 -05:00
Anas Nashif
0ad67650f2 tracing: better positioning of tracing points
Improve positioning of tracing calls. Avoid multiple calls and missing
events because of complex logix. Trace the event where things happen
really.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-09 11:21:19 -05:00
Anas Nashif
1530819e12 tracing: remove duplicate tracing of thread creation
This is already being called in z_setup_new_thread.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-09 11:21:19 -05:00
Anas Nashif
26cecf74c4 arc: remove old macro used for event logger
Leftover macro from the kernel event logger which was replaced by
generic tracing infrastructure.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-01-09 11:21:19 -05:00
Ulf Magnusson
5372dedf2f scripts: kconfig: lint.py: Improve error reporting
If the working directory for a command was missing (usually due to
forgetting to run 'west update'), you'd get a FileNotFoundError
exception along with a cryptic error like

    'git' not found

Only catch OSError instead (which is a base class of FileNotFoundError),
and always show the exception message. It makes it clear that it's the
working directory that's missing.

Add some other misc. improvements too:

 - Turn stderr output from external commands into a warning instead of
   an error

 - Add err() and warn() helpers

 - Include the command name in messages

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-09 11:19:57 -05:00
Vinayak Kariappa Chettimada
f8877e39ce Bluetooth: controller: legacy: Fix controller address check
Fix controllers address check in cases of controller-based privacy.
When controller has been instructed by the host to use privacy
the controller should look up the peer identity address and generate
an address based on the local IRK. In the case where no match
is found or the local IRK is all zeroes the controller shall use
the fallback address. If the fallback address is not valid the
controller shall return invalid params.

This commit fixes these issues:
 - Starting a private advertiser without valid random address set
   but a valid local IRK exists. In this case the advertiser should
   be able to advertise using the RPA regardless of a valid random
   or public address.
 - Starting a private advertiser with a fallback to the public
   address type or an adveriser using public address  does not
   check if a valid public address exists. The host cannot
   advertise with an all-zero public address.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-01-09 15:34:23 +01:00