Commit graph

41120 commits

Author SHA1 Message Date
Andrei Emeltchenko
4c9ea1e370 usb: netusb: ecm: Enable netusb for the right iface/alt_set
Only enable netusb for the right configuration of interface and
alt_setting.

Fixes #13560

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-11 13:35:24 -04:00
Andrei Emeltchenko
1a1c518c25 usb: device: Change iface set callback parameters
Include to the callback parameters also alt_setting to be able to make
right choice for ECM.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-11 13:35:24 -04:00
Vinayak Kariappa Chettimada
fff35bd682 Bluetooth: controller: Fix encryption setup to be queueable
Fix the controller implementation to make start encryption
queueable if there is any control procedure in progress.

The context related to encryption procedure is now shared so
that it will be used after the ongoing procedure completes.

The fix here maintains the old functionality of serializing
the queued data and LL Encryption Request PDU, so that data
queued before start encryption is acknowledged.

Fixes #15012.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-04-11 13:22:02 -04:00
Vinayak Kariappa Chettimada
e81acd8c3f Bluetooth: controller: Revert set encryption procedure pending
This reverts commit 0cf82cdd31.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-04-11 13:22:02 -04:00
Ravi kumar Veeramally
189b22789c net: vlan: Etherent layer missed L2 header
When VLAN is enabled, ethernet l2 layer fills ethernet header
but not added to the network buffer.

Fixes #15346

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2019-04-11 13:20:40 -04:00
Johan Hedberg
44bfefce14 doc: relnotes: 1.14 Bluetooth Host release notes
Add major changes for Bluetooth Host since 1.13.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-11 10:40:57 -04:00
Carles Cufi
d3f56d60dc doc: relnotes: 1.14 Bluetooth Controller release notes
Add the relevant release notes for the Bluetooth Controller for version
1.14.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-11 10:40:57 -04:00
Ioannis Glaropoulos
7886d50f2c doc: relnotes: 1.14 arm arch release notes
Release notes entries for ARM architecture.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-11 10:40:31 -04:00
Ioannis Glaropoulos
3e61917254 doc: relnotes: 1.14 arm SoC/Boards release notes
Release notes entries for ARM SoC and Board support.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-11 10:40:31 -04:00
Andrei Emeltchenko
fa5d9d20ec quark_se_c1000_devboard: Fix broken DTS configuration
Fixes broken CC2520 on quark_se_c1000_devboard configuration after
commit 25d17db.

Fixes #15070

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-04-11 10:39:21 -04:00
Andrzej Puzdrowski
e015661b94 doc: relnotes: 1.14 update documentation improvement patagtaph
Update the relevant release notes for the documentation improvement
for version 1.14.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-04-11 10:38:45 -04:00
Andrzej Puzdrowski
b607d48031 doc: relnotes: 1.14 nRF5 flash driver release notes
Add the relevant release notes for the nRF flash driver for version
1.14.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-04-11 10:38:45 -04:00
Andrzej Puzdrowski
480c5d00f2 doc: relnotes: 1.14 settings release notes
Add the relevant release notes for the settings for version
1.14.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-04-11 10:38:45 -04:00
Andrzej Puzdrowski
5e52d3a11d doc: relnotes: 1.14 flash_map release notes
Add the relevant release notes for the flash_map for version
1.14.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-04-11 10:38:45 -04:00
Carles Cufi
14c75705cb samples: hci_uart: Reduce MAX_CONN to 16 for the micro:bit
In order to fit in SRAM, reduce the CONFIG_BT_MAX_CONN from 20 to 16 in
the configuration used for the BBC micro:bit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-11 14:54:37 +02:00
Carles Cufi
bae9f1967b samples: Bluetooth: hci_uart: Implement NOP Command Complete
Implement the Controller counterpart to CONFIG_BT_WAIT_NOP so that it
issues a NOP Command Complete event after booting up, to signal to the
Host that it is ready to receive HCI traffic.

