Commit graph

41120 commits

Author SHA1 Message Date
ZhongYao Luo
5758a9e1c6 bluetooth: h5: Fix memory access error
According to the context information, the processing of
net_buf_add_u8 within the get_evt_buf function is
redundant and incorrect.

Signed-off-by: ZhongYao Luo <LuoZhongYao@gmail.com>
2019-12-09 17:04:24 +02:00
Andrzej Puzdrowski
aba7dfe69a dfu/img_util: fix flash_sector_from_off
flash_sector_from_off fetched sector data of page
in relation to the flash memory beginning instead of the flash
area beginning.
Issue was invisible as on most devices all sectors looks similar.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-12-09 16:03:21 +01:00
Rubin Gerritsen
d2825134c4 samples: bluetooth: hci_uart: add config for nrf5340_dk_nrf5340_cpuapp
Sets the baud rate to 1M to align with other nrf boards.

Signed-off-by: Rubin Gerritsen <Rubin.Gerritsen@nordicsemi.no>
2019-12-09 17:01:27 +02:00
Joakim Andersson
b5f70ef1c0 Bluetooth: GATT: Fix discover callback invalid pointer
Fix issues that surfaced when trying out GCC 9.2, official release name
gcc-arm-none-eabi-9-2019-q4-major, both related to invalid pointers in
GATT when declaring UUIDs in if-scope.

1. Fix the discovery callback giving an invalid pointer in the discovery
callback in two instances.
2. Fix gatt_find_type sending invalid data during discovery procedure.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-09 16:58:01 +02:00
Kiran Paramaswaran
d86d37a075 Bluetooth: Host: Adding valid param check in send_conn_le_param_update()
Send connection parameter update request only if it contains the valid
range of values for connection intervals, latency and timeout.

Signed-off-by: Kiran Paramaswaran <kipm@oticon.com>
2019-12-09 16:57:38 +02:00
Stephanos Ioannidis
b9b474cc82 soc: same70: Fix incorrect default config value
The type of SOC_ATMEL_SAME70_DISABLE_ERASE_PIN is bool, yet its default
is specified as an int value of 0.

This commit removes the implied `default 0`, which is equivalent to
`default n`.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-09 15:50:13 +01:00
Rubin Gerritsen
87fa13cc03 boards: arm: nordic: nrf5340_dk_nrf5340 uart dts config for BLE
Add dts configs for bt-c2h-uart and bt-mon-uart. These are used by
the hci_uart sample and BT_DEBUG_MONITOR.

Signed-off-by: Rubin Gerritsen <Rubin.Gerritsen@nordicsemi.no>
2019-12-09 15:39:07 +01:00
Arnaud Pouliquen
c194c70775 CODEOWNERS: update arnop2 ownership name
Following update of the Github username,replace owner from arnop2
to arnopo.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
2019-12-09 08:37:53 -06:00
David Leach
b413223a66 doc: release notes: Update contents for 2.1.0
Add updated issue list and filled in some details from PRs.

Signed-off-by: David Leach <david.leach@nxp.com>
2019-12-08 20:56:58 -06:00
Anas Nashif
f3a0ad013b release: update sanitycheck release file
Update sanity_last_release.csv required for footprint comparisons.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-07 19:17:08 -06:00
Carles Cufi
5b26b01bb6 soc: x86: apollo_lake: Turn .rst doc into .txt
In order to avoid a warning from Sphinx complaining that the
supported_features.rst file is not included in any ToC, rename it to
.txt so that Sphinx understands that this is only a snippet to be
included in other files.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-12-06 16:56:24 +01:00
Ulf Magnusson
f570f19bef doc: genrest: Use , instead of : as the separator in --modules
Using ':' as the separator in --modules breaks module specifications
like

    nrfxlib:nrfxlib:C:/Users/Carles/src/ncs/nrfxlib

The ':' in 'C:' gets seen as a separator.

Use ',' instead, which is unlikely to appear in paths (at least in
--modules). Treat a doubled ',,' as a literal ','.

Another option would be ';', but it clashes with how CMake represents
lists, which is awkward.

Also make quoting of arguments with spaces more robust by passing
VERBATIM to add_custom_target().

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-05 16:23:10 +01:00
Trond Einar Snekvik
6a679a92db Bluetooth: Mesh: Clean up API documentation
Fills in all missing API documentation for the public Bluetooth Mesh
API, and unifies the formatting of all entries.

