Commit Graph

45704 Commits

Author SHA1 Message Date
Andrzej Puzdrowski 19e43e2e04 usb/class/usb_dfu: signal dfuMANIFEST_SYNCH after flashing is done
End of DFU operation was signaled after the last usb dfu request was
received. Therefeore wait_for_usb_dfu() terminated so fast that
dfu_work_handler() was not called by k_work_queue befor.

wait_for_usb_dfu() should terminate after DFU operation was completed.

For fix that k_poll_signal_raise() was moved after the flash write
operation.

fixes #29611

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-30 15:58:01 +01:00
Martí Bolívar 2485d76bf3 doc: api: sort the API overview alphabetically
This makes it easier to scan. The sorting is done based on the text
that appears in the HTML, not the :ref: label name.

In the case of the DMIC API, change the title of the document to match
the "Audio Codec" document so we can keep those together.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-10-30 15:57:30 +01:00
Enjia Mai 90e6f21d20 tests: modify the test case gen_isr_table using ztest
Modify the gen_isr_table test case to using ztest. Although it was
split up to three test cases, the test logic and the tested platform
are totally the same as previous one.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2020-10-30 15:57:03 +01:00
Anas Nashif 4cd63abafd ci: add more fields to versions.json
Add date and if a commit should be considered for weekly testing.
This will still work with the old format.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-30 15:56:52 +01:00
Emil Obalski 312429be3c usb: samples: Add Extension descriptor to webUSB sample.
WebUSB sample is using BOS descriptor. Because of that
the bcdUSB field of device descriptor is set to 0x0210.
This requires for the BOS descriptor to have LPM support.
LPM support use additional descriptor that the HOST can
read by requesting BOS desc. The descriptor is called
Extension descriptor and is specified in `USB Link Power
Management ECN` document considered a part of USB 2.0
spec.

This patch adds missing part of the BOS descriptor and
fixes issue with webUSB sample not passing i'LPM L1 Suspend
Resume Test' from USB3CV test tool.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-10-30 15:56:13 +01:00
Emil Obalski 7a252b90dc usb: samples: Register BOS capabilities before USB enable.
BOS descriptor capabilities shall be registered before the USB
is enabled.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-10-30 15:56:13 +01:00
Vinayak Kariappa Chettimada 84096455ad Bluetooth: controller: Adv set terminated event on Directed Adv timeout
Add generation of Advertising Set Terminated event on High
Duty Cycle Directed Advertising Timeout.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-30 15:55:57 +01:00
Enjia Mai 761eafa57b tests: improve test case descriptions of arch layer interface
To add more test case descriptions for architecture layer interface
arch_start_cpu().

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2020-10-30 15:55:42 +01:00
Vinayak Kariappa Chettimada ad348337a5 Bluetooth: controller: Reduce use of ARG_UNUSED on auto variables
Reduce the use of ARG_UNUSED on auto variables and try to
use conditional compilation where appropriate.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-30 15:54:56 +01:00
Gerard Marull-Paretas fc9f9059b5 boards: arm: move ethernet pinmux to DT pinctrl on all STM32 boards
Move Ethernet pinmux settings to DT pinctrl on all boards based on
STM32.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-10-30 15:54:13 +01:00
Gerard Marull-Paretas c8687bc2e4 drivers: ethernet: stm32: add support for DT pinctrl
Add support for configuring Ethernet pins using DT pinctrl entries. Note
that F1 series pinctrl support is not handled as the driver does not
support F1.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-10-30 15:54:13 +01:00
Dominik Ermel e7886c6634 fs: fs_unmount will return -ENOTSUP if not implemented by driver
The commit changes error handling by fs_unmount; the function will
return -EINVAL if mount point, described by mp, is not mounted or
-ENNOTSUP when unmounting is not supported by the driver; in the second
case it will also log error.

Additionally to the above changes, checks for correct mnt_path and
mnt_path, within fs_unmount, have been removed as they are not needed;
only the fs_mount_t->fs pointer is needed to decide whether system is
mounted or not.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-10-30 15:54:04 +01:00
Dominik Ermel 5faf3750bc fs: fs_mount parameter verification before mutex locked block
The commit moves fs_mount parameter verification above mutex lock.
The list of mount points is now checked before attempting to obtain
file system API pointer.
All modifications to mount point data structure, given as a parameter
to the fs_mount, are only applied after every other operation needed
have completed successfully, immediately before adding the mount point
to the list of mount points.
The fs_mount will a warning when mounted file system does not support
unmount.
When a file system does not provide mount function, the -ENOTSUP error
will be returned instead of -EINVAL.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-10-30 15:54:04 +01:00
Andrzej Puzdrowski 053857e09a storage/flash_map: Added function for get erased byte value
Added flash_area_erased_val() function for get value of erased
byte of memory which is under flash area.
This function already exist in MCUBoot and zephyr dfu subsystem
which makes simultaneous usage of both impossible.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-30 15:53:38 +01:00
Andrzej Puzdrowski cc29dbde4f manifes: update mcuboot
Synchronized up to:
https://github.com/JuulLabs-OSS/mcuboot/commit/ce11597

