Commit graph

44172 commits

Author SHA1 Message Date
Pascal Brogle
18a51a0bf6 net: lwm2m: use defines for message id and token generation
message id 0 and token 0 have special semantics in the lwm2m engine,
they are used to request generation of new id, mark them as such.

Signed-off-by: Pascal Brogle <pascal.brogle@husqvarnagroup.com>
2020-09-17 13:34:19 -05:00
Carles Cufi
121937e071 Bluetooth: controller: Make RX prio thread stack configurable
Now that CONFIG_BT_CTLR_RX_PRIO_STACK_SIZE defines a stack size, allow
for it to be configurable from a .conf file just like the rest of the
threads in Bluetooth.

Fixes #27768.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-09-17 18:08:21 +02:00
Daniel Leung
946c8f0584 tests: latency_measure: move timing_init() earlier
Move the call to timing_init() earlier before function call
to get frequency. Some arch/SoC/board require initialization
before there is a valid frequency value. Or else the printed
value would not be useful.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-17 10:54:40 -04:00
Anas Nashif
2164a7d0dc samples: display: add fixture
Add fixture so this test only runs on devices that have a display
connected.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-17 07:10:03 -04:00
peng1 chen
bcf1aed311 tests: fix potential integer overflow
fixed coverity issue #28413.

Signed-off-by: peng1 chen <peng1.chen@intel.com>
2020-09-17 07:09:29 -04:00
Emil Obalski
464d9130d5 samples: mgmr: smp_svr: Build samples in CI.
This commit allows the CI to build the samples for nRF devices.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-17 10:56:57 +02:00
Emil Obalski
6a56710aae samples: mgmt: smp_svr: Add Serial over USB CDC_ACM overlay.
This patch adds overlay for USB serial backend over CDC_ACM
device.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-17 10:56:57 +02:00
Trond Einar Snekvik
d7e0d8135f Bluetooth: Mesh: Use #ifdef for provisioner build
Replaces the current zero length array for provisioner data with
ifdefs, to silence new gcc 10 warnings about array element access.

Fixes #28371.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-09-17 11:51:13 +03:00
Spoorthy Priya Yerabolu
04d3c3c1a0 docs: ref: kernel: memoryslabs: Adding notes if APIs called from ISR
Added a note in documentation for k_mem_slab_alloc(),
k_mem_pool_alloc() and k_heap_alloc() are safe
to call in an interrupt with the timeout K_NO_WAIT.

Fixes: #28020

Signed-off-by: Spoorthy Priya Yerabolu <spoorthy.priya.yerabolu@intel.com>
2020-09-17 09:31:28 +02:00
Jukka Rissanen
060d36537a drivers: eth: Fix return value if we run out of bufs in TX
The correct return value is -ENOBUFS if we run out of network
buffers when sending the packets.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-17 09:31:10 +02:00
Jukka Rissanen
c8294db083 doc: net: Add note about socket API thread safe status
Currently the socket API is not thread safe so mention this in
socket API documentation. The plan is to add locks in 2.5 release.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-17 09:30:52 +02:00
Watson Zeng
37f75d2d1f kernel: sched: bug fix for trace and monitor
sys_trace_thread_abort and z_thread_monitor_exit in
z_thread_single_abort also need to be protected by
sched_spinlock, otherwise when after the spinlock
release, if there is an pending interrupt, it will cause an
sched in the interrrupt exit, and those trace and monitor
function will never reach.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-09-17 09:30:22 +02:00
Andrew Boie
8240d7d07b x86: memory map BIOS Data Area
Changes to paging code ensured that the NULL virtual page is
never mapped. Since RAM is identity mapped, on a PC-like
system accessing the BIOS Data Area in the first 4K requires
a memory mapping. We need to read this to probe the ACPI RSDP.

Additionally check that the BDA has something in it as well
and not a bunch of zeroes.

It is unclear whether this function is truly safe on UEFI
systems, but that is for another day.

Fixes: #27867

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-16 20:37:34 -04:00
Ruud Derwig
0076313bcb soc: arc: Increase cpu frequency for nsim_hs_smp
0.5 Mhz with 100 ticks per sec leaves 5000 cycles per tick,
which broke some tests that assumed more work within 1 tick.
Set to 1 Mhz: balance multi-core simulation speed and tick duration.

Fixes #27943

