Commit graph

41161 commits

Author SHA1 Message Date
Jukka Rissanen
f4c4d12062 net: mdns: Use 5353 source port when sending the query
The source UDP port in all Multicast DNS responses MUST be 5353
as described in RFC 6762 chapter 6.

Fixes #18732

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-29 19:47:07 +02:00
Vincent Wan
39bb8d5205 doc: boards: cc3220sf_launchxl: update docs for Zephyr 2.0
This commit updates the documentation in preparation for the imminent
release of Zephyr 2.0.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-08-29 10:21:49 -05:00
Johann Fischer
12a11201e2 usb: cdc_acm: enable CONFIG_CDC_ACM_IAD by default
Enable CONFIG_CDC_ACM_IAD by default so that
CDC ACM class works out of the box on Windows OS.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-08-29 17:14:45 +02:00
Johann Fischer
84c38cb93a usb: increase the length of the request buffer
Increase the length of the request buffer.
Current value is not enough for an average
device descriptor.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-08-29 17:14:45 +02:00
Johann Fischer
666fa31857 usb: mitigate the check of request buffer length
Mitigate the check of the request buffer length because
the host may not know the real length for some responds.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-08-29 17:14:45 +02:00
Wentong Wu
a58d730dae tests/drivers/ipm: Enable on x86_64
this case isn't designed for SMP, setting CONFIG_MP_NUM_CPUS=1 to
run the full SMP kernel config, but with only one CPU available.

Fixes: #12478.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-08-29 16:33:27 +02:00
Loic Poulain
ee8c661455 boards: arm: disco_l475_iot1: Enable MSI PLL mode for USB
The MSI PLL mode has been disabled but can be used since LSE is
populated on disco_l475_iot1 board. This is requested to enable
USB device controller support.

Fixes #18717

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-08-29 15:17:01 +02:00
Wentong Wu
ed6ce291ba scripts: elf_helper.py: fix stack declared K_THREAD_STACK_EXTERN
If a stack is declared with K_THREAD_STACK_EXTERN first, analyze array
in elf_helper.py will ignore this declaration which will be referenced
by the actual instances via the tag DW_AT_specification, so that this
stack can't be detected by the kernel object detection mechanism, and
this will cause userspace not work.

Fixes: #16760.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-08-29 08:18:54 -04:00
Wentong Wu
9ca0d5e18b scripts: elf_helper.py: add analyze for DW_TAG_typedef
add analyze for DW_TAG_typedef in order to catch all the
kernel objects.

Fixes: #16760.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-08-29 08:18:54 -04:00
Ioannis Glaropoulos
c18ff87c69 tests: kernel: interrupt: stop excluding ARM platforms
As we have re-worked the test code, and the test-case can run
on Cortex-M platforms on any available and implemented NVIC
IRQ lines, we do not need to exclude these ARM boards anymore.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-08-29 13:05:12 +02:00
Ioannis Glaropoulos
e128f3c5d9 tests: kernel: interrupt: make test work with any available NVIC IRQ
This commit re-works the test for the ARM architecture,
so that it can work with any available NVIC IRQ, not
bound to use the last 2 NVIC lines. It makes use of
the dynamic IRQ feature.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-08-29 13:05:12 +02:00
Ioannis Glaropoulos
eddf058e1e arch: arm: be able to infer Z_ARCH_EXCEPT() for baseline SOCs
This commit makes it possible to infer Z_ARCH_EXCEPT()
calls in SVCs that escalate to HardFault due to being
invoked from priority level equal or higher to the
interrupt priority level of the SVC Handler.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-08-29 11:29:50 +02:00
Marti Bolivar
a09d3d69f9 doc: west: add tl;dr for moving to west and troubleshooting
These are based on user feedback on slack and the mailing list.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-29 10:39:42 +02:00
Marti Bolivar
bd4b24810a doc: west: add v0.6.1 documentation
West v0.6.1 has been released. The main feature is that "west update"
now avoids communicating with the network by default when project
revisions have already been fetched.

