Commit graph

42556 commits

Author SHA1 Message Date
Joakim Andersson
ae4ac87a91 Bluetooth: shell: Add advertising options one-time and directed privacy
Add advertising option for undirected one-time advertising, and
directed advertising using identity, and peer direct is RPA option.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-15 17:49:20 +02:00
Joakim Andersson
411bd99982 Bluetooth: shell: Print PHY and data len info in info command
Print the PHY and data len information from the conn info struct.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-15 15:12:45 +02:00
Joakim Andersson
8482ab64e0 Bluetooth: host: Start persistent advertiser with max conn reached
Allow calling bt_le_adv_start with no connection object available
when not the option BT_LE_ADV_OPT_ONE_TIME has been set. In this
case the advertiser will be restarted once there is a connectable
advertiser object available.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-07-15 15:12:28 +02:00
David Brown
79daf21189 dts: arm: nxp: nxp_lpc55s6x: Use proper code partition
The zephyr,code-parition was set incorrectly to SRAM.  Set it to the
slot0 partition, so that enabling BOOTLOADER_MCUBOOT will place the code
at the proper address.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-07-15 13:29:50 +02:00
David Brown
e2f4b9ef37 dts: arm: nxp: nxp_lpc55s6x: Fix partition table
The partition table in DTS are offsets within the flash device, not
absolute addresses.  The flash doesn't start at 0 on the lpc55s6x
(because of the secure execution bit), but the offsets in the partition
table should.

Signed-off-by: David Brown <david.brown@linaro.org>
2020-07-15 13:29:50 +02:00
Eug Krashtan
ad59e7fec5 net: ip: Fix IPv6 RS message doesn't comply RFC4291
Current implementation of net_ipv6_send_rs() uses
net_ipv6_addr_create_ll_allnodes_mcast() for creating RS packet.
As result we send RS packet to all-nodes destination [FF02::1],
but RFC4291 requires all-routers destination [FF02::2] for RS packets.

Signed-off-by: Eug Krashtan <eug.krashtan@gmail.com>
2020-07-15 13:26:58 +02:00
Maksim Masalski
a3621cecd5 tests: copyright message add year to the existing
Instead of replacing of copyright year with the new one,
necessary to add new to the existing one

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-15 13:26:39 +02:00
Maksim Masalski
2893aa0bc1 tests: mem protection new test inherit resource pool
To improve Zephyr tests, I think that it will necessary to have test,
that verifies a child thread inherits resource pool assignment
of their parent.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-15 13:26:39 +02:00
Maksim Masalski
819197fba0 tests: add new semaphore tests
Add new semaphore tests, to test important features like:
-count limit
-semaphore define at compile time
-mutual exclusion

I decided to add new test cases that can improve Zephyr
semaphore testing infrastructure.
For each new test added informative Doxygen description.

New test cases test next important requirements:
1. test_k_sem_correct_count_limit()
That test verifies that semaphore can be taken correctly by a thread,
and taking of semaphore decrements its count as expected.
2. test_k_sem_define()
Explicit ans standalone test to test semaphore can be defined
compile time.
3. test_sem_queue_mutual_exclusion
Test that our system can provide a traditional counting
semaphore abstraction for mutual exclusion.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-15 13:07:46 +02:00
Daniel Leung
f6d8909a6d boards: mec15xxevb_assy6853: use DTS node labels for PWM pinmux
The DT_INST_* macros for PWM may not exactly point to the hardware
instance (e.g. DT_INST_0 may not point to PWM0). So use the node
labels for a more precise match.

Fixes #26782

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-15 06:14:56 -04:00
Ying ming
6e0c4c79bc tests: memory allocation: add test case
When a block which is released by function free,
the region would be release to heap memory pool.