Fixes #15333

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-04-11 14:54:37 +02:00
David B. Kinder
9fff548c88 doc: add orphaned crypto docs
tinycrypt documentation wasn't included in the table of contents so add
it into the guides section.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-11 08:08:28 -04:00
Luiz Augusto von Dentz
f2a34a6106 Bluetooth: GATT: Fix not clearing Client Features
When a device is considered unpaired any configuration set in Client
Features shall also be removed.

Fixes #15329

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-04-11 12:04:53 +03:00
Jim Paris
510a6dc5e4 drivers: flash: spi_nor.c: fix typo
This was referencing the wrong DT property, leading to build errors.

Signed-off-by: Jim Paris <jim@jtan.com>
2019-04-11 10:02:44 +02:00
Jim Paris
9a0d113260 dts: flash: add missing DT properties to jedec,spi-nor
The erase-block-size and write-block-size are needed for the spi_nor
driver to compile.

scripts/dts/extract/flash.py automatically adds these properties if
this flash device is part of the "chosen" flash node, but they're
otherwise missing.

Signed-off-by: Jim Paris <jim@jtan.com>
2019-04-11 10:02:44 +02:00
Andy Ross
110cab8aa3 drivers/timer/systick: Improve clock slippage under irq_lock load
The SysTick logic looked logically sound, but it was allowing us to
set a LOAD value as low as 512 cycles.  On other platforms, that
minimum future interrupt delay is there to protect the "read, compute,
write, unmask" cycle that sets the new interrupt from trying to set
one sooner than it can handle.

But with SysTick, that value then becomes the value of the LOAD
register, which is effectively the frequency with which timer
interrupts arrive.  This has two side effects:

1. It opens up the possibility that future code that masks interrupts
   longer than 512 cycles will miss more than one overflow, slipping
   the clock backward as viewed by z_clock_announce().

2. The original code only understood one overflow cycle, so in the
   event we do set one of these very near timeouts and then mask
   interrupts, we'll only add at most one overflow to the "elapsed()"
   time, slipping the CURRENT time backward (actually turning it into
   a non-monotonic sawtooth which would slip every LOAD cycle) and
   thus messing up future scheduled interrupts, slipping those forward
   relative to what the ISR was counting.

