Commit graph

41120 commits

Author SHA1 Message Date
Andrei Emeltchenko
c87384875c samples: wpan_serial: Allow to build for more boards
Allow to build also for general boards with supported ieee802154 and
usb, like reel_board, etc.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko
d78a06428a samples: wpan_serial: Refactor wpan_serial
Refactor code simplifying packet processing, removing unneeded
semaphore, etc.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko
292efefaf3 samples: wpan_serial: Use logger hexdump helper
Remove hexdump() based on printk and use standard logger helper.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko
8315420df0 samples: wpan_serial: Take into account bytes written
uart_fifo_fill() returns number of bytes written, use helper to write
all bytes.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko
f4f9dc6005 samples: wpan_serial: Update README
Update README and reformat it to rst.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko
80e4321a5b samples: wpan_serial: Create cc2520 overlay
Create cc2520 overlay file. Can be used with:

cmake -DBOARD=quark_se_c1000_devboard \
  -DOVERLAY_CONFIG=overlay-cc2520.conf ..

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Andrei Emeltchenko
095d8070db samples: wpan_serial: Allow to use other 15.4 devices
This allows to select different IEEE802.15.4 chips instead of
hardcoded cc2520.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-20 23:02:42 -05:00
Ulf Magnusson
fa128cb0ac boards: up_squared: kconfig: Remove unused board variant symbols
The CONFIG_UP_SQUARED_{ATOM,CELERON,PENTIUM} symbols are unused after
commit c5e582038c ("boards/x86/up_squared: default to new local APIC
timer").

Since these symbols are the only thing in boards/x86/up_squared/Kconfig,
which is osource'd in in board/Kconfig, just remove the entire file.

Found with a script.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-20 21:48:29 -05:00
Nicolas Pitre
11a1ae5f7a test_pipe_contexts: fix mempool size issue and async pipe coverage
The minimum possible mempool block size is either 8 or 16 for 32-bit or
64-bit targets respectively. Defining BYTES_TO_WRITE to 4 and using that
with K_MEM_POOL_DEFINE() won't produce the expected result i.e. only 1
block at any time could be allocated instead of 4.

Yet, the test does run successfully regardless of the block allocation
loop in tpipe_block_put().

It turns out that the pipe buffer is large enough to consume all the
block data synchronously, meaning that the mempool block is freed right
away and available for the next loop iteration. This also means that the
asynchronous delivery mechanism is never exercized.

Fix both issues by defining PIPE_LEN and BYTES_TO_WRITE in terms of
_MPOOL_MINBLK with the expected factor of 4, and adding a new test
using the half-sized pipe where the pipe buffer gets saturated and
mempool memory blocks are actually queued for asynchronous consumption.

The source data string has to be extended to accommodate larger pipe
sizes too.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-12-20 20:43:01 -05:00
Nick Ward
b5f335b11b mcumgr: BT SMP transport config for authenticated requirement
This commit introduces a new Kconfig symbol MCUMGR_SMP_BT_AUTHEN.
When selected it configures the Bluetooth mcumgr transport to require
an authenticated connection.

If the Bluetooth mcumgr transport is selected then this new symbol is
selected by default.  Bluetooth SMP is also selected to ensure Zephyr
is configured with Bluetooth security features enabled to provide
Bluetooth authentication APIs to the user's app.  Users can choose to
disable this level of security for the Bluetooth mcumgr transport if
they do not require it.

Fixes #16482

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2019-12-20 20:28:39 -05:00
Jack Rosenthal
a07acbd7a7 board: arm: Add google_kukui board
This adds support for the EC (embedded controller) on a Google
reference board with codename "kukui". This board uses the STM32F098RC
chip. We built an application for the board and verified UART
functionality on the board.

Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2019-12-20 20:27:20 -05:00
Jack Rosenthal
53ed9e57a2 soc: stm32f0: Add support for STM32F098xx SOC
This adds a Kconfig options and device tree configs for the STM32F098
series of SoC.

Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
2019-12-20 20:27:20 -05:00
Jack Dähn
e41bdcd545 cmake: Fix CMAKE_BUILD_TYPE and OPTIMIZATION_FLAG match check
The check introduced in #18777 uses incorrect CMake syntax.
IN_LIST requires the list variable name, not its content.

Signed-off-by: Jack Dähn <jack@jkdhn.me>
2019-12-20 20:26:20 -05:00
Peter Bigot
c2723054f6 samples: sensor: lps22hh: add standalone sample
Although this sensor is demonstrated by the X-NUCLEO-IKS01A3 sample,
maintenance of the driver is simplified if it can be tested in
isolation.  Provide a sample modeled on hts221.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-20 20:25:11 -05:00
Radoslaw Koppel
2c529ce3b6 kernel: thread: k_thread_foreach_unlocked: Implement
Implement thread foreach processing with limited locking
to allow threads processing that may take more time but allows
missing some threads processing when the thread list is modified.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2019-12-20 20:20:04 -05:00
Hans Wilmers
5b1a524348 sensor: tmp116: Add support for tmp117, fix calculation issues
- Added support for TMP117 in existing driver for TMP116
  The Texas Instruments TMP117 is a higher precision upgrade
   from TMP116. It shares most functionality, but has a
   differing device ID.
   This patch will run with the hardware IDs of both devices.

- Fixed an int promote issue in tmp116_channel_get
  Negative temperature values in drv_data->sample were not
  processed correctly.
  The error occured during integer promotion from u16_t to s32_t
  in this code line:
     tmp = (s32_t)drv_data->sample * TMP116_RESOLUTION;

  By first promoting to s16_t, the correct result is obtained:
     tmp = (s16_t)drv_data->sample * (s32_t)TMP116_RESOLUTION;

- Made temperature resolution compatible to sensor API
  The fractional part of the temperature was returned as a
  multiple of 10^-7 deg.Celsius.
  This differs from the resolution sugegsted by the sensor API,
  which is 10^-6.

  The driver is now returning temperature readings with
  a resolution of 10^-6 deg. Celsius.

- The changed driver was tested using following hardware:
  TMP117 attached to disco_l475_iot1 via i2c1

Signed-off-by: Hans Wilmers <hans@wilmers.no>
2019-12-20 20:18:25 -05:00
Danny Oerndrup
c9d78401cc spinlock: Make SPIN_VALIDATE a Kconfig option.
SPIN_VALIDATE is, as it was previously, enabled per default when having
less than 4 CPUs and either having no flash or a flash size greater than
32kB.

Small targets, which needs to have asserts enabled, can chose to have
the spinlock validation enabled or not and thereby decide whether the
overhead added is acceptable or not.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-12-20 19:51:16 -05:00
Ulf Magnusson
e181e1b773 kconfiglib: Update to hide tracebacks for expected errors
Update Kconfiglib to upstream revision 9c0b562c94 to get this commit in:

    Add Kconfig.__init__() helper flag for suppressing tracebacks

    Tools that don't use standard_kconfig() currently generate spammy
    tracebacks for e.g. syntax errors.

    Add a suppress_traceback flag to Kconfig.__init__() for catching
    "expected" exceptions and printing them to stderr and exiting with
    status 1. Use it to make all tools consistently hide tracebacks.

Use the new flag to hide tracebacks for expected exceptions in
kconfig.py, lint.py, and genrest.py.

Some menuconfig robustness tweaks for wonky terminals are included as
well, and a new feature for customizing .config and autoconf.h header
comments via environment variables.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-20 19:48:09 -05:00
Barry Solomon
6118ca2785 usb: make usb descriptor power options configurable
Add two new kconfig options USB_SELF_POWERED and USB_MAX_POWER.
These can be set by the user to change the USB configuration descriptor.
USB_MAX_POWER can be set to any value between 0 and 250, but practically
should be 50 or 250. These values are half the ammount of mA that the
device will tell the host that it needs.
USB_SELF_POWERED sets the 7th bit in bmAttributes of the USB config
descriptor. Should be set to y if the device has its own power source
other than USB.

Signed-off-by: Barry Solomon <barry.solomon@dexcom.com>
2019-12-20 19:46:16 -05:00
Ulf Magnusson
86dc23a15d dts: bindings: Remove "provides a base representation" from bindings
Newly-introduced stuff. See
https://github.com/zephyrproject-rtos/zephyr/pull/20793.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-20 19:45:06 -05:00
Ulf Magnusson
0ac6e6bf36 dts: bindings: Remove redundant document separators
Not needed. Prevent them from being copy-pasted.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-20 19:45:06 -05:00
Emil Obalski
939c05a7af usb: hid: Make it possible to specify HID debug level
Until now HID class derived log level from USB stack.
By this commit new Kconfig option for HID specific log
level is introduced.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-20 19:30:22 -05:00
Maksim Masalski
de345e2a63 docs: mec15xxevb assy6853 updated set up manual
the .. image directive can only have white-space before. Resolved it.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-12-20 13:03:29 -05:00
Maksim Masalski
b7f07dcff7 docs: mec15xxevb assy6853 updated set up manual
Setup manual was modified, added detailed description how to launch
and program board, added more photos for better understanding
of the setup process.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2019-12-20 13:03:29 -05:00
Ulf Magnusson
ea3041dbbe doc: extract_content.py: Detect included files in a more robust way
Allow '.. <figure/include/image/...>:: <path>' to appear anywhere within
a line, and find multiple directives on a single line. This is needed to
find files included e.g. within tables.

Implemented by making the <path> part of the regex more specific and
searching for matches anywhere within the contents of the file. Should
be a bit faster too.

Maybe there's some tiny potential for false positives, but this
generates the same file list as the old version for the current docs at
least.

Fixes: #21466

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-20 13:02:00 -05:00
Carlo Caione
d048faacf2 aarch32: Add header shims to support old file locations
Out-of-tree code can still be using the old file locations. Introduce
header shims to include the headers from the new correct location and
print a warning message.

Add also a new Kconfig symbol to suppress such warning.

The shim will go away after two releases, so make sure to adapt your
application for the new locations.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-12-20 11:40:59 -05:00
Carlo Caione
13e671e381 arch: arm: Fix header guards
Fix the header guards for the ARM header files to reflect the new code
location.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-12-20 11:40:59 -05:00
Carlo Caione
aec9a8c4be arch: arm: Move ARM code to AArch32 sub-directory
Before introducing the code for ARM64 (AArch64) we need to relocate the
current ARM code to a new AArch32 sub-directory. For now we can assume
that no code is shared between ARM and ARM64.

There are no functional changes. The code is moved to the new location
and the file paths are fixed to reflect this change.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
2019-12-20 11:40:59 -05:00
Jose Manuel Pacheco Luna
8e5e812252 boards: rv32m1_vega: Documentation and sanity test support
Edited the index.rst file to say spi functionality is included. Also
edited the .yaml file in the boards directory to support spi for sanity
tests.

Signed-off-by: Jose Manuel Pacheco Luna <manuel.pacheco@nxp.com>
2019-12-20 17:06:10 +01:00
Jose Manuel Pacheco Luna
b90e0587a3 tests: spi_loopback: Add rv32m1 configuration
Adds a board-specific configuration for the rv32m1 VEGAboard to the
spi_loopback test.

Enabled slave number 2, and turned on debug configurations to debug
effectively and from excess code being optimized out.

Signed-off-by: Jose Manuel Pacheco Luna <manuel.pacheco@nxp.com>
2019-12-20 17:06:10 +01:00
Jose Manuel Pacheco Luna
19097e407c riscv: Configured pinmux for Arduino header SPI
Added in enablement for the SPI-0 instance pins, as found in the
board schematic files. These connect to the arduino headers on the
front of the board.

Signed-off-by: Jose Manuel Pacheco Luna <manuel.pacheco@nxp.com>
2019-12-20 17:06:10 +01:00
Jose Manuel Pacheco Luna
51fc06a708 riscv: enabled spi-0 in defconfig and dtsi files
In preparation for enabling the spi-0 instance

Signed-off-by: Jose Manuel Pacheco Luna <manuel.pacheco@nxp.com>
2019-12-20 17:06:10 +01:00
Anas Nashif
6b01656c4b samples: sensor: fix test identifier
use sample.sensor.shell instead of test.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-20 10:35:13 -05:00
Joakim Andersson
b69edc3844 Bluetooth: HCI: Check length of VS command complete
Always check that the length of the returned command complete
event for a vendor specific command matches the expected length
when the support for Zephyr VS HCI commands are uncertain.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-20 15:45:34 +01:00
Joakim Andersson
a34d4afe7d Bluetooth: Host: Fix issues with host IRK handling
Fix multiple issues related to the way the host handles
Identity Information related to privacy

1. If the controller provided a public address the IRK
   for this identity would be randomly generated but not
   stored persistenly.

2. Fix the handling of the above issue which was fixed
   for the random address but would initiate settings save
   ID on every boot.

3. Fix the host not using the Vendor Specific HCI commands
   related to retrieving the Identity Root (IR) from the
   controller and using the key diversified function d1
   to generate an IRK as specified in the BT Core spec.

Make sure that a Host generated ID is only saved when it is first
generated.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-20 15:45:34 +01:00
Joakim Andersson
091ebf905d Bluetooth: controller: Return FICR as a static address IR
Return the IR defined in FICR as the Identity Root for the static
address through the read static addresses command instead of providing
it through the Read Key Hierarchy Root command.
This is following the recommendations in the Zephyr HCI extension
document in doc/reference/bluetooth/hci.txt

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-20 15:45:34 +01:00
Jukka Rissanen
56101c3c9a samples: bluetooth: ipsp: Mark accepted socket correctly in accept()
The TCP code expects that we know when the socket has called accept()
in order to continue connection attempt.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-20 16:45:06 +02:00
Joakim Andersson
896619ad40 Bluetooth: controller: Fix controller address check
Fix controllers address check in cases of controller-based privacy.
When controller has been instructed by the host to use privacy
the controller should look up the peer identity address and generate
an address based on the local IRK. In the case where no match
is found or the local IRK is all zeroes the controller shall use
the fallback address. If the fallback address is not valid the
controller shall return invalid params.

This commit fixes these issues:
 - Starting a private advertiser without valid random address set
   but a valid local IRK exists. In this case the advertiser should
   be able to advertise using the RPA regardless of a valid random
   or public address.
 - Starting a private advertiser with a fallback to the public
   address type or an adveriser using public address  does not
   check if a valid public address exists. The host cannot
   advertise with an all-zero public address.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
2019-12-20 15:26:41 +01:00
Øyvind Rønningstad
8531c7cb44 riscv: linker.ld: Port vector table to zephyr_linker_sources()
Put it in its own linker file snippet.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-12-20 08:54:53 -05:00
Øyvind Rønningstad
0b2c8e201c arm, x86, riscv: linker.ld: Move TEXT_SECTION_OFFSET
to its own linker file snippet so snippets can be placed before it.
Using zephyr_linker_sources().

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-12-20 08:54:53 -05:00
Øyvind Rønningstad
1134f1b49d cortex_m: linker.ld: Port secure entry funcs to zephyr_linker_sources()
Place in its own linker snippet file.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-12-20 08:54:53 -05:00
Øyvind Rønningstad
3925132456 arc: linker.ld: Port vector table to zephyr_linker_sources()
Place it in its own linker file snippet.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-12-20 08:54:53 -05:00
Øyvind Rønningstad
b1026da300 arm: linker.ld: Port the CC32xx flash header to zephyr_linker_sources()
Add the .dbghdr sections via its own linker script snippet.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-12-20 08:54:53 -05:00
Øyvind Rønningstad
54c1af861c arm: linker.ld: Port NXP_IMX_RT_BOOT_HEADER to zephyr_linker_sources()
Add the .boot_hdr.* sections via its own linker script snippet.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-12-20 08:54:53 -05:00
Øyvind Rønningstad
f5fda5cfa1 arm: linker.ld: Port KINETIS_FLASH_CONFIG to zephyr_linker_sources()
Add the .kinetis_flash_config via its own linker script snippet.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-12-20 08:54:53 -05:00
Øyvind Rønningstad
321462b310 arm: linker.ld: Port the vector table to zephyr_linker_sources()
Also port vector table relay.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-12-20 08:54:53 -05:00
Øyvind Rønningstad
1a2ff6deda cmake: Add sorting of linker snippets by key
Allows snippets to be placed in a predictable order into the linker
script. This is useful for data that must be placed at a particular
location.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-12-20 08:54:53 -05:00
Øyvind Rønningstad
d1c2a4edbf cmake: Add the TEXT_START location to zephyr_linker_sources()
Places linker code at or near the beginning of the text section.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-12-20 08:54:53 -05:00
Daniel Leung
076eee3abc subsys/random: fix unused value warning
When using LLVM/Clang, it complains about memcpy() being
casted to (void *):

  warning: expression result unused; should this cast be to 'void'? [-Wunused-value]

So change those to (void) instead as the return of memcpy()
is not used anyway.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-20 08:51:53 -05:00
Henrik Brix Andersen
99df8251bf boards: reel_board: add all LEDs to device tree
Add the green LED on the back of the reel_board to the device tree and
add PWM support for the front RGB LED.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-12-20 08:49:43 -05:00