Commit graph

42567 commits

Author SHA1 Message Date
Michał Narajowski addbdb0d00 mesh: Fix key refresh procedure
Key refresh procedure was ignored on non-primary subnet.

Mesh Profile Specification v1.0.1:
3.10.4 Key Refresh procedure
"This procedure is used when the security of one or more network
keys and/or one or more of the application keys has been compromised
or could be compromised."

"It is possible to update each NetKey independently of all other
NetKeys. A Key Refresh procedure for one NetKey can be in a different
phase to another Key Refresh procedure for other NetKeys."

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Michał Narajowski 9a0602417a mesh: Add reset link functionality to provisioning bearers
Reset provisioning bearers when bt_mesh_reset() is called. Accept
another provisioning attempt after link close.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Michał Narajowski 5e543a2366 mesh: Add a define representing max transaction id
This value was used quite often in the file so adding a
descriptive name should improve readability.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Michał Narajowski ebabba3684 mesh: Start protocol timer on send message in advertising bearer
Protocol timer was not started when sending a control message
in advertising bearer.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Michał Narajowski df426abe53 mesh: Fix resending provisioning link ack
The comparison of a current tx link transaction id caused
us to not send ack and in effect fail provisioning.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-07-02 16:30:01 +03:00
Marcin Niestroj 67f106820b net: ppp: consume ringbuf until it is empty
ringbuf claim API returns pointer to contiguous area. In cases when data
in ringbuf wraps the end of internal buffer, then single call to claim
data is not enough to get all data - there is remaining part on the
beginning of internal buffer. Those remaining bytes will need to wait
for next ISR handler to trigger workqueue. Theoretically this means that
data on the beginning of ringbuf can wait there forever, or simply to
the next timeout in PPP stack when data traffic continues.

Consume data from ringbuf in a loop, stopping only when claiming results
in empty buffer. This will make sure that there is no stale data in the
ringbuf.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-02 08:25:12 -05:00
Marcin Niestroj a470d9deba net: ppp: fix consuming claimed area of ringbuf
Claimed ringbuf bytes were parsed until first frame was detected, but
remaining data in the claimed area was just ignored / lost.

Continue parsing bytes to the end of claimed area after each detected
frame.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-02 08:25:12 -05:00
Erwan Gouriou 6b72fbae7c drivers/clock_control: Remove useless CLOCK_STM32_PLL_XTPRE config
CLOCK_STM32_PLL_XTPRE Kconfig symbols was made to differentiate
code between F1 soc variants with XTRE and others.
It appears that specific XTRE code handling is already in place in
LL_PLL_ConfigSystemClock_* functions that are called afterwards.
Since this piece of code is not required anymore, let's remove
the symbol.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-07-02 08:14:45 -05:00
Andy Ross 928d31125f arch/x86: Add zefi, an EFI stub/packer/wrappper/loader
This is a first cut on a tool that will convert a built Zephyr ELF
file into an EFI applciation suitable for launching directly from the
firmware of a UEFI-capable device, without the need for an external
bootloader.

It works by including the Zephyr sections into the EFI binary as
blobs, then copying them into place on startup.

Currently, it is not integrated in the build.  Right now you have to
build an image for your target (up_squared has been tested) and then
pass the resulting zephyr.elf file as an argument to the
arch/x86/zefi/zefi.py script.  It will produce a "zephyr.efi" file in
the current directory.

This involved a little surgery in x86_64 to copy over some setup that
was previously being done in 32 bit mode to a new EFI entry point.
There is no support for 32 bit UEFI targets for toolchain reasons.

See the README for more details.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-07-02 09:10:01 -04:00
Tobias Svehagen 822df6eef6 drivers: wifi: esp: Improvements to ESP driver
- Fix passive mode protocol selection depending on AT versions
- Use Kconfig value for reset timeout
- Fix bug with parsing security from scan result
- Re-order some AT commands during init due to some commands having
  dependency on other commands

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-07-02 08:52:28 -04:00
Markus Becker 30389e01dd driver: ieee802154: rf2xx: implement setting tx power
Implemented rf2xx_set_txpower() in ieee802154_rf2xx.c by mapping dBm
values to RF2XX register values.