This patch simplifies the logic for reading SysTick VAL/CTRL (the loop
wasn't needed), handles the case where we see more than one overflow,
and increases the MIN_DELAY cycles from 512 to 1/16th of a tick.

Fixes #15216

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-04-10 22:05:57 -04:00
Marti Bolivar
100a2bba6c scripts: update pyocd in requirements.txt
This includes a bugfix for a pyocd requirement on pyyaml
that could not be satisfied using officially supported
releases.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-04-10 17:52:15 -04:00
Johan Hedberg
91139c1534 doc: bluetooth: Clarify notes about blocking in the RX thread
Callbacks called from the RX thread may block, but should avoid doing
it for long periods of time.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-10 17:43:55 -04:00
Johan Hedberg
c5e826e8ff doc: bluetooth: Move L2CAP text from to API reference section
Move the L2CAP text from the guides section to the API reference
section.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-10 17:43:55 -04:00
Johan Hedberg
bf31fbd789 doc: bluetooth: Move GATT text to API reference section
Move the GATT text from the guides section to the API reference.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-10 17:43:55 -04:00
Johan Hedberg
d34128a97b doc: bluetooth: Add reference to Mesh API section
Add a reference from the architecture guide to the Mesh API section.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-10 17:43:55 -04:00
Johan Hedberg
eb46f47a8d doc: bluetooth: Fix text corruption
For some reason there were garbage characters at the end of the line.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-10 17:43:55 -04:00
Johan Hedberg
83b443aa2d doc: bluetooth: Move connection management text to API reference
Move the connection management text from the Guides section to the API
reference section.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-10 17:43:55 -04:00
Andrzej Głąbek
112baf1721 boards: nrf9160_pca10090: Fix polarity of pwm0/ch0
This is a follow up to commit 436c4262da.
By default the channel 0 of pwm0 is set to the pin that drives led0.
Since the LED is active high, the inversion of polarity is incorrect.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-04-10 13:55:10 -04:00
Michael Scott
cb2bfcb9c0 net: lwm2m: fix periodic services handling
This fixes an issue where if timestamp == service_due_timestamp,
we don't call the periodic service.  Then the following call to
engine_next_service_timeout_ms() returns 0 because the service
is still due and lwm2m_engine_service() is called again.
This process repeats several times until the value of
k_uptime_get() changes and then the work is finally handled.

Previously, the resolution of k_uptime_get() was in ms.  A recent
change to this API defaults Zephyr so that the resolution is
set via CONFIG_SYS_CLOCK_TICKS_PER_SEC (default 100).

This means the value of k_uptime_get() only changes every 10ms.

Reported-by: Github User pieterjanc
Signed-off-by: Michael Scott <mike@foundries.io>
2019-04-10 13:54:23 -04:00
Michael Scott
42abfc6532 net: lwm2m: dont use system workqueue for services
"It's a Trap!" -- Admiral Ackbar

When moving to the BSD-socket APIs, the original thread running LwM2M
periodic services such as observes and lifetime updates, was replaced
with a re-occuring workqueue job.  To save the overhead of creating a
new thread, I used the system workqueue for these jobs.

This was a mistake.  If these jobs hit a semaphore or wait for some
reason, it cannot be prempted due to the priority of the system work
queue.

Let's instead add this service handling to the thread that we already
use for polling sockets.  This also removes a configuration issue where
the system workqueue stack size needed to be increased.  This can now
be adjusted via the LWM2M_ENGINE_STACK_SIZE knob.

Directly fixes semaphore usage in the socket-based DNS code.
This was introduced as a bugfix for non-responsive DNS server hanging
the Zephyr device forever.  However, this probably fixes randomly
seeming hangs on the device.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-04-10 13:54:23 -04:00
Mieszko Mierunski
6a739435a0 drivers: nrf: Fix UARTE interrupt driven operation.
Bad order of interrupt calls made it unable to transmitt data
using interrupt driven API.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-04-10 13:53:40 -04:00
Andrew Boie
9e69c54060 sanitycheck: add more info during processing
After the testcase configs are built, there is a step to
filter all the test case information to determine the set
of tests to run.

As this step takes a nontrivial amount of time, add an
informational message about it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-10 13:09:28 -04:00
Alberto Escolar Piedras
6a70f397ff doc: Reorganize development model section
Renamed the page "review_process.rst" to "dev_env_and_tools.rst"
as the old name did not cover all its content.
Moved the labels page content into this
"Developemnt Environment and Tools" page.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-04-10 12:58:43 -04:00
Alberto Escolar Piedras
ee194c375a doc: dev_process: Add description about GH labels usage
There has been some confusion about how GitHub labels
should be used.
This commit adds a new doc page, which tries to clarify this.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-04-10 12:58:43 -04:00
Alberto Escolar Piedras
1923a04ff0 doc: Add to 1.14 release notes native_posix and nrf52_bsim changes
Added information to the release notes about the new drivers
in native_posix, the new nrf52_bsim board and the BabbleSim
integration in CI and testcases.

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2019-04-10 12:41:51 -04:00
Ioannis Glaropoulos
e2969e5de0 tests: kernel: fp_sharing: minor fix in #ifdef expression
We need to use the ARMV7_M_ARMV8_M_FP Kconfig symbol,
which denotes the Floating-Point capabilities, instead
of the option that signifies the Cortex-M variant. Fix
is of minor importance, as long as the #ifdef block
remains empty.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-04-10 10:59:46 -04:00
Ulf Magnusson
3a8db5549a editorconfig: Set insert_final_newline true
This is what checkpatch.pl expects, and GitHub's file viewer flags a
missing trailing newline too.

Note that this is different from a blank line at the end of the file. It
just says whether the last line must end in a newline.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-04-10 14:15:38 +02:00
Joakim Andersson
0e7bf9b657 Bluetooth: controller: Send unknown rsp to unexpected ENC ctrl PDU
Send unknown rsp instead of asserting when encryption related control
PDUs are received in the wrong state.
This would allow an attacker to intentionally crash the device.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-04-10 14:01:21 +02:00
Joakim Andersson
9fb3abef1e Bluetooth: controller: Fix length request during encryption procedure
Stop the Length request procedure from initiating during the encryption
procedue. This would cause the peer to disconnect the link with error
code LMP_TRANSACTION_COLLISION

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-04-10 14:01:21 +02:00
Joakim Andersson
0cf82cdd31 Bluetooth: controller: Set encryption procedure pending
Set the encryption procedure pending and start it as soon as
there are no other procedures running.
This allows the Host to enqueue the encryption procedure, and not
get disallowed command because a different LL procedure is active.

Fixes #15012

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-04-10 14:01:21 +02:00
Aaron Tsui
5922be2ed6 samples: subsys: logging Remove repetitive code.
Remove repetitive code

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-04-10 13:51:38 +02:00
Aaron Tsui
1c742a9756 doc: subsys: logging Update documentation
Update documentation.

Signed-off-by: Aaron Tsui <aaron.tsui@outlook.com>
2019-04-10 13:51:38 +02:00
Johan Hedberg
63955e5f70 Bluetooth: Fix clearing conn->le.keys when unpairing
When calling bt_unpair() the keys were removed from flash, however a
pointer was left to the invalidated keys in case there was an existing
connection. This would then lead to a bogus entry being stored in
flash for a zero-address peer device. Fix this issue by clearing the
conn->le.keys pointer in the bt_unpair() function.

Fixes #15325

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-10 14:47:29 +03:00
David B. Kinder
2e5172dab7 doc: update 1.14 release notes with doc changes
Update 1.14 draft release notes with doc changes.  Also edited existing
release notes material to make sentence tense consistent (past tense).

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-04-10 07:37:04 -04:00
Johan Hedberg
686f5c79cf Bluetooth: Mesh: Fix not updating health publication message
The bt_mesh_fault_update() API is meant for updating the publication
message and sending it out to the network, however it was missing the
necessary call to health_pub_update() which is responsible for
updating the publication message.

Fixes #15300

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-04-10 10:56:27 +03:00
Andrew Boie
9926f947ab tests: ringbuffer: avoid unaligned mem access
Casting the rb_data character array to a u32_t can result
in an unaligned u32_t * pointer being passed to
ring_buf_item_put(), since rb_data is only byte-aligned.

Our Altera Max10 CPU build is not configured to detect
unaligned memory access and throw an exception, it is
instead rounding down the memory address
of the data pointer to the nearest 4-byte value, causing
the wrong data to be copied into the ring buffer.

It appears that in the C standard this is considered
Undefined Behavior so the approach this patch takes is
to fix the test, by ensuring that rb_data is aligned to
u32_t.

Fixes: #14869

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-09 19:59:46 -04:00
Andrew Boie
7387b56c61 tests: add nsim special cases for two tests
The NSIM emulator has severe performance issues when
the MPU registers are reprogrammed on context switch.
Disable runtime reprogramming of the MPU for these
platforms on these two tests, which have a lot of context
switch thrashing. This is done by ensuring userspace
and hardware stack overflow detection via guard areas
is disabled.

I have assurances from the ARC team that the tests run fine
on real hardware and this is an emulation issue.

For 1.15, this will be completely resolved by optimizing
MPU region gap-filling to not take place during context
switch time, which will drastically reduce the number of
MPU registers poked during context switch on nsim_sem.

Meanwhile, for 1.14 we ensure that no runtime reprogramming
of the MPU is done for these tests.

Fixes: #14642

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-04-09 19:38:32 -04:00
Wayne Ren
5bc307e60f arch: arc: optimize the macros of thread stack
* clean up and optimzie the macros of thread stack

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-04-09 18:39:48 -04:00
Wayne Ren
290aa59ada arch: arc: fix the bug of mpu stack guard when no USERSPACE
* fix the stack allocation and initialization
  for mpu stack guard when USERSPACE is not configured
* fixes #15163

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-04-09 18:39:48 -04:00