Commit graph

41120 commits

Author SHA1 Message Date
Marcin Szymczyk
e6b3a33318 soc: nrf: update dts_fixup.h to SPI DT
Commit 94bed60abea53818c8cd723e233799a77c4b4e4b introduced separate
DT symbols for SPI and SPIM. Update dts_fixup.h for all nRF chips
to align with those changes.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2019-12-13 17:10:24 -06:00
Marcin Szymczyk
03a99e0d7f soc: nrf: update dts_fixup.h to I2C DT
Commit a8a85c21cff7319e80af16688ea6076594fab7c8 introduced separate
DT symbols for TWI and TWIM. Update dts_fixup.h for all nRF chips
to align with those changes.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2019-12-13 17:10:24 -06:00
Martin Jaeger
39444ba9a2 boards: arm: nucleo_l452re added
Port based on existing nucleo_l432kc and nucleo_l476rg

Signed-off-by: Martin Jaeger <17674105+martinjaeger@users.noreply.github.com>
2019-12-13 17:02:40 -06:00
Martin Jaeger
3d1834e5d6 dts: arm: stm32l452 dtsi files updated
Fixed warning for uppercase hex addresses and added stm32l452Xe.dtsi

Signed-off-by: Martin Jaeger <17674105+martinjaeger@users.noreply.github.com>
2019-12-13 17:02:40 -06:00
Yihui Xiong
5b49027abd boards: add ADC config to nrf52840_mdk
ADC is supported by nRF52840, so add it to nrf52840_mdk.

Signed-off-by: Yihui Xiong <yihui.xiong@hotmail.com>
2019-12-13 16:43:20 -06:00
Peter Bigot
8162e586e3 kernel: sched: assert when k_sleep invoked from interrupt context
Fix a gap where k_sleep(K_FOREVER) could execute a code path that
would not verify that the call was not from interrupt context.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-13 15:47:43 -05:00
Daniel Leung
218b45b749 logging: fix warning of array subscript having type char
In the count_s() function, with -Wchar-subscripts, GCC warns
about array subscript having type ‘char’ with the isalpha()
call. Since isalpha() takes an int, so do a type-cast there
to get rid of the warning.

This happens on XCC which is based on GCC 4.2.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-13 13:24:39 -05:00
Daniel Leung
37f94d66ab cmake: extra_flags: fix EXTRA_CPPFLAGS being applied as macros
The EXTRA_CPPFLAGS is applied via zephyr_compile_definitions()
instead of zephyr_compile_options(), which makes all specified
options as macros. So fix it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-13 13:23:40 -05:00
Josh Gao
88ac292f77 doc: s/devicetree/device tree/
Commit 27e5dd13 fixed a bunch of uses of "device tree" in the
documentation, but accidentally hit the part of the documentation
that stated that "devicetree" should be preferred over "device tree".

Signed-off-by: Josh Gao <josh@jmgao.dev>
2019-12-13 18:47:23 +01:00
Maureen Helm
95743561a6 drivers: serial: Use generated dts macros in mcux flexcomm driver
Uses the generated device tree macros, DT_NXP_LPC_USART_USART_*, in the
mcux flexcomm driver and removes the now unused dts fixups from the
lpc54xxx and lpc55xxx socs.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-12-13 18:45:54 +01:00
Maureen Helm
72e0080e56 drivers: serial: Rename lpc usart shim driver
Renames the lpc usart shim driver to more accurately reflect the
flexcomm hardware IP and to prepare for instantiating it on an SoC
outside the LPC family.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-12-13 18:45:54 +01:00
Asger Munk Nielsen
612984e09c Bluetooth: controller: SW deferred privacy IRK size define
Replaced symbolic constants with a define for the size of IRKs.

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2019-12-13 15:35:25 +01:00
Asger Munk Nielsen
f6f33dfb8f Bluetooth: controller: SW deferred privacy build test
Build test of feature

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2019-12-13 15:35:25 +01:00
Asger Munk Nielsen
1d412c4acd Bluetooth: controller: SW deferred privacy
Enable deferred resolve of RPA

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2019-12-13 15:35:25 +01:00
Joakim Andersson
e978d8620f Bluetooth: controller: Fix rx buffer leak for LL Version priority event
Fix leak of the node_rx buffer when processing the LL version ind as a
priority event. This leak meant being able to establish new connections
was no longer possible, because there weren't enough events to process
the all the events during connection establishment. And instead the LL
ignored the connection request sent by the peer.

Removed the inline extern declaration of a function which had a proper
header included.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-13 15:15:53 +01:00
David Leach
1932d511db doc: update release tagging procedures
Clean up and update release tagging procedures. Use new
document tabs to separate instructions for release
candidate and final releases.