Signed-off-by: Ruud Derwig <Ruud.Derwig@synopsys.com>
2020-09-16 14:35:31 -05:00
Ryan Erickson
1faeab4d54 boards: add Pinnacle 100 DVK
Add Laird Connectivity Pinnacle 100 modem.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
5ac21bd604 drivers: modem: hl7800: fix dts binding
Fix hl7800 vendor prefix to match existing Sierra Wireless entry.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
7b5714669c drivers: modem: hl7800: add IPv6 support
Add support for dual mode IPv4/IPv6 stack.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
03e62be290 drivers: modem: hl7800: do not require DEVICE_POWER_MANAGEMENT
Remove requirement for DEVICE_POWER_MANAGEMENT,
the driver does not need it to operate.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
ad04354110 drivers: modem: hl7800: remove VLA
Remove variable length array from function to comply with MISRA checks.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
c74166ed5e drivers: modem: hl7800: modem receiver IMEI
Modem receiver IMEI data field is only available
when CONFIG_MODEM_SIM_NUMBERS.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
2e7b263013 drivers: modem: hl7800: struct device data renamed
change struct device->driver_data to new name of struct device->data.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Ryan Erickson
61ce2dc681 drivers: modem: hl7800: RTC only available with newlibc
RTC API is only available if NEWLIB_LIBC is available.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2020-09-16 14:21:41 -05:00
Daniel Leung
5632ee26f3 x86: pcie: fallback to config via PIO
When probing for PCI-E device resources, it is possible that
configuration via MMIO is not available. This may caused by
BIOS or its settings. So when CONFIG_PCIE_MMIO_CFG=y, have
a fallback path to config devices via PIO. The inability to
config via MMIO has been observed on a couple UP Squared
boards.

Fixes #27339

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-16 14:16:50 -05:00
NavinSankar Velliangiri
dd8f135e2c mgmt: hawkbit: Fix NULL pointer dereferences
Coverity spots that null pointer is passing to flash_img_buffered_write.
This patch fixes the problem.

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2020-09-16 13:51:55 -05:00
Peter Bigot
a28f570855 tests: bluetooth: shell: add usb shell test configuration
Verify builds and execution when a CDC-ACM UART is used for the shell.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-16 13:32:22 -05:00
Peter Bigot
611263921a usb: add optional work queue
The USB infrastructure currently uses the system work queue for
offloading transfers, CDC-ACM UART transmission/reception, and device
firmware activities.  This causes problems when the system work queue
is also used to initiate some activities (such as UART) that normally
complete without requiring an external thread: in that case the USB
infrastructure is prevented from making progress because the system
work queue is blocked waiting for the USB infrastructure to provide
data.

Break the dependency by allowing the USB infrastructure to use a
dedicated work queue which doesn't depend on availability of the
system work queue.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-16 13:32:22 -05:00
Peter Bigot
2c105e8f0d usb: clean CMakeLists conditions
Use the helper function to conditionally include source files.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-16 13:32:22 -05:00
Peter Bigot
692449d6c7 usb: fix header language linkage
The block that introduced a C linkage region was not closed in the
header as it should be.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-16 13:32:22 -05:00
Peter Bigot
2e99f3b652 usb: cdc_acm: fix formatting specifiers in log messages
The z length modifier must be applied to avoid build errors when the
format is verified by the compiler on systems where size_t is larger
than int.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-16 13:32:22 -05:00
Emil Obalski
da93a9e50f usb: cdc_acm: Do not change rx/tx_irq_ena flags on RESET and CONFIGURED
Both tx_irq_ena and rx_irq_ena flags shall be updated only
by using UART API. Those flags are used to let the device
start sending or receiving data. Changing those flags without
awareness of the user may lead to errors.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-16 13:25:12 -05:00
Emil Obalski
d6dba72502 usb: cdc: Semaphore per CDC_ACM instance.
Usage of `pool_wait_sem` was incorrect. The semaphore shall be
dependent on context it was called for. In case of many CDC_ACM
devices one could possibly block others. This fixes an issue by
making semaphore a part of the internal CDC_ACM device structure.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-16 13:21:49 -05:00
Peter Bigot
4078442bfd Revert "doc: release: 2.4: note behavior change in device_get_binding"
This reverts commit 6dde16d9f8.

The original behavior has been restored for this release.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-16 13:13:22 -05:00
Mahesh Mahadevan
1b6f21b615 west.yml: Update hal_nxp revision
Includes the fix for the FLASH_SIZE on MXRT devices

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2020-09-16 13:11:48 -05:00
Andrew Boie
a8775ab8cb sched: don't use local lock in z_tick_sleep()
We're modifying thread_state. Use sched_spinlock instead.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-16 13:11:12 -05:00
Andrew Boie
8e0f6a5936 sched: hold spinlock in z_time_slice()
We are checking thread->base members like thread_state and prio
and making decisions based on it, hold the sched_spinlock to
avoid potential concurrency problems if these members are modified
on another CPU or nested interrupt.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-16 13:11:12 -05:00
Andrew Boie
83d7770de4 sched: check if runnable in sliceable()
We need to check if a thread is runnable at all before we
contemplate putting it on the end of the priority queue,
it might not be on the queue at all if it was suspended.