- corrected bugfix JuulLabs-OSS#830 of upgrade issue in swap-move
- changed default for CONFIG_MCUBOOT_CLEANUP_ARM_CODE to n,
- added MPU register clean-up to this option
- bootutil: ecdsa: Fixed CC310 for nRF devices
- zephyr: made flash_area_erased_val() weak
- serial recovery: allow unaligned last image data chunk

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-10-30 15:53:38 +01:00
Peter Bigot 529a2e144e checkpatch: disable PREFER_SECTION
Zephyr doesn't use the __section macro, so stop warnings like this
from producing a compliance rejection.

WARNING:PREFER_SECTION: __section(.device_) is preferred over
   __attribute__((section(".device_")))
#702: FILE: include/device.h:743:
   __attribute__((__section__(".device_" #level STRINGIFY(prio))))

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-10-30 15:51:46 +01:00
Michał Narajowski 3908638bab Bluetooth: Mesh: Fix model tree walk procedure
`bt_mesh_model_tree_walk()` was too simplistic and did not track visited
nodes which caused it to fall into infinite loop. Moreover the double
next jump could skip a level causing depth value to be invalid.

Signed-off-by: Michał Narajowski <michal.narajowski@codecoup.pl>
2020-10-30 16:27:20 +02:00
Lingao Meng 0bcd66ac36 Bluetooth: Mesh: Fix build warning with Warray-bounds
../zephyrNew/subsys/bluetooth/mesh/prov.c: In function
'bt_mesh_prov_reset_state': ../zephyrNew/subsys/bluetooth/mesh
/prov.c:61:2⚠️ '__builtin_memset' offset [52, 292] from
the object at 'bt_mesh_prov_link' is out of the bounds of referenced
subobject 'dhkey' with type 'uint8_t[32]' {aka 'unsigned char[32]'}
at offset 19 [-Warray-bounds] 61 | memset(&bt_mesh_prov_link.dhkey, 0,

Fixes: #29634

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-10-30 10:59:55 +02:00
Ryan Erickson d3dcf49735 drivers: modem: hl7800: Make RX net_bufs configurable
Make receive network buffer count and size
configurable via kconfig.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-10-30 10:09:48 +02:00
Carlo Caione 8941f9a00c x86: mmustructs: Fix define typo
Fix typo s/Z_X96_MMU_RW/Z_X86_MMU_RW/

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2020-10-29 16:44:22 -04:00
Andreas Dröscher a812f3d7b6 adc-mcux: add support for adc16 channel multiplex
Channels 4..7 are multiplexed on adc16. The NXP HAL exposes
ADC16_SetChannelMuxMode but this function is not yet included
in Zephy. The following patch adds channel-mux-b to the dts
enabling the use of the alternate channels of 16 bit adc.

Signed-off-by: Andreas Dröscher <github@anticat.ch>
2020-10-29 13:43:24 -05:00
Luiz Augusto von Dentz 09e95a26a4 Bluetooth: ISO: Fix crash when channel has already been disconnected
If chan->conn is already NULL do not call bt_conn_unref as that will
likely cause a crash, also this make sure that if channel has been
disconnected using bt_iso_chan_disconnect it removes the channel from
connection list before setting the chan->conn to NULL.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-10-29 20:34:55 +02:00
Ryan Chu 385000e8d9 Bluetooth: tester: Set the required minimim security level of LE COC
With this change, these two tests can be supported:
- L2CAP/LE/CFC/BV-11-C
- L2CAP/LE/CFC/BV-14-C

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2020-10-29 20:34:21 +02:00
Ryan Chu 70a27af090 Bluetooth: tester: Clear adv_buf after sending GAP_EV_DEVICE_FOUND
Avoid sending duplicate GAP_EV_DEVICE_FOUND because adv_buf->len was
not cleared.

With this change, the following tests become more stable in a noisy
environment:
- GAP/BROB/OBSV/BV-01-C
- GAP/BROB/OBSV/BV-02-C
- GAP/BROB/OBSV/BV-05-C
- GAP/BROB/OBSV/BV-06-C
- GAP/DISC/RPA/BV-01-C

Co-authored-by: Konstantinos Sotiropoulos
                konstantinos.sotiropoulos@nordicsemi.no

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2020-10-29 20:34:21 +02:00
Ryan Chu efc8459340 Bluetooth: tester: Support SM tests related to OOB
Support the folowing new tests related to OOB pairing:
- SM/MAS/OOB/BI-01-C
- SM/MAS/OOB/BV-01-C
- SM/MAS/OOB/BV-03-C
- SM/MAS/OOB/BV-09-C
- SM/MAS/SCOB/BI-01-C
- SM/MAS/SCOB/BI-04-C
- SM/MAS/SCOB/BV-01-C
- SM/MAS/SCOB/BV-04-C
- SM/SLA/OOB/BI-02-C
- SM/SLA/OOB/BV-02-C
- SM/SLA/OOB/BV-04-C
- SM/SLA/OOB/BV-10-C
- SM/SLA/SCOB/BI-02-C
- SM/SLA/SCOB/BI-03-C
- SM/SLA/SCOB/BV-02-C
- SM/SLA/SCOB/BV-03-C

Co-authored-by: Konstantinos Sotiropoulos
                konstantinos.sotiropoulos@nordicsemi.no
Co-authored-by: Aytürk Düzen ayturk.duzen@nordicsemi.no

Signed-off-by: Ryan Chu <ryan.chu@nordicsemi.no>
2020-10-29 20:34:21 +02:00
Mahesh Mahadevan 9b3f3a6b5f west: nxp: Update to SDK 2.8
MCUX SDK drivers updates to revision 2.8

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-10-29 13:28:44 -05:00
Mahesh Mahadevan 7ad4eb4e40 drivers: eth_mcux: Update to match changes to the SDK driver
1. Merged the single/multiple ring(s) APIs, now these APIs
can handle both which requires passing a ring id.
2. Updated timestamp handling to match the new timestamp
implementation in the SDK driver.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-10-29 13:28:44 -05:00
Mahesh Mahadevan 2183a0f9b6 soc: nxp_imx: Update i.MX8M due to update to SDK drivers
Some of the clock macros have changed with update of SDK drivers
to SDK 2.8

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-10-29 13:28:44 -05:00
Martí Bolívar fff0aee9ee tests: fix accel abstraction violation
As documented in doc/guides/dts/api-usage.rst, the generated
devicetree macros should be considered an implementation detail.

Replace direct usage of one with an equivalent that uses the API.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-10-29 14:04:26 -04:00
Kumar Gala 33db7b5b01 scripts: edtlib: Add support for 'deprecated'
Add the ability to mark a property as 'deprecated' to get a warning that
it will be removed in the future.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-29 11:06:32 -05:00
Kumar Gala b1503ac66c west.yml: Update openamp for v2010.10 release
Update to a newer openamp v2010.10 release

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-29 16:34:15 +01:00
Kumar Gala 4dcdb8022d west.yml: Update libmetal for v2010.10 release
Update to a newer libmetal v2010.10 release

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-10-29 16:34:15 +01:00
Joakim Andersson 92deb9ddba Bluetooth: host: Document and check for disallowed directed advertising
Document and validate advertising parameters for the disallowed
advertising mode high duty cycle directed connectable advertising
using extended advertising PDUs.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-10-29 16:02:57 +02:00
Vinayak Kariappa Chettimada f8889c1d87 Bluetooth: controller: Fix unused variable compiler warning
Fix unused variable compiler warning with asserts disabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-29 14:31:38 +02:00
Vinayak Kariappa Chettimada d0f7961283 tests: Bluetooth: init: Asserts disabled build
Disable assert checks, to build a smaller firmware and also
to uncover any unused variables and arguments.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-10-29 14:31:38 +02:00
Joakim Andersson 5e999a3081 Bluetooth: ATT: Handle encrypt change event unrelated to current req
Fix issue where the encrypt change has an error code, but the
encrypt change request was unrelated to the current ATT request.

This lead to the current ATT transaction being interpreted as finished
an the ATT client would proceed with the next ATT request, which would
fail since the ATT client is now violating the ATT single transaction
rule.

Updated similar if statement checking for the opposite to improve
readability.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-10-29 14:28:40 +02:00
Lingao Meng 627ee1125b Bluetooth: Mesh: Remove `bt_mesh_net_start`
Move `bt_mesh_net_start` functionality to `bt_mesh_start`.

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-10-29 14:17:09 +02:00
Trond Einar Snekvik af5bd00d1c Bluetooth: Mesh: Move labels to transport
Moves the virtual address labels to the transport layer, disconnecting
them from the configuration server.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-10-29 14:14:43 +02:00
YanBiao Hao c9be68532c Bluetooth: Mesh: Add Config Client API
The api is used to reset a node (other than a Provisioner) and
remove it from the network

Signed-off-by: YanBiao Hao <haoyanbiao@xiaomi.com>
2020-10-29 14:13:36 +02:00
Trond Einar Snekvik bf58c4e3a8 Bluetooth: Mesh: light_vnd sample: Remove button text
Removes text from the readme of the onoff_level_lighting_vnd_app
claiming buttons control the LEDs before provisioning, as it's not
accurate.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-10-29 14:12:05 +02:00
Lingao Meng 1e9bd13c99 Bluetooth: Mesh: Fixes Relay to frnd_cred message
If low power node publish with unicast address other
than friend address, the friend node should relayed
this message to all network interface.

When Proxy feature enabled, message from gatt bearer should
relay to adv bearer even relay feature disabled.

Fixes: #29544

Signed-off-by: Lingao Meng <mengabc1086@gmail.com>
2020-10-29 14:07:58 +02:00
Andy Ross 35ca8c97ce boards/qemu_cortex_r5: Adjust clock rates
This qemu device is REALLY slow in icount mode.  When I run it outside
of icount and watch the simulator advance the clock device in real
time, it looks to me like it expects the counter to be running at ~125
MHz.  But it's set to a 12 MHz clock rate in its config, and trying to
use a 1000 Hz tick rate.

At those settings (and with the shift=3 argument to icount), I'm
measuring about 10k cycles to handle a minimal timer interrupt.  But
if you do the math, that comes to 12k cycles per tick.  The interrupt
takes as long as a tick!  That would never work, except for the fact
that the timer driver on this device cheats and doesn't try to align
to ticks (basically ignoring all the lost time).  And even that breaks
on the scheduler_api test (which does both tick and cycle math and
tries to compare them) when it's fixed to properly align itself.

One solution might be to set the clock rate to what qemu appears to
believe is the correct 125 MHz value.  And that causes the test to
complete, but all tests now take ~10 minutes of real time because the
simulator is so slow!

So just make up some clock rates, it's a simulated platform after all.
I chose 5 MHz cycle time and 100 Hz tick rate, which on my device is
about half of "real" speed and very acceptable.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-10-29 07:39:39 -04:00
Andy Ross 0875740a34 tests/kernel/schedule_api: Fix slop in timeslice test
This test is a little subtle: it wants to spawn three threads to run
and be switched out by a timeslice interrupt.  And it wants to consume
half a time slice itself before it starts running.  And, because
timeslicing runs out of the same tick framework in the timer driver,
it needs to align to the start of a tick before the process starts.
And further: it does its own time math not in ticks but in timer
cycles, so it's quite sensitive to slop.

But it's "synchronize to tick boundary" code was actually
synchronizing to a CYCLE boundary, which is just wrong.  And it was
doing this in the wrong order.  It was resetting the timeslice first
and then synchronizing to a tick by spinning, which means that the
test was always going to begin as much as a tick late.  Do the tick
synchronization (via a sleep) first.

Finally, the manager thread that was spawning the new threads lives at
the same priority as the highest priority child threads, which means
it can potentitially wake up on the semaphores that they are giving in
the middle of the test and consume CPU unexpectedly.  Make sure it's
sleeping for the duration.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-10-29 07:39:39 -04:00
Anas Nashif b7d30545e0 manifest: mipi-sys-t: move platform.h
This new revision removes platform.h and uses one from the zephyr tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-29 07:23:40 -04:00
Anas Nashif 8873ade781 logging: mipi-sys-t: move platform.h to main tree
Move the platform.h from the module to the zephyr tree. This file is
zephyr sepcific and belongs in the zephyr tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-10-29 07:23:40 -04:00
Erwan Gouriou 007677e676 boards: stm32: Move SDMMC pin configuration to device tree
Update boards supporting SDMMC to use dts based pinctrl config.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-29 09:21:27 +01:00
Erwan Gouriou 4c9925bcd3 dts/bindings/mmc: stm32: Add pinctrl-0 support
Update binding to support pinctrl-0 property.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-29 09:21:27 +01:00
Erwan Gouriou b9a4e9b3b7 subsys/disk: stm32 sdmmc: Add support for device tree pinctrl
Add required code to support pinctrl setup base don device tree.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-10-29 09:21:27 +01:00
Andrew Boie f4a4583e13 tests: sys_sem: add k_thread_join() calls
There is a race condition between the child threads
exiting, and the child threads getting re-used in the
next scenario. This reproduces more often on SMP systems.

Close the race by joining on the child threads before
exiting any test scenario.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-28 10:29:49 -07:00
Andrew Boie edc5e31d6b x86_64: fix RBX clobber in nested IRQ case
In the code path for nested interrupts, we are not saving
RBX, yet the assembly code is using it as a storage location
for the ISR.

Use RAX. It is backed up in both the nested and non-nested
cases, and the ASM code is not currently using it at that
point.

Fixes: #29594

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-10-28 10:29:32 -07:00