Some defines and enum values have been left without documentation in
cases where the meaning is self explanatory, and documentation wouldn't
add any value. Structure members that are just internal parameters are
left without documentation, as this also hides them from the generated
documentation output.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2019-12-05 13:04:14 +01:00
David B. Kinder
416a174ac2 doc: fix misspellings in docs
Fix misspellings in docs (and Kconfig and headers processed into docs)
missed during regular reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-12-04 14:12:53 -06:00
Jacob Siverskog
7096fa512f Bluetooth: GATT: Remove all subscriptions for connection when unpairing
Make sure all subscriptions are removed when a connection is unpaired.

Fixes #21131

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2019-12-04 19:14:28 +01:00
Joakim Andersson
afe088247d Bluetooth: ATT: Fix ATT MTU support for larger MTUs
Fix ATT MTU size of length variables resulting in wrong length values
reported to the user. Communicating with an Android device using an MTU
of 517 resulted in write commands reported as length 2 instead.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-04 19:08:10 +01:00
Carles Cufi
2dca6b355c logging: Include sys/util.h in log_backend.h
The UTIL_CAT macro which is used in log_backend.h is implemented in
sys/util.h.

Fixes #21045.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-12-04 11:39:42 +01:00
David Leach
240d519de3 release: Zephyr 2.1.0-rc3
Bumped to v2.1.0-rc3

Signed-off-by: David Leach <david.leach@nxp.com>
2019-12-03 22:40:15 -05:00
Anas Nashif
23bdddea0c Revert "interrupt_controller: ioapic_intr: revert CPU target change"
This reverts commit 005aff7743.

Sporadic failures in Qemu X86_64

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-03 20:34:47 -06:00
Daniel Leung
005aff7743 interrupt_controller: ioapic_intr: revert CPU target change
Commit 5a9a33b0cf changes interrupt
destination in an attempt to broadcast interrupts. However, this
change causes interrupts to stop working on the UP Squared board
in non-SMP configuration. According to QEMU source code,
physical destination address 0xFF000000 is a special case where
it broadcasts the interrupts. However, none of the IOAPIC
documentation (that I can find) describes this behavior. So,
revert that commit.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-03 16:55:06 -06:00
Peter Bigot
c248cdf17e power: policy: remove deep sleep states from residency policy
Deep sleep states are documented to include SoC-level power gating,
i.e. the SoC loses context.  In practice entering a deep sleep state
requires an external wakeup mechanism that may need to restart the
application.

Such states are too dangerous to enter automatically based on an
expected duration of sleep, especially since a "forever" sleep that
would normally be woken as a result of a peripheral event would select
the deepest sleep state available.  Limit the sleep levels selected by
a residency policy to ones in which the CPU may be stopped, but will
not lose execution context.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-03 14:46:15 -06:00
Martí Bolívar
2024fb531a scripts: runners: fix blackmagicprobe SIGINT behavior
The blackmagicprobe runner's Python process fails to ignore SIGINT
when it runs GDB from the debug and flash callbacks, which is wrong.

The other runners tend to use run_server_and_client() to properly
handle this, since they start a GDB server and connect to it with a
client. The BMP USB device presents itself as a serial device which
speaks the GDB serial protocol instead, so there's no server/client,
and thus no call to run_server_and_client().

The problem is that blackmagicprobe essentially uses
subprocess.check_call() to start GDB directly, without ignoring SIGINT
in the python process. Easy fix.

Fixes: #21139

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2019-12-03 14:15:30 -06:00
Jukka Rissanen
38db500fe5 doc: net: Enhance 802.1Qav documentation
There was no examples how to set the Qav parameters from application.

Fixes #21074

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-03 14:07:32 -06:00
Jukka Rissanen
26db79375f doc: release: Remove net sample testing feature
The network sample automatic testing feature in PR #19677 is moved
to 2.2 so removing it from 2.1 release note.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-03 14:06:29 -06:00
David B. Kinder
685932237d doc: add doc changes to 2.1 release notes
Add summary of documentation work for 2.1 release.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-12-03 13:15:52 -06:00
Luiz Augusto von Dentz
5beb5b5992 Bluetooth: ATT: Fix not handling errors properly
Since bt_conn_send_cb can fail to send buffer causing it to unref this
may cause buffer leaks as the caller is not aware of the error assuming
the buffer could be sent.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-12-03 19:44:51 +01:00
Tomasz Bursztyka
c9e0876421 drivers/pwm: Fix abs() usage in xec driver
Seems to be fine to temporarly cast to int there as frequencies are in
Mhz and not Ghz.

