Commit graph

45978 commits

Author SHA1 Message Date
Morten Priess
5a10f27f13 Bluetooth: controller: Make WL size configurable
In architectures supporting more than 8 WL entries, e.g. pure
software implementations, it is desirable to be able to increase the
WL size. This change increases the range to 1..16 for SOCs other than
nRF5x and OpenISA.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2020-11-17 20:03:00 +01:00
Andrzej Puzdrowski
77fb9b8b2c doc/releases: USB DFU class upgrade record
Added note on supported DFU for single-slot.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-11-17 19:51:00 +01:00
Vinayak Kariappa Chettimada
ef2ece82c0 Bluetooth: controller: openisa: Fix sanitycheck failures
Fix sanitycheck failures when building
samples/bluetooth/peripheral_hr for rv32m1_vega_ri5cy
platform.

Updates from nRF platform related to 255 byte AD data
support have been directly copied into openisa port to
fix build failures.

Relates to commit c2fc629dd2 ("Bluetooth: controller:
255 byte AD payload support").

Fixes #29967.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-17 19:47:27 +01:00
Vinayak Kariappa Chettimada
05ca10001e Bluetooth: controller: nrf: Fix sanitycheck failures
Fix sanitycheck failures covered by following tests:

`./scripts/sanitycheck -p nrf51dk_nrf51422 -T tests/bluetooth/init`

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-17 19:47:27 +01:00
Vinayak Kariappa Chettimada
b2b93871a3 Bluetooth: controller: Fix minor typo in comment
Fix minor typo in comment that was not caught by check
compliance stage in PR CI.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-17 19:47:27 +01:00
Joakim Andersson
58be4c89f6 Bluetooth: host: Document security changed and no security level change
Document the security changed callback can be called with no change
in the security level when the encryption key has been changed
in the link-layer.

Also update the documentation for set security function to include
the bond information so that it matches the documentation for security
changed callback.

Update pairing process to pairing procedure for consistency.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-11-17 19:40:58 +01:00
Thomas Ebert Hansen
002b579416 bluetooth: controller: Add vendor operations to TICKER_USER_THREAD_OPS
Allow vendor specific increase of user operation capacity for
THREAD, to support queuing additional ticker operations.

Relocate TICKER_USER_<XXX>_VENDOR_OPS to before TICKER_USER_<XXX>_OPS.

Signed-off-by: Thomas Ebert Hansen <thoh@oticon.com>
2020-11-17 19:37:39 +01:00
Maureen Helm
2d9b89e44f dts: riscv: Remove peripheral aliases from OpenISA RV32M1 SoC
Removes peripheral aliases from the OpenISA RV32M1 SoC, which are no
longer being used after converting their associated drivers to use
DT_INST macros.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-11-17 11:31:47 -06:00
Maureen Helm
370d02743a dts: arm: Remove peripheral aliases from NXP SoCs
Removes peripheral aliases from all NXP SoCs (Kinetis, LPC, and i.MX),
which are no longer being used after converting their associated drivers
to use DT_INST macros. The watchdog alias remains because it is used by
tests/drivers/watchdog/wdt_basic_api/

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-11-17 11:31:47 -06:00
Emil Obalski
773f02e6e9 usb: drivers: Fix ZLP handling for Nordic driver.
ZLP - zero length packet is used to indicate that the device
has no more data to send. If the Host asks for more data that the
device can provide and the data size is mutliplication of Endpoint
wMaxPacketSize then the device must terminate the data transfer
with ZLP.

Until this patch Nordic device driver controller was not aware of
the requested data length and could not determine when the ZLP was
required.

This patch introduces a fix that prevents the driver from starting
setup stage before the ZLP is being send.

For consistance with the Zephyr USB stack sending ZLP must be
issued from the stack level. Making trans_zlp flag true results
in blocking the driver from starting setup stage without required
ZLP.

After the data transfer finishes the driver will be prepared for ZLP
and will call back the stack to start writing ZLP. After the ZLP
is being send the driver will automatically start status stage and
end the Control Transfer.

This patch also removes CONFIG_USB_DEVICE_DISABLE_ZLP_EPIN_HANDLING
and aligns Nordic driver with others.

Without this patch the issue could occur when handling get requests.
Typical case is string descriptor of length equal to wMaxPacketSize.
Hosts usually asks for wLength = 255 Bytes when string descriptors
are being requested. In that case to successfully finish the data
stage of the Control transfer the device must send wMacPacketSize
Bytes of actual string descriptor and then ZLP to indicate that no
more data are present. After ZLP the status stage may start and the
request is finished successfully.

Without this patch the driver will not send ZLP making it unable
to end the Control Request successful - this may lead to failing
'Device Descriptor Test' from USB3CV test tool.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-11-17 18:06:26 +01:00
Emil Obalski
2eb2bc325e usb: drivers: Save setup packet in the driver structure.
This patch adds setup packet copy in the Nordic device
controller driver (ubs_dc_nrfx.c). This patch is required
for subsequent patch that fixes isssues with ZLP handling.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-11-17 18:06:26 +01:00
Emil Obalski
b3c63425a0 usb: driver: Reduce Endpoint buffer pool.
IN Endpoints does not require to have initialized internal
buffer. The data send are not copied to the internal buffer
anymore. This patch reduces memory usage for IN Endpoints.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-11-17 18:06:26 +01:00
Emil Obalski
8dacb99e5e usb: drivers: Do not fragment IN transfers for Nordic.
Nordic device driver controller (usb_dc_nrfx.c) was fragmenting
IN transfers longer than wMaxPacketSize long using its
internal buffers. Buffers were reserved for each endpoint.
Because the Low level driver (nrfx) is capable of handling
fragmentation, there is no need to do it at the driver
controller level. Data pointer is used directly to create
the nrfx transfer. Endpoint buffers are not required anymore
and could be dropped.

This patch removes fragmentation of in transfers and omits
usage of internal endpoint buffers. Buffer could be later
freed by subsequent patches.

Nordic low level usbd driver is also capable of adding ZLP
if required however for consistance with the Zephyr USB device
stack ZLP must be triggered from stack level.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-11-17 18:06:26 +01:00
Martí Bolívar
8ea9941fe3 samples: led_ws2812: force SPIM on nRF52-DK
The WS2812 SPI driver needs the pixel data to be clocked out on time,
with no gaps between SPI frames. This makes the nordic,nrf-spi
compatible unsuitable for use, since the corresponding driver doesn't
use EasyDMA to clock out the tx buffers.

Force the arduino_spi node in the DT to SPIM mode by setting its
compatible to nordic,nrf-spim. On nRF52832, this driver is disabled by
default due to Product Anomaly Notice (PAN) 58.

We happen to not be affected by PAN 58 in this instance, because we
never read data over the SPIM, only write it. So it's safe to enable
the SPIM driver. This requires a board-specific Kconfig fragment for
nRF52-DK to enable CONFIG_SOC_NRF52832_ALLOW_SPIM_DESPITE_PAN_58.

Fixes: #29877
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-11-17 10:24:33 -06:00
Andrzej Puzdrowski
03aed881f4 doc/releases: update release note by latest MCUBoot changes
Notes on MCUBoot changes and flash_area API extension.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-11-17 10:10:40 -06:00
Wentong Wu
c85d353ca4 logging: add STP transport and raw data output support for syst
Add STP transport support for MIPI SyS-T with Kconfig MIPI_SYST_STP,
this is following SyS-T spec Section 7.
And with Kconfig MIPI_SYST_RAW_DATA, add raw data output support for
MIPI SyS-T protocol stack.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2020-11-17 10:09:19 -06:00
Marcin Niestroj
480a682220 modules: mbedtls: introduce MBEDTLS_MEMORY_DEBUG option
This option allows enable mbed TLS debugging of buffer allocator memory
issues.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-11-17 10:02:17 -06:00
Andrei Gansari
c1356f6a11 boards: nucleo_l552ze_q: set board isolation to 2
According to new Kconfig.tfm isolation is set by default to 2 on Nucleu
L552ZE Q board.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-11-17 17:26:20 +02:00
Andrei Gansari
a0aa6e085e modules: tfm isolation and profile
Add TFM_PROFILE and TFM_ISOLATION_LEVEL options. Options are used to set
up custom board configurations, i.e. LPC55S69 uses medium_profile to fit
TFM images in a small flash area.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-11-17 17:26:20 +02:00
Ioannis Glaropoulos
cf02950258 MAINTAINERS: cleanup inline comments
Cleanup comments: # Provisional entry, subject to approval
That's because the MAINTAINERS file was reviewed in the
last TSC F2F and the entries are not provisional any more.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-11-17 10:20:22 -05:00
Martí Bolívar
92ecc7866c Revert "BK: Tmp increase number of jobs (DNM)"
This reverts commit 8269a0b9c6.
It was merged by mistake.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-11-17 07:47:50 -06:00
Ioannis Glaropoulos
30b44e276b tf-m: Add help text in some un-documented TF-M Kconfig options
Add help text in some newly introduced and un-documented
TF-M Kconfig options: REGRESSION and IPC.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-11-17 14:39:52 +02:00
Øyvind Rønningstad
a28da5118d tfm: Configure TFM via Kconfig instead of Cmake
Add Kconfig options that will be used by the module
to call the function with the desired parameters.
Refactor the tfm_integration samples and
the supported boards.

Update west.yml to bring in Cmake changes that use the new KConfigs.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2020-11-17 14:39:52 +02:00
Vinayak Kariappa Chettimada
27dcc39494 Bluetooth: controller: Fix regression in central event close
Fix regression in connection radio event close in central
role introduced in commit 222dca5598

Fixes #29957.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-11-17 12:16:36 +01:00
MORGER Patrick
d2cebd8dab include: drivers: add missing extern "C" in led.h and lora.h
The following lines are missing:
extern "C" {

and

}

Signed-off-by: MORGER Patrick <patrick.morger@leica-geosystems.com>
2020-11-17 13:08:47 +02:00
Andrzej Puzdrowski
450b82aeb7 storage/stream: elimination of usage of the flash API internals
Module was using flash driver implementation API call
`page_layout()` which is part driver implementation
interface API.

This patch re-implement this part of code using
`flash_page_foreach()` public API function.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-11-17 11:34:35 +01:00
Peter Bigot
607b390ba4 lib: cbprintf: fix pointer justification and padding
Although flags with pointers are not defined behavior, there is a
desire to have them work, so add a test and fix the complete
implementation so it passes.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-17 11:34:25 +01:00
Nicolas Pitre
d583af7707 lib/os/cbprintf_nano.c: simplifications and enhancements
Simplify the code to increase readability, and fix right-padding
for %p.

Also, the compiled code is smaller with those changes applied.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-11-17 11:34:25 +01:00
Krzysztof Chruscinski
e612587e28 drivers: clock_control: nrf: Add handling of HFCLK192M_STARTED event
An event was not handled by the clock control resulting in assert
and lack of notification about clock readiness.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-11-17 11:32:10 +01:00
Anas Nashif
87e3ec4417 sanitycheck: test on integration platforms on top of default platforms
When running sanitycheck without any platform filters (-p option), we
take the default platforms and run on those only. When the -G options is
used for integration testing, the platforms listed as integration
platforms are not being added on top of default platforms.

This change adds integration platforms to the list an treats
integration_platforms as a positive filter, so that
integration_platforms are always being considered.

Fixes #29829

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-11-17 11:31:39 +01:00
Jukka Rissanen
66332cc648 net: scripts: Add dumb_http_server_mt sample to Docker testing
Add a way to run dumb_http_server_mt sample application against
HTTP get script (using curl) running in Docker.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:25:36 +02:00
Jukka Rissanen
c75fc93f29 samples: net: dumb_http_server_mt: Add connection mgr support
Start the listeners after the "connected" event from connection
manager has been received.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:25:36 +02:00
Jukka Rissanen
eaebfd9a91 samples: net: dumb_http_server_mt: Quit if client says so
If the client sends OK or FAIL, then it means that we are run
under a test system and we should stop running and exit so that
the test runner (scripts/net/run-sample-tests.sh) can report
success or failure.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:25:36 +02:00
Jukka Rissanen
f0edf73809 samples: net: dumb_http_server_mt: Add support for large file
If user sets CONFIG_NET_SAMPLE_SERVE_LARGE_FILE then the sample
will return 100KB file. By default 2KB file is returned.
This is used by the Docker based testing.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:25:36 +02:00
Czeslaw Makarski
35be0412f6 west.yml: Update hal_nordic revision
This brings a bugfix for warning and linker error of debug
build of ieee802154 driver.

Signed-off-by: Czeslaw Makarski <Czeslaw.Makarski@nordicsemi.no>
2020-11-17 12:18:19 +02:00
Jukka Rissanen
861c2c78f0 net: scripts: Add gPTP support to sample testing
Allow gPTP sample to be run via run-sample-tests.sh script.
This makes it possible to do simple smoke testing and verify that
gPTP stack is not broken.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:15:37 +02:00
Jukka Rissanen
b31f1e3dc7 samples: net: gptp: Add support for running the sample X seconds
This feature is used by scripts/net/run-sample-tests.sh script
which connects the Zephyr gPTP sample to Linux gPTP daemon running
on a Docker container.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-11-17 12:15:37 +02:00
Marek Pieta
3b4ead139f Bluetooth: controller: Fix TX power dependencies
Change adds missing TX power dependencies. nRF52833 and nRF52820 SoCs
also support higher TX power values.

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2020-11-17 11:52:06 +02:00
Martin Åberg
a6093804a9 net: ip: enforce alignment in struct cmsghdr
The alignment is needed when using CMSG_DATA() to access a uint64_t
when an object of type struct cmsghdr is allocated on the stack.

Also update the ALIGN_H and ALIGN_D macros to better match the
description in RFC 3542:
   "The macros ALIGN_H() and ALIGN_D(), which are implementation
   dependent, round their arguments up to the next even multiple of
   whatever alignment is required for the start of the cmsghdr structure
   and the data, respectively."

This commit makes the following test pass on qemu_leon3:
- net.socket.udp. It previously generated an unaligned data access
exception when a uint64_t value was accessed via CMSG_DATA().

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
e6f4140b30 zephyr: introduce z_max_align_t
Similar to the C11 type max_align_t.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
137e8528ec net: run the net.pm test on LEON
Adds the test to at least one big-endian system.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
3658f74d17 net: ipv6: fixed endian issue
A cast made assumption on how data is stored.

This commit makes the following test pass on qemu_leon3:
- net.udp

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
634b8fd58c net: dhcpv4: fixed endian issue
This makes the following test pass on qemu_leon3:
- net.dhcp

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
fb18a6e2f7 net: ipv6_fragment: fixed endian issue
A cast made assumption on how data is stored.

This commit makes the following test pass on qemu_leon3:
- net.ipv6.fragment

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
b9d0414292 net: use UNALIGNED_PUT() to access IP address
This commit allows the net_ipv6_addr_create_iid() argument addr to
have relaxed alignment.

This commit makes the following tests pass on qemu_leon3:
- net.6lo

Details:

sparc-zephyr-elf-gcc 9.2.0 compiles the beginning of
net_ipv6_addr_create_iid(),

  addr->s6_addr[0] = 0xfe;
  addr->s6_addr[1] = 0x8e;
  UNALIGNED_PUT(0, &addr->s6_addr16[1]);
  UNALIGNED_PUT(0, &addr->s6_addr32[1]);

into

  400089d4 <net_ipv6_addr_create_iid>:
  400089d4:       9d e3 bf a0     save  %sp, -96, %sp
  400089d8:       03 3f a0 00     sethi  %hi(0xfe800000), %g1
  400089dc:       c0 2e 20 04     clrb  [ %i0 + 4 ]
  400089e0:       c2 26 00 00     st  %g1, [ %i0 ]
  400089e4:       c0 2e 20 05     clrb  [ %i0 + 5 ]
  400089e8:       c0 2e 20 06     clrb  [ %i0 + 6 ]
  400089ec:       c0 2e 20 07     clrb  [ %i0 + 7 ]

%i0 is the function argument "addr". %g1 is prepared with the value
0xfe800000. The "clrb" instruction sets a single byte in memory to
0 and has no alignment restriction.

We get an unaligned exception on PC 400089e0 when %i0 ("addr") is
not a multiple of 4. The instruction "st" stores the full 32-bit
register %g1 to memory address in %i0. The effective address (%i0)
of the 32-bit register store is required to be naturally aligned by
the architecture.

The compiler assumes that "addr" is aligned according to its type
and has knowledge about the data representation.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
5dcdf198da net: improved test for IPv6 pton() and ntop()
Represent IPv6 addresses as groups of 16-bit values in test vectors.

This commit corrects the following two test issues on big endian
systems:

  START - test_ipv6_pton_1
  Failed to verify ff08::
  against 0:ff08::

  START - test_ipv6_ntop_1
  Failed to verify 0:ff08::
  against ff08::

Makes the following tests pass on qemu_leon3:
- net.util

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
a5293567c0 SPARC: adjust network stack stack sizes
Makes the following tests pass on qemu_leon3:
- net.ipv6
- net.tcp2.simple

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Martin Åberg
cd0418e5a9 boards: sparc: add netif capability
Allows for network related tests to run on the SPARC board
configurations.

Signed-off-by: Martin Åberg <martin.aberg@gaisler.com>
2020-11-17 11:44:16 +02:00
Hubert Miś
9ec8aec794 samples: boards: nrf: ieee802154: New serialization sample
A new sample exposing IEEE 802.15.4 radio controller using serialization
over IPM drivers.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2020-11-17 09:56:25 +01:00
Marcin Niestroj
09f6e8a112 net: hostname: fix logging hostname string
Following errors occuring after enabling debug logs:

  log: argument 2 in source net_hostname log message "%s: (%s): \
    Hostname set to %s" missinglog_strdup().
  log: argument 2 in source net_hostname log message "%s: (%s): \
    New hostname %s" missinglog_strdup().

Fix that by printing CONFIG_NET_HOSTNAME directly in the first case and
using log_strdup() in the second.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-11-17 10:41:49 +02:00