This allows for offline operation and significantly speeds up the
command (it's 10 times faster on my machine and home network).

There are other miscellaneous changes as well; document them also.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-29 10:37:58 +02:00
Marti Bolivar
1620d29ba6 doc: west: add some missing information
There's missing overview documentation for some miscellaneous
commands. Add it.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-29 10:37:58 +02:00
Ioannis Glaropoulos
aa066d4139 release: Zephyr 2.0.0-rc2
Bump to 2.0.0-rc2.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-08-29 09:16:39 +02:00
Marti Bolivar
cfd1f4950f doc: fix zephyr-app-commands for west
Always show how to build. We can't do anything without a build
directory.

Fixes: #18760
Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-08-29 08:18:14 +02:00
Ioannis Glaropoulos
91c7d0c13a manifest: update to use mbedTLS v2.16.2
Update manifest, to point Zephyr to use
mbedTLS v2.16.2.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-08-28 20:34:06 +02:00
Kumar Gala
749ca106a0 libc: Make libc-nano default for ARM toolchain if newlib
The ARM embedded toolchain has 2 newlib based libc build variants, one
that utilizes the "nano" configuration which is more in line with the
Zephyr SDK.  Make the "nano" cfg the default if newlib is enabled to
match closer how the Zephyr SDK behaves.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-08-28 10:59:29 -05:00
Erwan Gouriou
e15852cd62 samples: counter: Add err check on set_alarm call
Error checking was missing following call to
counter_set_channel_alarm.
This was reported in coverity report 203523.

Fixes #18374

Additionally remove unneeded err initialization in main function

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-08-28 09:19:23 -05:00
Jukka Rissanen
ae5db66b8c net: conn_mgr: Check IPv4 events against command
Make sure we use the IPv4 event command when checking IPv4 address
add or delete instead of event mask.

Coverity-CID: 203483
Fixes #18400

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-28 14:58:28 +02:00
Mieszko Mierunski
6a6ed174b7 drivers: uart: Properly configure pins in NRF UARTE power management
Configure pins before enabling and after disabling UARTE through
power management functions.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-08-28 14:04:18 +02:00
Wolfgang Puffitsch
e8e668ae9c Bluetooth: controller: Fix endianness for length update.
Fix endianness when accessing length update parameters in PDU.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2019-08-28 13:03:39 +02:00
Vinayak Kariappa Chettimada
3f894250ef Bluetooth: controller: Fix Enc setup reset on rejection
Fix reset of Encryption Procedure state on reception of
REJECT_IND and REJECT_EXT_IND.

This is a regression in commit 79cb615770 ("Bluetooth:
controller: split: Port Enc setup to be queueable")

Relates to #18578.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-08-28 12:07:40 +02:00
Alexey Brodkin
d52b8df96b arch: arc: threads: Comment clean-up
commit 780324b8ed ("cleanup: rename fiber/task -> thread")
seems to be done by a script and in that particular case turned
menaingful sentence into nonsense. Alas, threads might be in all
four states.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Anas Nashif <anas.nashif@intel.com>
2019-08-28 11:53:32 +02:00
Alexey Brodkin
4449ad52da arch: arc: _rirq_exit: Comment clean-up
We manage IRQs in a quite a different way now since
commit f8d061faf7 ("arch: arc: add nested interrupt support")
so that comment not only makes no sense but also may fool a reader
as disabling of interrupts happens in the very beginning of
_rirq_exit() but not here.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
2019-08-28 11:53:32 +02:00
Michael Scott
098f1c9bfa net: lwm2m: tlv: fix float32/64 sign handling
When val1 is 0, we need to handle a negative val2 value so that we
generate correct TLV value.

Example: val1 = 0, val2 = -500000 is equivalent to -0.5 decimal.
Currently we generate: 0.5 (losing the sign).

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16154

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-28 10:58:11 +02:00
Michael Scott
d52b5843c7 net: lwm2m: json: use plain text formatter for float32/64
Current JSON formatting for float32/64 is broken in a similar way as
plain text.  Let's use the newly fixed logic for plain text to
generate the float32/64 values in the JSON string.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16154

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-28 10:58:11 +02:00
Michael Scott
404a4b8556 net: lwm2m: plain text: expose put_float32/64 functions
We can use the plain text float32/64 formatter for JSON as well, so
let's expose the put_float32/64 functions.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-28 10:58:11 +02:00
Michael Scott
cdcb33b75f net: lwm2m: plain text: fix float formatting
Formatting a float32/64 value for plain text is broken.
Example for 32bit: val1=0 and val2=500000 is equivalent to 0.5

Current formatter was using %d.%d (%lld.%lld for 64bit) so
exported value was 0.500000 (or 0.5)

To fix this, for val2 use a zero-padded formatter for the maximum
length of each bit length (6 for 32bit and 9 for 64bit), and then
remove the zero characters at the end of the string.

Notes re: handling of val1/val2 signs:
- eliminate potential negative sign when converting val2 to avoid:
  a value like: 0.-5
- use negative val2 when val1 is 0 to fix small negative handling
  such as -0.5

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16154

Signed-off-by: Michael Scott <mike@foundries.io>
2019-08-28 10:58:11 +02:00
Jukka Rissanen
7c2f063625 tests: kernel: Add unit test for sys_put|get_le64()
Make sure sys_put|get_le64() works as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-28 09:39:56 +02:00
Jukka Rissanen
753600fa71 tests: kernel: Add unit test for sys_put|get_le32()
Make sure sys_put|get_le32() works as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-28 09:39:56 +02:00
Jukka Rissanen
6b1e44a3ed tests: kernel: Add unit test for sys_put|get_le16()
Make sure sys_put|get_le16() works as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-28 09:39:56 +02:00
Jukka Rissanen
a7a5e6912f tests: kernel: Add unit test for sys_put|get_be16()
Make sure sys_put|get_be16() works as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-28 09:39:56 +02:00
Jukka Rissanen
0587b7ecb5 tests: kernel: Add unit test for sys_put|get_be32()
Make sure sys_put|get_be32() works as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-28 09:39:56 +02:00
Jukka Rissanen
0dcc637e7d tests: kernel: Add unit test for sys_put_be64()
Make sure sys_put_be64() works as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-28 09:39:56 +02:00
Jukka Rissanen
78825ed789 sys: byteorder: Add support for sys_put_be64()
There is sys_get_be64() but nothing for storing a 64-bit
big-endian version.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-28 09:39:56 +02:00
Jukka Rissanen
bbac6e5ca0 tests: kernel: Add unit test for sys_get_be64()
Make sure sys_get_be64() works as expected.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-28 09:39:56 +02:00
Jukka Rissanen
0a6a10d0c4 sys: byteorder: Add support for sys_get_be64()
There is sys_get_le64() already but nothing for 64-bit
big-endian version.

Fixes #18258

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-08-28 09:39:56 +02:00
Wayne Ren
3590c80aaf arch: arc: for fast irq ERET has no copy of ilink
we should not rely on that eret has a copy of ilink in fast
irq handling. This will cause crash for hs cores.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-28 08:22:14 +02:00
Wayne Ren
44c917e6b2 arch: arc: fix the bug that interrupt stack is not switched
For the old codes, if nest interrupts come out after _isr_wrapper
and before _check_nest_int_by_irq_act, then multi-bits in irq_act
will be set, this will result irq stack will not be switched in
correctly

As a fix, it's still need to use nest interrupt counter to do
interrupt stack switch as before

The difference is in the past exc_nest_count is used, but here
_kernel.nested/_kernel.cpus[cpu_id].nested is used.

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-28 08:22:14 +02:00
Wayne Ren
146c7e8c7e arch: arc: secure world only check secure interrupt
* in arc secureshield interrupts can be configured
  as secure or normal
* in sw design, high interrupt priorites are allocated to
  secure world, low priorities are allocated to normal world.
* secure interrupt > secure thread > normal interrupt > normal
  thead

So, here secure world/firmware only checks secure interrupt
priorities

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-28 08:22:14 +02:00
Wayne Ren
bb0a189d42 arch: arc: use _curr_cpu to replace _curr_irq_stack
use _curr_cpu to record the _cpu_t of each cpu.
the irq_stack is also covered

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-28 08:22:14 +02:00
Wayne Ren
5dbd4ce738 arch: arc: not allowed to switch to thread preempted by exception
it's not allowed to switch to thread preempted by exception as
its context is not saved.

So if a thread switch is required in exception handling, e.g.
kill a thread, the old thread cannot be switched back

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-28 08:22:14 +02:00
Wayne Ren
5a73bf3966 arch: arc: fix and optimize the handling of SECT_STAT.IRM
For arc processor equiped with secureshield, SEC_STAT.IRM
bit should be recorded, it determins which mode irq should
return

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-28 08:22:14 +02:00
Wayne Ren
8cbcdd71ec arch: arc: secure stat should also be reset correctly
secure status should aslo be set correctly

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-28 08:22:14 +02:00
David B. Kinder
849f76e793 doc: remove modernizr.min.js from RTD theme
modernizr.min.js is causing unnecessary reloads of a page causing
flashing of the browser window during page load (most noticiable with
firefox).  This empty script effectively wipes out the modernizr.min.js
unnecessarily loaded by the Sphinx rtd theme (see
https://github.com/readthedocs/sphinx_rtd_theme/issues/724)

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-08-27 22:49:44 -04:00
Paul Sokolovsky
0906671a7b posix: pthread: pthread_mutex_timedlock should accept absolute deadline
It was coded as if it accepts relative timeout. Normative reference:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_timedlock.html

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-08-27 17:50:48 -04:00
Paul Sokolovsky
68c7dc6b96 posix: pthread: pthread_cond_timedwait should accept absolute deadline
Instead, it was coded as if it accepted a relative timeout. Normative
reference:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_timedwait.html

Fixes: #17812

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-08-27 17:50:48 -04:00
Peter Bigot
3f93f89558 doc: relnotes: add littlefs file system support
Trivial change to note support for littlefs added to the File System
subsystem.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-08-27 22:05:53 +02:00