Signed-off-by: David Leach <david.leach@nxp.com>
2019-12-13 08:12:03 -06:00
Luiz Augusto von Dentz
9a111df676 Bluetooth: L2CAP: Add define for signalling timeout
This adds a define for the so called RTX timeout.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
1a7f85cb53 Bluetooth: L2CAP: Document cases where -EAGAIN is returned
This documents the special cases where -EAGAIN is returned which leads
the buffer to be queued.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
b8911a8d35 Bluetooth: L2CAP: Fix data leaks when segment cannot be sent
Now that bt_l2cap_send_cb can fail the buffer state needs to be save
and restored otherwise the data stored on it would be lost.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
bdc1eff35b Bluetooth: L2CAP: Introduce BT_L2CAP_STATUS_SHUTDOWN flag
This introduces BT_L2CAP_STATUS_SHUTDOWN which is used to indicate when
a channel has been shutdown.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
cbcbfee41d net: bt: Don't wait for buffer indefinatelly
This can actually block system critical threads like the syswq.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
f93de735d2 net: bt: Disconnect in case of errors sending a packet
Packets shall never fail to be sent now that they are queued, so if an
error occured there is no point in keep the channel connected.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
cf84216b1a Bluetooth: L2CAP: Offload processing of tx_queue to a work
This offloads the processing of tx_queue to a work so the callbacks
calling resume don't start sending packets directly which can cause
stack overflow.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
99066db21d Bluetooth: L2CAP: Ignore packets received while disconnecting
Drop packets received while disconnecting since they would most likely
be flushed once peer respond there is no gain in keeping them on a
queue.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
5d26693d02 Bluetooth: L2CAP: Add dedicated pool for disconnect request
This prevents disconnect request packets to not being sent due to lack
of buffers normally caused by flooding or congestion.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
aa9a1f627c Bluetooth: Use NET_BUF_RX_COUNT if NET_L2_BT is enabled
If NET_L2_BT is enabled we need enough acl_in_pool needs to be big
enough to contain a full IP packet since that is no longer processed by
RX thread buffer would be queued to syswq to reassemble the SDU.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
dd4b340205 Bluetooth: L2CAP: Use NET_BUF_TX_COUNT as fragment count
When NET_L2_BT the memory pressure for fragments can be quite high
since that would be transfering IP packets which are considerable big
so this makes our frag_pool to be of the same size as NET_BUF_TX_COUNT.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
4b8cd200ed Bluetooth: conn: Add debug variant to buffer allocation
This enable chaning the function and line number making it easier to
debug where a buffer allocation is blocking.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Luiz Augusto von Dentz
bdb8b0af70 Bluetooth: L2CAP: Queue packets when a segment could not be allocated
When a segment could not be allocated it should be possible to resume
sending it later once previous segments complete, the only exception is
when there is no previous activity and we are unable to alocate even the
very first segment which should indicate to the caller that it would
block since that only happens on syswq the caller might need to defer to
another thread or resubmit the work.

Fixes #20640

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-13 15:30:28 +02:00
Torsten Rasmussen
b3da9efbec scripts: using Path and PurePath for path handling in zephyr modules
Now using only Path and PurePath in zephyr_modules.py to handle module
processing.
This make the code cleaner as well as remove an issue where a module
name would become an empty string when module path contained trailing
path separators.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2019-12-13 14:08:22 +01:00
Robert Lubos
43f833800c net: config: Initialize semaphore before it's used
Functions like `setup_ipv4` or `setup_ipv6` might already use the
`counter` semaphore, therefore it should be initialized before these
functions are called.

As a result of this issue, the network stack could stall until timeout
under certain circumstances (e.g. when OpenThread was used).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2019-12-13 14:42:26 +02:00
Joakim Andersson
41b6b21eeb Bluetooth: shell: Add command to print all connections available
Add command to print all existing connections. Useful for verifying that
connections are actually released when debugging.
More information can be retrieved with `bt info <addr>` using the
address printed by this command for each connection.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-13 14:39:54 +02:00
Joakim Andersson
f6a6974186 Bluetooth: shell: Add command to print all bonds available
Add command to print all existing bonds. Useful for verifying that bonds
are actually cleared when debugging.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-13 14:39:54 +02:00
Joakim Andersson
8d88beca34 Bluetooth: shell: Fix whitelist clear shell command argument count
Fix whitelist clear (wl-clear) shell command argument count. This
command takes no arguments.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-13 14:39:54 +02:00
Vinayak Kariappa Chettimada
bf623906f3 Bluetooth: controller: split: Fix missing version ind state reset
Fix implementation for the missing reset of version
information procedure request state value.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-13 13:21:27 +01:00
Jonas Norling
0ef4634bc5 net: iface: Remove expired router from list of active routers
An expired IPv6 router would cause an infinite loop where
iface_router_run_timer() repeatedly scheduled a work item. In some
conditions it would schedule with negative delay, in other conditions
the infinite loop wouldn't happen until a router was added again.