Signed-off-by: Kari Severinkangas <kari.severinkangas@tridonic.com>
Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-07-02 08:51:22 -04:00
Kamil Piszczek ffa31bb99c bluetooth: uuid: add bond management uuids
Added UUIDs definitions that are used in the Bond Management Service.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2020-07-02 08:50:50 -04:00
Xavier Chapron cecea7b536 drivers: i2c_nrfx_{twi, twim}: Remove potential I2C deadlock
Remove K_FOREVER wait on completion_sync.
In some situations (a short on I2C SDA line for example), this
semaphore will never be released and therefore we should not wait
it forever.
Instead we wait for a maximum of 100msec and return an error if we
weren't able to retrieve the semaphore.
In such situation, the program is not stuck anymore, but the I2C
driver must be uninit then init again to work again.

Fixes #25076.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2020-07-02 08:48:24 -04:00
Francois Ramu fd5ce64db4 soc: arm: st_stm32 add low power to stm32wb series
This patch introduces the support of low power modes
for the STM32WBxx from STMicroelectronics based on the lptim
Here, the power modes are sleep modes have lptimer as wakeup source.
The sleep modes are configured by the SYS_POWER_MANAGEMENT.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-07-02 08:45:40 -04:00
Tobias Svehagen edcee97346 drivers: wifi: esp: Fix bug with net_pkt_unref in tx path
The driver should only call net_pkt_unref on packets that get
successfully handled, ie where send/sendto return 0. If the packet
cannot be handled, net_context layer still owns the packet and should
take care or the unref.

Signed-off-by: Tobias Svehagen <tobias.svehagen@gmail.com>
2020-07-02 08:44:55 -04:00
Lukasz Maciejonczyk ddb9f290e1 net: l2: openthread: Implement enable API function
It fixes #issues/26220.

openthread_start function is called when L2 enable(iface, true) is
called. openthread_stop is called when L2 enable(iface, false) is
called. openthread_stop makes the device to leave the OpenThread
network.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2020-07-02 08:43:45 -04:00
Enjia Mai 7ac40aabc0 tests: adding test cases for arch-dependent SMP function
Add one another test case for testing both arch_curr_cpu() and
arch_sched_ipi() architecture layer interface.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2020-07-02 08:42:53 -04:00
Stephanos Ioannidis 0cb8c50238 boards: atsamd21_xpro: Support driving on-board LED with PWM
This commit adds the PWM LED definition in the board device tree for
the on-board LED connected to the pin PB30.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-07-02 08:39:33 -04:00
Stephanos Ioannidis 75502d54b6 drivers: ethernet: sam_gmac: Add SOC_FAMILY_SAM0 dependency
The Atmel GMAC Ethernet driver may be used by both the SAM series
(e.g. SAM E70) and SAM0 series (e.g. SAM E54) SoCs.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-07-02 08:37:17 -04:00
Stephanos Ioannidis 4b66aae3d3 tests: net: vlan: Fix typos
Fix typos in the test assert messages ("numer" to "number").

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-07-02 08:37:17 -04:00
Markus Becker 350bab6d8c net: openthread: handle non mesh-local IPv6 addresses as DHCPv6
OpenThread BR can assign addresses via DHCPv6 or when acting as an
NCP, addresses can be added manually. Currently, those addresses are
handled in the same way as auto-configured addresses.

This patch maps the newly introduced mAddressOrigin of otNetifAddress to
Zephyr's net_addr_type.

This way an application can register a handler and differentiate by type
of assignment:

```
static void handler(struct net_mgmt_event_callback *cb,
                    u32_t mgmt_event,
                    struct net_if *iface)
{
  if (iface->config.ip.ipv6->unicast[i].addr_type == NET_ADDR_DHCP) {
  }
}
```

Signed-off-by: Markus Becker <markus.becker@tridonic.com>
2020-07-02 08:36:27 -04:00
Stefano Manni 92f142c535 tests: adc: configure adc_api test for waveshare_open103z
Configures the adc api test to use the board waveshare_open103z.

Signed-off-by: Stefano Manni <stefano.manni@gmail.com>
2020-07-02 08:35:48 -04:00
Stefano Manni 8d9942ddab board: arm: add support for waveshare_open103z
Add support for the board Waveshare Open103Z
based on a STM32F103Zx processor.