Fixes #20497
Coverity CID: 205638

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-12-03 13:34:19 -05:00
Andy Ross
7022000b5c kernel/mutex: Fix races, make unlock rescheduling
The k_mutex is a priority-inheriting mutex, so on unlock it's possible
that a thread's priority will be lowered.  Make this a reschedule
point so that reasoning about thread priorities is easier (possibly at
the cost of performance): most users are going to expect that the
priority elevation stops at exactly the moment of unlock.

Note that this also reorders the code to fix what appear to be obvious
race conditions.  After the call to z_ready_thread(), that thread may
be run (e.g. by an interrupt preemption or on another SMP core), yet
the return value and mutex weren't correctly set yet.  The spinlock
was also prematurely released.

Fixes #20802

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-12-03 12:33:17 -06:00
Andrzej Głąbek
84f8235005 drivers: spi_nrfx_spim: Fix handling of extended SPIM configuration
Fill the `rx_delay` field in the SPIM configuration structure only when
the RXDELAY feature is present in a given SPIM instance, to prevent
compilation errors when some other SPIM instance is enabled together
with SPIM3.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-12-03 12:26:12 -06:00
Ulf Magnusson
58e2057aaf genrest: Show symbol help texts on index page
Instead of showing the prompt for symbols on the index page, show their
help texts. This makes searching easier.

Fall back on the prompt if no help text is available.

Also change the code to only show one of the prompts if several are
available (happens if a symbol is defined in multiple locations and adds
a prompt in more than one of them). It's probably overkill to show them
all, and it doesn't come up that often.

Suggested by David B. Kinder.

Co-authored-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-03 17:02:22 +01:00
Ulf Magnusson
91c8ffa55c kconfig: doc: Split up symbol reference by path
Use --modules to split the Kconfig reference up by where symbols are
defined. See the argparse docstring for --modules in
doc/scripts/genrest.py.

Not sure what the best way to split things up is, so feedback would be
appreciated. I just pulled out some top-level directories. It could
always be tweaked later.

If a symbol is defined in more than one module (by being defined in
multiple locations), it appears on multiple index pages.

To build the documentation, do

    $ mkdir doc/b && cd doc/b
    $ cmake -GNinja ..
    $ ninja htmldocs
    (output in html/reference/kconfig/index.html)

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-03 17:02:22 +01:00
Ulf Magnusson
5492f2f8b6 genrest: List all symbols on main index page and refactor
Instead of having index.rst just link to other index pages in --modules
mode, list all symbols on it, and have links to the module index pages
at the top.

Get rid of index-all.rst and index-main.rst (and all related options).
index-all.rst is no longer needed, and index-main.rst (symbols outside
--modules) might not be that useful to people reading the documentation
(and could be added back if needed).

Also refactor and streamline the code a bunch. For the main index page,
the only difference between modules and non-modules mode is now whether
there's links to other index pages at the top.

Suggested by David B. Kinder.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-03 17:02:22 +01:00
Vinayak Kariappa Chettimada
92e017fd70 Bluetooth: controller: split: Support Zero Latency IRQs
Add support for Zero Latency IRQs, which avoids any Zephyr
OS or application influenced ISR latencies on the
controller's ISRs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-03 10:43:09 +01:00
Vinayak Kariappa Chettimada
dab182896e Bluetooth: controller: split: Revert broken ZLI support
This reverts commit 3096c0e741.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-03 10:43:09 +01:00
Vinayak Kariappa Chettimada
c53ca07246 Bluetooth: controller: legacy: Revert broken ZLI support
This reverts commit a1945db08a.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-03 10:43:09 +01:00
Maureen Helm
9d5d252894 doc: releases: Document major driver changes in 2.1 release note
Documents major driver changes (additions, removals, fixes, etc.) across
all driver families since the 2.0.0 release.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-12-02 20:00:47 -06:00
Erwan Gouriou
bbcb352a92 doc/guides: Add clarifications to board porting guidelines
Additions:
- Provide clear description of a typical board port on zephyr
- Add a clear statement that peripherals should be disabled by
default (unless clearly specified)
- Add clear mentions on peripheral that should actually be enabled

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-12-02 20:01:29 -05:00
Anas Nashif
d0aa6fc212 drivers: kscan_mchp_xec: fix memory corruption
Fixes memory corruption (Out-of-bounds write ) case discovered by
coverity.