Get rid of the router from active_router_timers when it is removed.

Fixes #21339

Signed-off-by: Jonas Norling <jonas.norling@greeneggs.se>
2019-12-13 14:00:44 +02:00
Markus Fuchs
2f982b3bc2 net: tls: Add SSL/TLS secure renegotiation support
Allow enabling SSL/TLS secure renegotiation support when initiated by
peer.

Signed-off-by: Markus Fuchs <markus.fuchs@de.sauter-bc.com>
2019-12-13 13:26:45 +02:00
Gerson Fernando Budke
67289d07fe drivers: ieee802154: rf2xx: Add initial driver
Add initial Atmel at86rf2xx transceiver driver. This driver uses device
tree to configure the physical interface. The driver had capability to
use multiple transceiver and systems with multiple bands can be used.
With this, 2.4GHz ISM and Sub-Giga can be used simultaneous.

Below a valid DT example. This samples assume same SPI port with two
transceivers.

&spi0 {
    status = "okay";
    label = "SPI_RF2XX";
    cs-gpios = <&porta 31 0 &porta 30 0>;

    rf2xx@0 {
        compatible = "atmel,rf2xx";
        reg = <0x0>;
        label = "RF2XX_0";
        spi-max-frequency = <7800000>;
        irq-gpios = <&portb 2 0>;
        reset-gpios = <&porta 3 0>;
        slptr-gpios = <&portb 3 0>;
        status = "okay";
    };

    rf2xx@1 {
        compatible = "atmel,rf2xx";
        reg = <0x1>;
        label = "RF2XX_1";
        spi-max-frequency = <7800000>;
        irq-gpios = <&portb 4 0>;
        reset-gpios = <&porta 4 0>;
        slptr-gpios = <&portb 4 0>;
        status = "okay";
    };
};

At the moment driver assume two transceiver are enouth for majority of
appications. Sub-Giga band will be enabled in future.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2019-12-13 11:23:23 +02:00
Gerson Fernando Budke
1a0e8a2e04 dts: ieee802154: rf2xx: Add DTS support
Add a dts binding file for the ATMEL AT86RF23x/212x transceivers.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2019-12-13 11:23:23 +02:00
Andrew Boie
528233e4b0 kernel: use size_t for thread stack sizes
We should use size_t for memory region sizes everywhere, not
u32_t.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
3b066d4cf5 tests: userspace: fix 64-bit issues
In addition to not assuming all pointers fit in a u32_t,
logic is added to find the privilege mode stack on x86_64
and several error messages now contain more information.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
3c456fc86a tests: mem_protect: fix corruption issue
This test has a problem, specifically in the scenario for
test_mem_domain_remove_partitions. A low priority thread (10)
is created which is expected to produce an exception. Then
the following happens:

- The thread indeed crashes and ends up in the custom fatal
  error handler, on the stack used for exceptions
- The call to ztest_test_pass() is made
- ztest_test_pass() gives the test_end_signal semaphore
- We then context switch to the ztest main thread which is
  higher priority, leaving the thread that crashed context
  switched out *on the exception stack*
- More tests are run, and some of them also produce exceptions
- Eventually we do a sleep and the original crashed thread is
  swapped in again
- Since several other exceptions have taken place on the
  exception stack since then, resuming context results in
  an unexpected error, causing the test to fail

Only seems to affect arches that have a dedicated stack for
exceptions, like x86_64. For now, increase the priority of
the child thread so it's cleaned up immediately. Longer-term,
this all needs to be re-thought in the test case to make this
less fragile.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
d27acb9eb6 tests: adjust resource pool sizes for 64-bit
The requests are somewhat larger on 64-bit since we
are allocating structs with pointer members. Increase
these to a larger multiple of the minimum block size.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
a15a47d856 samples: shared_mem: 64-bit fixes
We don't need this cast, just use %p format code.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
69d47c170e tests: mem_protect: don't cast pointers to u32_t
Use uintptr_t instead. Fixes some 64-bit issues.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
dfab6ef940 kernel: fix 64-bit issues in syscall_handler.h
Always use size_t for size calculations, not u32_t.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
b5c681071a kernel: don't use u32_t for data sizes
Use a size_t instead.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
22553a7edb kernel: k_object key pointer should be void *
These are not C strings, just pointers to kernel objects.
Improves output when working with a debugger.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
f290ab595c kernel: fix 64-bit for kobject generation
We need a format code for struct packing that fits in
a pointer value, "I" is fixed at 32-bit.

The conversion of string to pointer value now prints
8 bytes. This works for 32-bit since the leading
4 digits are always zero.

The replaced length check uses sizeof(void *) and not 4.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
428afe5084 kernel: fix some bad casts in userspace.c
64-bit systems generate some compiler warnings about
data type sizes, use uintptr_t where int/u32_t was being cast
to void *.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00