Signed-off-by: Ying ming <mingx.ying@intel.com>
2020-07-14 19:36:56 -04:00
Nicolas Pitre
6014e5f441 lib/os/heap: remove big_heap restriction for aligned allocations
After commit 8a6b02b5bf ("lib/os/heap: some code simplification in
sys_heap_aligned_alloc()") it is no longer required to have a "big"
heap for aligned allocations to work on 32-bit targets. While the
natural alignment for returned memory has an offset of 4 within a chunk
unit due to the smaller header size, returning to a chunkid from a
memory pointer with an offset of 8 will fall back onto the proper chunk
number once the 4 is substracted and then divided by 8.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-07-14 19:35:52 -04:00
Nicolas Pitre
e9ff53fa2a lib/os/heap: optimize chunk splitting
The code is doing a split in split_alloc(), adding the leftover to the
free list, then splitting the suffix away in sys_heap_aligned_alloc(),
removing the former leftover from the free list, combining it with the
suffix and finally adding the combined chunk back to the free list.

Instead, let's have each allocator do their own splitting only once by
moving the split_alloc() processing upstream rather than downstream.
This also allows for the "used" flag to be set only once at the end
rather than being overwritten along the way.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-07-14 19:35:52 -04:00
Nicolas Pitre
9b538e4079 lib/os/heap: make "solo free headers" into first-class citizens
Instead of limiting the excess split-off to sufficiently large chunks
in split_alloc(), let's allow normal allocations to create "solo free
headers" just like with aligned allocations. There is no point leaving
them in the allocated chunk if the user didn't ask for it. Doing so
makes them eligible for merging at the next opportunity and potentially
reusable sooner.

Also make the validation code aware of them.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-07-14 19:35:52 -04:00
Nicolas Pitre
130963ad2f lib/os/heap: add an additional validation criteria
One fundamental validation criteria is to never have consecutive free
chunks. If that ever happens we failed to merge them. That means a free
chunk must always be surrounded by used chunks.

It is a pain to extend valid_chunk() with new rules as it is.
So a VALIDATE() macro is introduced to make things easier to work with.
It also allows for isolating each test, possibly making VALIDATE() into
__ASSERT() to determine exactly which test is tripping when debugging.

Finally, because of that new validation rule, sys_heap_validate() must
be modified so not to use valid_chunk() while it is flipping all the
"used" flags. So let's run valid_chunk() up front before alterating
chunk headers.

Now sys_heap_validate() has become justifiably more expensive and a few
emulated targets are about to bust the tests/lib/heap test timeout. So
bump the timeout as well.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-07-14 19:35:52 -04:00
Nicolas Pitre
9b617755d2 lib/os/heap: code cleanup
This makes the code cleaner wrt bucket_idx() usage on chunks for which
solo_free_header() is true. In such case the bucket_idx() computation
is useless, and potentially undefined anyway.

In the same vain, move the clearing of the used flag out of
free_chunks() as only one of its callers actually needs that.
Makes free_chunks singular as there is only one chunk (potentially
spanning multiple chunk units) to free.

Also some cosmetic changes for better code uniformity.

No functional changes.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2020-07-14 19:35:52 -04:00
Abhishek Shah
4a68cd9724 boards: arm: bcm958402m2_a72: remove CONFIG_PCIE
Now that PCIE and PCIE_ENDPOINT are made independent,
remove unnecessary CONFIG_PCIE=y from defconfig

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-07-14 19:35:31 -04:00
Abhishek Shah
08ed93fed9 drivers: pcie: refactor pcie directory to make RC and EP independent
With this refactoring of pcie directory, RC drivers are placed under
host/ directory, EP drivers are placed under endpoint/ directory and
they are completely independent of each other.

Signed-off-by: Abhishek Shah <abhishek.shah@broadcom.com>
2020-07-14 19:35:31 -04:00
Anas Nashif
1fc2e43eb3 doc: make device pm APIs show in doxygen docs
Those were not being processed due to Kconfig only exposing the noop
functions.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-14 19:23:15 -04:00
Johan Hedberg
0329027bd8 arch: x86: zefi: Fix assuming segment size being a multiple of 8
The p_memsz field which indicates the size of a segment in memory
isn't always a multiple of 8. Remove the assert and add padding if
necessary. Without this change it's not possible to generate EFI
binaries out of all samples & tests in the tree.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2020-07-14 18:21:38 -04:00
Kumar Gala
3f993837cf ci: remove .shippable.yml
As we've moved to buildkite for CI we aren't using the .shippable.yml
file anymore.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-14 13:34:26 -04:00
Uma Praseeda
ed9750a3a9 Doc: Updating ieee802154_interface Readme
Added a link to IEEE GET program web page to suggest
an option of downloading the specification to the users.

Signed-off-by: Uma Praseeda <uma.praseeda@nordicsemi.no>
2020-07-14 18:00:46 +02:00
Rafał Kuźnia
f2b0bfda8f arch: arm: aarch32: Always use VTOR when it is available
Zephyr applications will always use the VTOR register when it is
available on the CPU and the register will always be configured
to point to applications vector table during startup.

SW_VECTOR_RELAY_CLIENT is meant to be used only on baseline ARM cores.

SW_VECTOR_RELAY is intended to be used only by the bootloader.
The bootloader may configure the VTOR to point to the relay table
right before chain-loading the application.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2020-07-14 16:17:30 +02:00
Andrzej Puzdrowski
4152ccf124 arch/arm/aarch32: ensured SW IRQ relay modes exclusive
Select either SW_VECTOR_RELAY or SW_VECTOR_RELAY_CLIENT
at the time.

Removed #ifdef-ry in irq_relay.S as SW_VECTOR_RELAY was
refined so it became reserved for the bootloader and it
conditionally includes irq_relay.S for compilation.
See SHA #fde3116f1981cf152aadc2266c66f8687ea9f764

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
2020-07-14 16:17:30 +02:00
Rafał Kuźnia
89bf746ebe arch/arm/aarch32: add IRQ relay mechanism to ARMv7/8-M
This patch allows the `SW_VECTOR_RELAY` and
`SW_VECTOR_RELAY_CLIENT` pair to be
enabled on the ARMv7-M and ARMv8-M architectures
and covers all additional interrupt vectors.

Signed-off-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-07-14 16:17:30 +02:00
Maureen Helm
e4e92428e5 doc: Replace shippable badge with buildkite badge
Now that we have finished migrating CI from shippable to buildkite,
update the status badge on README.rst.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-14 07:21:44 -05:00
Robert Lubos
38adddac00 net: lwm2m: Reinitialize address length before recvfrom is called
`addrlen` parameter is updated on each `recvfrom` call, indicating the
actual address length returned. In case both, IPv4 and IPv6 are used on
different sockets (i. e. on regular LWM2M socket and FOTA socket), the
returned address length will differ.

In case `from_addr_len` is not reinitialized on each iteration, the
value stored in the `from_addr_len` variable will eventually indicate
the smaller IPv4 address size, therefore resulting in a failure in a
consecutive call on an IPv6 socket.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-07-14 13:04:37 +02:00
Robert Lubos
fddeb59911 net: lwm2m: Protect send() calls with a mutex
Although LwM2M engine uses cooperative threads, the internal `send()`
implementation might trigger context switch when it calls a kernel
function, therefore resulting in `send()` call being entered from both
the LwM2M thread and the retransmit work.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2020-07-14 13:04:37 +02:00
Ioannis Glaropoulos
e80e655b01 arch: arm: cortex_m: align vector table based on VTOR requirements
Enforce VTOR table offset alignment requirements on Cortex-M
vector table start address.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-07-14 13:03:25 +02:00
Emil Obalski
045d12a9f2 usb: audio: Correct typos in USB audio bindings.
This patch corrects misspells in USB audio bindings.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-07-14 13:03:04 +02:00
Vinayak Kariappa Chettimada
2ca56a2ab7 Bluetooth: controller: Add missing aux acquire on periodic adv
Added implementation to acquire and initialize auxiliary
channel instance on use of periodic advertising.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-14 12:52:41 +02:00
Karsten Koenig
4ef29b34e3 tests: drivers: spi: spi_loopback: remove workaround
Due to issue #20589 DEBUG_OPTIMIZATIONS were enabled for the rv32m1 vega
ri5cy vega config. This is now resolved after making sure the spi tx
buffer is always initialized and the rv32m1 ri5cy core stack properly
initialized, so this workaround can be removed.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2020-07-13 15:00:19 -05:00
Karsten Koenig
2e61137cc9 arch: riscv: thread: Init soc context on stack
The optional SOC_CONTEXT carries processor state registers that need to
be initialized properly to avoid uninitialized memory read as processor
state.
In particular on the RV32M1 the extra soc context stores a state for
special loop instructions, and loading non zero values will have the
core assume it is in a loop.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2020-07-13 15:00:19 -05:00
Karsten Koenig
dc725b7451 soc: riscv: rv32m1: Fix optional context save
Saving an extended context for RV32M1 should be optional, but it was
broken due to the offset calculation not taking the according option
into account.

Signed-off-by: Karsten Koenig <karsten.koenig.030@gmail.com>
2020-07-13 15:00:19 -05:00
71e631c2f6 boards: arm: add OpenOCD flash and debug support for the itsybitsy_m4
The Itsybitsy exposes the SWD pins on an unpopulated header on the end
of the board.  Add a OpenOCD config and document how to use it.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-07-13 10:24:13 -05:00
Andreas Sandberg
b5bff2cf48 drivers: lora: sx126x: Use the new pin helpers
User the new pin configuration helpers to reduce boilerplate.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-07-13 13:11:59 +02:00
Andreas Sandberg
2ebd80cd0e drivers: lora: sx126x: Don't initialize control pin to active
The antenna control GPIO was incorrectly initialized to active. This
is unnecessary since the HAL will activate the antenna switch when the
chip enters an active state.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-07-13 13:11:59 +02:00
Andreas Sandberg
23e4a8b64e drivers: lora: Move sx1276 pin helpers to sx12xx common
The new sx1276 pin configuration helpers can be used by the sx126x
driver as well. Move them to sx126xx_common.{c,h} to facilitate reuse.

Signed-off-by: Andreas Sandberg <andreas@sandberg.pp.se>
2020-07-13 13:11:59 +02:00
Maureen Helm
6dc38b570c tests: pwm_api: Use smaller pwm period cycles on kw41z-based boards
The mcux pwm drivers use period cycles as a divisor to calculate the pwm
frequency in hertz. This operation can underflow easily with large
values of period cycles relative to the pwm clock source, causing the
driver to return an error code and the pwm_api test to fail.

Updates the test to use the smaller set of period and pulse cycles on
kw41z-based boards, fixing the test for the frdm_kw41z board.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-13 13:11:37 +02:00
Luiz Augusto von Dentz
ede13428e7 Bluetooth: GATT: Fix not being able to notify
When CONFIG_BT_GATT_NOTIFY_MULTIPLE is selected and the remote has
enabled support for using its procedure data can sometimes not fit
into the buffer since the multiple variant has a bigger header, so
instead of failing immediatelly this attempts to send the data using
the legacy PDU instead so those using bt_gatt_get_mtu - 3 can still be
sent.

Fixes #26106

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2020-07-13 12:23:48 +02:00
Gerson Fernando Budke
7b4bdf3bc7 samples: net: echo_server: Enable atmel_rf2xx tests
Add atmel_rf2xx shield on test list.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
a9780f34a3 samples: net: echo_client: Enable atmel_rf2xx tests
Add atmel_rf2xx shield on test list.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
ebd1d5478b samples: net: echo_client: Update samr21_xpro configs
After Zephyr 2.3.0 release system uses more RAM.  This update
samr21_xpro configuration to allow echo_client be equal to
echo_server configs and remove unnecessary definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
3f5eb6f0e6 samples: net: echo_server: Update samr21_xpro configs
After Zephyr 2.3.0 release system uses more RAM.  This update
samr21_xpro configuration to allow echo_server run again and
remove unnecessary definitions.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
d167205916 samples: net: echo_server: Rem unnecessary configs
The sam4e_xpro and sam_v71_xult configs are unnecessary.  Now
atmel_rf2xx shield will complement all necessary configuration.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
4f107a7705 samples: net: echo_client: Rem unnecessary configs
The sam4s_xplained and sam_v71_xult configs are unnecessary.  Now
atmel_rf2xx shield will complement all necessary configuration.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
9e45fefce3 boards: shields: Introduce atmel_rf2xx module shield
The Atmel RF2xx module shield is a generic solution to enable any Atmel
AT86RF2xx IEEE 802.15.4 transceiver. This module enables IEEE 802.15.4
RF2xx Zephyr driver.

The Atmel RF2xx module shield enables any board with an Atmel Xplained,
Xplained-Pro, Arduino or MikroBus expansion header to connect to
networks operation with IEEE 802.15.4, OpenThread or any other stack
based on this media type.

The Atmel RF2xx module is configured to allow interoperate with other
medias like Ethernet. User need configure network stack properlly.

Fixes #26259.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
32b97ea3d5 boards: arm: sam_v71_xult: Add arduino uno r3 headers
Add arduino uno r3 connectors definitions.  This enable hardware related
GPIOs and drivers to drive external shields.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
5b7697f52b boards: arm: sam_v71_xult: Add atmel xplained-pro headers
Add xplained-pro connectors definitions.  This enable hardware related
GPIOs and drivers to drive external shields.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00
Gerson Fernando Budke
4da1dff1ff boards: arm: samr21_xpro: Add atmel xplained-pro headers
Add xplained-pro connectors definitions.  This enable hardware related
GPIOs and drivers to drive external shields.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-13 11:54:29 +02:00