Signed-off-by: Stefano Manni <stefano.manni@gmail.com>
2020-07-02 08:35:48 -04:00
Fabio Utzig b6a14265e7 drivers: flash: at45: fix page-size writing wrap
When writing buffers larger then page-size, there is already a routine
that checks wrap around and adjusts offsets, but this routine was
missing incrementing the data pointer, which would results in
rewriting the same page-size bytes over and over. This adds the proper
increment code.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-07-02 08:33:40 -04:00
Fabio Utzig f81c5190ec drivers: flash: at45: fix non-initialized warning
Silence a gcc warning due to possible return of unitialized variable in
erase function. This could only happen if size == 0, which doesn't seem
likely, but initializing the variable to zero should fix the issue.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-07-02 08:33:40 -04:00
Andreas Sandberg 6a4ebe5949 drivers: lora: Add SX126x LoRa radio support
Add support for the SX126x series of LoRa radios using the
LoRaMAC-Node HAL.

This driver currently makes the following assumptions:

  * DIO1 is used as an interrupt line.

  * There is an RF switch selecting between the TX and RX ports and
    that switch is controlled by DIO2.

  * There is either no TCXO or the TCXO is controlled by DIO3.

Specifically, the limitations above mean that modules that use GPIOs
to control the RF switch are currently not supported. Support for such
modules would need changes to the LoRaMAC-Node code.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-07-02 08:32:37 -04:00
Andreas Sandberg 3d1fa70e80 dts: bindings: Add bindings for Semtech SX126x
Add device tree bindings for the Semtech SX1261 and SX1262
radios. These will be used by Zephyr's LoRa drivers.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-07-02 08:32:37 -04:00
Andreas Sandberg ba330ec765 drivers: lora: Prepare Kconfig for additional radios
Add a new configuration option, LORA_SX12XX, that is shared for all of
the LoRaMAC-node-based radio drivers. By default, the appropriate
driver for the LoRa radio in the device tree is included is included
in the build.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-07-02 08:32:37 -04:00
Maksim Masalski 223723e8a9 tests: mem protect syscalls update Doxygen tags, fix API, misprints
1. Doxygen tags updates of the existing tests.
2. Fixed use of API K_MSEC in test_syscall_torture
3. Removed misprints

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-02 08:26:12 -04:00
Jui-Chou Chung 403cf0a27c file system: storage: Update the indentation
Update the indentation for shift operator.

Signed-off-by: Jui-Chou Chung <jui-chou.chung@nordicsemi.no>
2020-07-02 08:25:33 -04:00
Jui-Chou Chung 959e4644fd file system: storage: Fix the memory size output
In fat_fs example, if we choose a large size SD card to connect with,
the result of memory size calculation coule be wrong due to the missing
brace for manipulating operator priority.

Fixes #26266.

Signed-off-by: Jui-Chou Chung <jui-chou.chung@nordicsemi.no>
2020-07-02 08:25:33 -04:00
Dominik Ermel 03df4d3fb0 tests/drivers/flash_simulator: Add tests for non-0xff erase
Modify and add tests to support simulation of non-0xff erased flash
devices.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-07-02 08:24:19 -04:00
Dominik Ermel bec0c7f279 drivers/flash/flash_simulator: Fix flash_sim_write
flash_sim_write did not work correctly when simulating flash with
non-0xff erase value.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-07-02 08:24:19 -04:00
Michael Hope af8584feee boards: arm: remove the explicit --offset flag
The preceeding patches causes bossac to automatically pull the flash
address from DeviceTree, so drop the explicit flag.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-02 08:23:03 -04:00
Michael Hope bb8277962d scripts: bossac: automatically pull the flash offset from the config
BOSSAC uses a bootloader, so pull the flash address from DeviceTree or
the config and use if the version of BOSSAC supports offsets.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-02 08:23:03 -04:00
Michael Hope 4ac195e0af scripts: bossac: add support for bossac 1.9.1
BOSSA 1.7 has built-in bootloader offset handling while 1.9.1
requires the user to supply the offset.  Add support for both by
sniffing the help output and warn the user if the flags needs adding.

Related to #22062

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-02 08:23:03 -04:00
Roman Vaughan ac6fec45e7 drivers: led_strip: Add support for external SPI CS on APA102 LED strips
Some boards may include an APA102 LED on an existing SPI bus. With
additional circuitry, chip select is supported where the APA102
lacks a built in CS pin.