Fixes #20494
Coverity CID: 205617

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-02 15:46:11 -06:00
Jukka Rissanen
196816532f net: gptp: Do not update clock if time diff is < 0
The time difference calculation did not check if the result
value would be < 0 which means really large value when converted
to unsigned.

Fixes #20100

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-02 09:58:51 -05:00
Daniel Leung
fc7916aeae soc: intel_s1000_crb: fix XCC build error with newlib
The Newlib in the XCC toolchain for intel_s1000_crb has a few
missing functions which are reentrant versions of the one
defined in lib/libc/newlib/libc-hooks.c. So make these call
the correct functions.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-02 09:58:00 -05:00
Daniel Leung
90dc1e5d7a soc: intel_s1000_crb: fix cmake warning about HAS_*_DW
Both HAS_I2C_DW and HAS_SPI_DW are not valid unless I2C and
SPI are both selected. So make them dependent on the parent
subsystem config.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-02 09:58:00 -05:00
Daniel Leung
a058219245 toolchain: fix __BYTE_ORDER__ not defined for XCC
Commit 571741a0c5 introduced a block to determine __BYTE_ORDER__
within toolchain/gcc.h. However, toolchain/xcc.h defined
__BYTE_ORDER__ there but the early inclusion of gcc.h causes
errors since __BYTE_ORDER__ cannot be determined within gcc.h.
So wrap around the gcc.h include with a fake __BYTE_ORDER__ to
bypass the check in gcc.h.

Also set the __BYTE_ORDER__ to the correct __ORDER_*_ENDIAN__
macro.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-02 09:58:00 -05:00
Daniel Leung
7476a6eb9d kernel: remove duplicate definitions of k_thread stack and entry
Both k_thread_stack_t and (*k_thread_entry_t) are defined in
include/kernel.h and include/sys/arch_interface.h. The latter is
indirectly included by kernel.h which causes issues with some
toolchains. So remove the definitions in kernel.h.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-02 09:58:00 -05:00
Patrik Flykt
12f381888f drivers: modem: Document UART device name
Document that the third argument is the UART device name.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-12-02 15:34:45 +01:00
Peter Bigot
fd5b502b64 drivers: timer: nrf_rtc_timer: avoid starving clock announcements
When setting a timeout measure the number of accumulated unannounced
ticks.  If this value exceeds half the 24-bit cycle counter range
force an announcement so the unannounced cycles are incorporated into
the system tick counter.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-02 15:28:12 +01:00
Peter Bigot
7e71164cc6 tests: kernel: timer: add test for starvation
Add a test that repeatedly reschedules a timer before it expires, and
has no other timers active.  If the timer internal state overflows due
to counter wrap either the uptime or the tick counter may appear to go
backwards.  The test runs until it fails, or until a specified amount
of measured time has passed.

This test is build-only for automated test programs as the default
limit to pass is one hour, and some platforms may require an even
longer period.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-02 15:28:12 +01:00
Jukka Rissanen
971ae59913 net: pkt: Make sure iface is not null when accessing L2
It is possible that the network interface is not set when we
check the interface in net_pkt.c:pkt_buffer_length(). For example
in icmpv6 unit test the interface is left as NULL as the test does
not care about what network interface is used. For real hw like
mimxrt1050_evk, which supports Ethernet, we need to add additional
checks for the interface being non-null.

Fixes #20088

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-02 07:39:41 -06:00
Anas Nashif
afe5b2598d tests: fdtable: check for negative fd
Check for negative file descriptor.

Fixes #18448
Fixes #18450
Fixes #18449
Fixes #18451

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-02 07:32:41 -05:00
Luiz Augusto von Dentz
42c5b0a7fa Bluetooth: L2CAP: Fix unrefing buffers that are queued
Processing of data received on dynamic channels is still done via syswq
so the buffer shall not be unrefed when they are queued.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-11-29 15:19:08 +02:00
Luiz Augusto von Dentz
3f43413887 Bluetooth: L2CAP: Fix not unrefing tx_buf
If the channel has a tx_buf it must be unrefed when destroying the
channel.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-11-29 15:19:08 +02:00