Replaces the less comprehensive check to see if the thread
was pending a timeout.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-16 13:11:12 -05:00
Andrew Boie
ffc5bdffbb sched: hold spinlock in z_thread_timeout()
We are checking and modifying members of thread->base
(in particular it's waitq and thread_state) which are
nominally protected by sched_spinlock. Hold it while
doing this to avoid concurrent changes on another CPU
or ISR preeemption.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-16 13:11:12 -05:00
Jian Kang
339c8b1b00 tests: mailbox: add new tests
Add 2 new test cases for verify mailbox features

Signed-off-by: Jian Kang <jianx.kang@intel.com>
2020-09-16 12:13:05 -04:00
Maureen Helm
319e28102b Revert "boards: lpcxpresso55s69_cpu1: disable sanitycheck"
This reverts commit 774ab86617.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-16 09:27:54 -05:00
Maureen Helm
7d2b75861e boards: arm: Add entropy dts chosen node for lpcxpresso55s69_cpu1
Adds an entropy dts chosen node for the lpcxpresso55s69_cpu1 board
configuration. Commit 50830385d8 added
this for the _cpu0 and _ns board configurations, but missed the _cpu1
board configuration.

Fixes sanitycheck build errors for network socket samples.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-09-16 09:27:54 -05:00
Andrew Boie
785c79c2a6 doc: release-notes: kernel & x86
Updates to the core kernel and x86 for this release.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-16 08:43:14 -05:00
Flavio Ceolin
d6ce361042 mbedtls: Bump to 2.16.8
Update mbedTLS version.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-16 08:36:07 -05:00
Peter Bigot
6186b65555 samples: sensor: lps22hh: replace platform filter with fixture
Remove reference to a specific board, since that board doesn't have
this sensor.

Add a dependency on presence of a devicetree node that will be
required to build the driver.

Add a fixture that identifies the specific sensor required to run the
sample.  This should be added as a side effect of specifying the
shield (though this is not currently done, it must be added in the
device description).

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-16 09:05:41 -04:00
Jian Kang
f4c7dbd043 test: add new test cases for timer
Add new test cases for timer to improve testing infrastructure.
Add different waiting time in existing cases. For new test cases,
restart timer and check for status of timer.

Signed-off-by: Jian Kang <jianx.kang@intel.com>
2020-09-16 08:15:47 -04:00
Ying ming
e3355067f5 test: scheduling: add test case
Add a test case of preemptive thread scheduling.
The scheduler will select the highest priority and
waiting longest thread to be the current thread.

Signed-off-by: Ying ming <mingx.ying@intel.com>
2020-09-16 08:06:42 -04:00
Andrzej Puzdrowski
45c8c51a62 manifest: mcuboot update
Fixed build issue for multiple CONF_FILEs.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-09-16 12:06:09 +02:00
Flavio Ceolin
e28d3404eb mgmt: hawkbit: Fix resources leakage
Coverity spots that memory allocated for addr was leaking, but the
code was also leaking the socket file descriptor in the error path.
This patch fixes both problems.

Fixes #28172

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-16 12:05:21 +02:00
Eduardo Montoya
a136f2f695 net: openthread: fix initialization with link raw enabled
Fix the OpenThread initialization to prevent the IPv6 interface to
be enabled when `CONFIG_OPENTHREAD_RAW` is set.

Signed-off-by: Eduardo Montoya <eduardo.montoya@nordicsemi.no>
2020-09-16 12:05:07 +02:00
Peter Bigot
2534b18bb1 tests: posix: common: remove sub-microsecond nanosleep test
Beyond the complexities of tick resolution on QEMU, this test is
invalid because POSIX nanosleep as currently implemented uses
k_busy_wait(ns / 1000) which means it's measuring the duration of
k_busy_wait(0) in ticks, which has no reasonable relation to 1 ns
regardless of tolerance.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-16 12:04:04 +02:00
Watson Zeng
6bddbc95c6 tests: kernel: stack: fix for memcmp with wrong length
fix for memcmp with wrong length

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-09-16 12:03:32 +02:00