This patch allows CS to be defined in the devicetree (through .dts
files) and utilised in the apa102.c driver if it's available. Preserving
old behaviour if no chip select is defined.

Signed-off-by: Roman Vaughan <nzsmartie@gmail.com>
2020-07-02 08:22:31 -04:00
Grzegorz Szymaszek 285ffe9727 boards: stm32f030_demo: enable stm32flash in addition to OpenOCD
This commit makes it possible to use stm32flash for flashing (with west)
the STM32F030 Demo Board. OpenOCD is still the default, so in order to
use stm32flash, one must invoke ‘west flash’ with ‘-r stm32flash’.

Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl>
2020-07-02 07:18:33 -05:00
Michael Hope 226f5169a8 boards: arm: enable PWM on the Trinket M0
Enable TCC0, define the PWM LED, document, and add to the peripheral
list.

Tested using samples/basic/fade_led/

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-02 08:16:24 -04:00
Michael Hope 6c3dcf9725 boards: arm: refresh the configuration for the Trinket M0
The common code now auto selects drivers.  Update the Trinket to match
the Arduino Zero including trimming the defconfig and listing the
supported peripherals.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-02 08:16:24 -04:00
Ioannis Glaropoulos 5487e51bb7 doc: contribute: modifying_contributions: add link to dev processes
Add a link to the page describing our development
processes, as it contains the description of how
to identify issues and pull requests as stale.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-07-02 08:15:53 -04:00
Ioannis Glaropoulos eb005afd2c doc: contribute: Describe policies for modifying patches or others
Add a small section, clarifying the policies around modifying
contributions submitted by other developers.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-07-02 08:15:53 -04:00
Ioannis Glaropoulos 10fcb6175a doc: contribute: add paragraph about cherry-picking content
Add a small paragraph in the Contribution Guidelines
documentation to stress that cherry-picking of patches
into other pull requests is an allowed practive. Add a
link to additional documentation clarifying policies
around modifying patches of other developers.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-07-02 08:15:53 -04:00
Maureen Helm 10c1ded452 drivers: spi: Add optional delays to mcux dspi and lpspi drivers
Adds optional device tree properties to set delays between spi chip
select assert/deassert and clock edges in the mcux dspi and lpspi
drivers. If these properties are not set, then the minimum supported
delays are used.

Verified that tests/drivers/spi/spi_loopback/ still passes on
mimxrt1050_evk (lpspi driver) and frdm_k64f (dspi driver).

Measured with a scope that the pcs-sck-delay and sck-pcs-delay times on
the first spi transaction in the test are reduced from 7.82 us to 20 ns
on mimxrt1050_evk.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-02 07:57:36 -04:00
Henrik Brix Andersen 2bd451e9eb actions: add labels for CAN and EEPROM driver areas
Add automatic labeling of the CAN and EEPROM driver areas.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-07-02 07:56:11 -04:00
Jordan Yates b90c62ac7b mgmt: correct MPU_ALLOW_FLASH_WRITE selection
Select MPU_ALLOW_FLASH_WRITE when ARM_MPU is enabled, not CPU_HAS_MPU.
MPU_ALLOW_FLASH_WRITE is only defined as a symbol when ARM_MPU is
enabled. ARM_MPU is only defined when CPU_HAS_MPU is defined, so the
CPU_HAS_MPU dependency can be dropped.

This fixes a build error when MCUMGR_CMD_IMG_MGMT is enabled but
ARM_MPU is not.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-07-02 12:28:06 +02:00
Jordan Yates ab3e778f47 wifi: winc1500: Add chip select flags
Adds the chip select devicetree flags to the spi_cs_control instance.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-07-01 16:40:03 -05:00
Jordan Yates ac66b76934 sensor: ms5607: Add chip select flags
Adds the chip select devicetree flags to the spi_cs_control instance.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-07-01 16:40:03 -05:00
Jordan Yates f7e2265fb8 sensor: lsm6dsl: Add chip select flags
Adds the chip select devicetree flags to the spi_cs_control instance.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-07-01 16:40:03 -05:00
Jordan Yates adf1c1cfe9 sensor: lis2ds12: Add chip select flags
Adds the chip select devicetree flags to the spi_cs_control instance.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-07-01 16:40:03 -05:00