Commit graph

41120 commits

Author SHA1 Message Date
Andrew Boie
c5e3688583 lib: os: don't cast mutex pointers to u32_t
Just use the correct data type.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
e48ed6a980 kernel: use uintptr_t for kobject data
This has to be wide enough to store a pointer.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Andrew Boie
a824821b86 kernel: fix k_mem_partition data types
We need a size_t and not a u32_t for partition sizes,
for 64-bit compatibility.

Additionally, app_memdomain.h was also casting the base
address to a u32_t instead of a uintptr_t.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-12-12 14:48:42 -08:00
Vladimir Atanasov
8e0e23fefc soc/kl2x: added I2C_1 labels
added I2C_1 labels for kl2x soc in dts_fixup.h

Signed-off-by: Vladimir Atanasov <vlado.atanasov@gmail.com>
2019-12-12 15:13:59 -06:00
Jose Alberto Meza
7c25431655 drivers: pwm: xec: Use unique log module identifier for PWM
Use unique log module identifier for PWM to avoid link error.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-12-12 11:47:50 -08:00
Jose Alberto Meza
b3236ebf42 boards: arm: mchp: Enable additional drivers for MEC15xxEVB board
Configure as GPIOs pins that by default are not GPIOs
Enable pinmux for port F
Enable ADC, PWM drivers by default, but keep SPI disabled.
Swap I2C instances since I2C0 is multiplexed with UART2
Select VTR3 as 1.8V

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-12-12 11:47:50 -08:00
Jose Alberto Meza
673ee9e84e soc: arm: mchp: Add missing definition for SoC pins
Add missing definition for SoC pin

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-12-12 11:47:50 -08:00
Piotr Zierhoffer
abc8cbfec6 doc: Trivial fix of GSG formatting
The numbered list for installing toolchains on macOS and Windows is not
formatted correctly.

Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
2019-12-12 19:56:38 +01:00
Kumar Gala
306ac6dd1e bluetooth: doc: Cleanup warnings with doc build
Doxygen 1.8.15 or greater has a number of warnings of the form:

  warning: argument 'net_idx' from the argument list of
  bt_mesh_health_period_set has multiple @param documentation
  sections

This is due to the use of @copydetails bt_mesh_health_period_get
which ends up copying all of the details from
bt_mesh_health_period_get which has some of the same @params as
bt_mesh_health_period_set.  To make the generated docs look clean
the easiest is to remove the @copydetails and just copy the
comment.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-12 12:39:35 -06:00
Kumar Gala
a8171db6a6 doc: Fix warnings associated with 'unbalanced grouping commands'
Builds of docs with doxygen 1.8.16 has a number of warnings of the form:
'warning: unbalanced grouping commands'.  Fix those warnings be either
balancing the group command or removing it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-12 12:39:35 -06:00
Kumar Gala
915e52aa13 doc: add .known-issue regex for struct bt_mesh_model_pub warnings
Filter out warnings generated by newer sphinx versions by
'struct bt_mesh_model_pub' having bitfields for
doc/reference/bluetooth/mesh/access.rst

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-12 12:39:35 -06:00
Kumar Gala
5fb312b784 doc: Update warning regex to handler newer sphinx output
Older versions of sphinx produced something like:

file_system/index.rst:58: WARNING: Duplicate declaration.

Newer versions produce:

file_system/index.rst:58: WARNING: Duplicate declaration, fs_statvfs

Change the regex to handle both conditions.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-12 12:39:35 -06:00
Daniel Leung
9602c651c2 json: fix unnamed fields in initializers for GCC < 4.6
The unnamed unions inside json_obj_descr struct causes issues
with the initializer macros due to bug described here:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676
The issue is that for GCC < 4.6, it cannot handle unnamed
fields in initializers. So apply the workarounds described
in the bug report.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-12 11:14:44 -06:00
Brooks Prumo
32e3756d66 include: Fixes #1205, C++ usage of sensor.h
I ran into issue #1205 earlier today and realized the fix was to simply
provide the proper casts.  The issue is that C++ is less permissive than
C here, erroring when trying to implicitly convert from `void *` to
`struct gpio_driver_api *`.  The same cast is done in
include/drivers/gpio.h, which is why I did that here as well.

This fix was validated by compiling my C++ application successfully and
also successfully running my app on my board, interacting with sensors.

Signed-off-by: Brooks Prumo <brooks@prumo.org>
2019-12-12 11:06:34 -06:00
Carles Cufi
788d6eb29f doc: API: Document the modification of stable APIs
In order to make technical progress possible, some stable APIs
may sometimes need to be modified in a non backwards-compatible way.
Describe the process for integrating such changes in the documentation.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-12-12 11:01:38 -06:00
Carles Cufi
e4ad515530 doc: relnotes: Add sections for Stable API Changes
Add the relevant sections for Stable API Changes so that the release
notes can be populated during development.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-12-12 11:01:38 -06:00
Vincent Wan
f1c0eb915b samples: http_get: connect without TLS by default on cc3220sf_launchxl
The example should work on the cc3220sf_launchxl by following the same
flow as on other boards, ie. by connecting with plain http by default
and use TLS only when an overlay is specified. We update the
configuration for cc3220_launchxl to not use TLS by default and the
README to point users to the right overlay file to use.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-12-12 10:53:26 -06:00
Josh Gao
c0026346a3 libc: permit users to supply their own malloc.
Severely memory constrained systems with known allocation patterns can
benefit from providing their own implementation of malloc with
specifically tuned bucket sizes. Provide a switch to allow users to
replace the default malloc implementation with their own.

Signed-off-by: Josh Gao <josh@jmgao.dev>
2019-12-12 10:49:52 -06:00
Dominik Ermel
c16691ffd0 settings: file: Fix possible success status while failed to write
Assuming that fs_seek has been successful; in case when fs_write
would be unsuccessful and fs_close, that follows, would be successful,
the success code would have been returned for the entire procedure,
although it has failed.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2019-12-12 10:44:31 -06:00
Kumar Gala
34b1ef8dd8 sanitycheck: Fix process termination with newer ninja version
It appears that ninja 1.6.0 or greater don't seem to send SIGTERM down
to the child processes and thus we don't terminate correctly.  This
causes a hang with renode simulations.

Change terminate call to 'self.try_kill_process_by_pid()' when test
state is updated (i.e. done running with either passed or failed), in
order to explicitly send a SIGTERM to the simulator process before
sending a SIGTERM to ninja.

Refactor the terminate code so we encapsulate the behavior in one place
for a BinaryHandler.

Based on change from Stephanos Ioannidis <root@stephanos.io>

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-12 09:17:31 -05:00
Sebastian Bøe
01d8dc0289 cmake: toolchain: Don't add -Werror=implicit-int to CXX builds
We do compiler flag compatibility tests to be able to support many
different toolchains and flags in a scalable way. But the test is not
perfect and in these situations we we will need to hardcode whether a
flag is compatible or not.

To support this we have zephyr_compiler_check first check if the flag
is covered by a hardcoded test before testing it.

Currently the only hardcoded compatibilty is that -Werror=implicit-int
is not supported for CXX.

This fixes #21229

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-12-12 07:58:45 -06:00
Kwon Tae-young
88438246c9 tests: eeprom: add testcase for supported boards
Support boards with EEPROM support.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2019-12-12 07:57:33 -06:00
Kwon Tae-young
58702f401c doc: arm: 96b_wistrio: add EEPROM support to the boards doc
EEPROM drivers that support STM32L1 have been tested
on 96b_wistrio boards.
EEPROM support is added to the board documentation.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2019-12-12 07:57:33 -06:00
Kwon Tae-young
4920965398 test: driver: eeprom: add board support for eeprom test cases
The STM32L1's EEPROM function has been tested on 96b_wistrio boards.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2019-12-12 07:57:33 -06:00
Kwon Tae-young
69924b19c8 drivers: eeprom: add driver support for EEPROM of STM32L1
Could not find a supported LL with EEPROM.
So I used HAL.

Tested with: 96b_wistrio

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2019-12-12 07:57:33 -06:00
Kwon Tae-young
a6f5c1bbf6 dts: arm: stm32: add dts support for EEPROM of STM32L1
Add eeprom to STM32L1 series.
Currently supported L1 series EEPROM size is 4Kbyte.

Signed-off-by: Kwon Tae-young <tykwon@m2i.co.kr>
2019-12-12 07:57:33 -06:00
Peter Bigot
bed6eb9ed9 dts: edtlib: remove diagnostic on required with default
A property may be optional with a default in a base yaml, then
overridden to be required in a subordinate file.  Don't prevent this
by complaining about having a default on a required property.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-12 07:55:34 -06:00
Wolfgang Puffitsch
b0207eb778 Bluetooth: host: Refactor checks in update_ccc for efficiency
Check peer address only if active.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2019-12-12 15:26:38 +02:00
François Delawarde
bec05a5d7f settings: Fix settings runtime read callback return value
The settings runtime read callback should return the actual length of
the data that has been read.

Signed-off-by: François Delawarde <fnde@oticon.com>
2019-12-12 13:22:27 +01:00
Joakim Andersson
f7f63c6306 Bluetooth: host: Check for device ready for whitelist API
The whitelist API uses the controller directly through HCI commands.
Bluetooth device must have been initialized before sending HCI commands.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-12-12 12:19:40 +02:00
Jukka Rissanen
e124c1cd34 eth: mcux: Do not set carrier ON if interface is not known
It is possible that the network interface is not yet initialized
when status of the PHY changes. In this case we must not call
net_eth_carrier_on() as that will cause a crash.
This was noticed with mimxrt1050_evk board.

Fixes: #21257

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-12-12 09:50:29 +02:00
Vinayak Kariappa Chettimada
7417e6e09e Bluetooth: controller: split: conn handle invalidation on release
Move invalidation of connection handle to connection context
release done on release of terminate rx node.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2019-12-12 08:48:24 +01:00
Wolfgang Puffitsch
d3e3f8d2b4 Bluetooth: controller: split: Move invalidation of connection handle
Move invalidation of connection handle when flushing TX buffers into
LLL context. Otherwise, LLL may or may not see invalidated handle
depending on mayfly scheduling.

Signed-off-by: Wolfgang Puffitsch <wopu@demant.com>
2019-12-12 08:48:24 +01:00
Aurelien Jarno
a2ddf99f0c Bluetooth: Mesh: fix next_period computation
If the duration to publish is roughly the same as the period, we might
end up with elapsed == period, which returns 0 and cancel the periodic
publication. Instead 1 should be returned, just like when the elapsed
time is greater than the period.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-12-12 09:47:42 +02:00
Christian Taedcke
cdb6332af6 net: ppp: Reset flag is_ipcp_up in ipcp_down
Without this fix is it not possible to terminate pppd and restart
pppd afterwards without restarting the firmware, too.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2019-12-12 09:41:13 +02:00
Christian Taedcke
530855f607 net: ppp: Reset flag is_ipv6cp_up in ipv6cp_down
Without this fix is it not possible to terminate pppd and restart
pppd afterwards without restarting the firmware, too.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2019-12-12 09:41:13 +02:00
Peter A. Bigot
c326661ee6 kernel: init: provide access to kernel startup state
Device initialization may require use of generic services such as
starting up power rails, some of which may be controlled by GPIOs on
an external controller that can't be used until full kernel services
are available.  Generic services can check k_is_in_isr() and mediate
their behavior that way, but currently have no way to determine that
the kernel is not available.

Provide a function that indicates whether initialization is still in
pre-kernel stages where no kernel services are available.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-12-11 14:45:40 -08:00
Johan Hedberg
2d859cc147 Bluetooth: Mesh: Make model publication struct more compact
commit 42d330406e introduced the FastPeriodDivisor value to
to the model publication struct. Based on the way it was grouped it
seems the intention was to fit it within the same octet as other bit
fields, but it actually makes the octet overflow by one bit. This ends
up creating another u8_t variable which in turn adds 24 bits of
padding after it.

To keep the size of the struct as compact as possible, group the flag
together with the key index, since that only requires 12 bits. Some
care is needed here, since the mesh stack does have special internal
key index values that require more than 12 bits such as
BT_MESH_KEY_UNUSED and BT_MESH_KEY_DEV. In this case restricting
ourselves to 12 bits is fine since the value in the model publication
struct follows 1:1 the value received in the Config Model Publication
Set message, and there the parameter is defined to be exactly 12 bits.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-12-11 23:53:41 +02:00
Trond Einar Snekvik
fc56b37116 Bluetooth: Mesh: Refactor CCM
Unifies the Mesh CCM implementation parts for encryption and decryption
into a crypt and an auth step, reducing stack usage and code size.

This change also brings several performance improvements, most notably
reducing copying of the nonce and unrolling the 16 byte XOR operations.

Performance for the Mesh worst case of a 382 byte payload with 16 bytes
of additional data (full transport encrypt with virtual address) goes
from an average of 889us to 780us on nRF52840 with default optimization
flags.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2019-12-11 23:53:02 +02:00
Jose Alberto Meza
9fa30e02f2 drivers: espi: xec: Enable OOB channel by default
Enable ESPI OOB channel by default in XEC driver.
Enable OOB channel transmit interrupt and handle OOB up/down correctly.
Change interrupt clearing, clear low level interrupt bits in subhandlers
and high level interrupt in aggregate handlers at the end.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-12-11 13:22:38 -08:00
Jose Alberto Meza
53f2097967 drivers: i2c: xec: Adhere to MCHP I2C spec recomendations
MCHP I2C spec recommends that for repeated start update control register
De-assert ACK in preparation for NACK to end transfer.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2019-12-11 13:21:47 -08:00
Anas Nashif
3765e46a40 soc: mec1501: fix build failure
When CONFIG_SYS_POWER_DEEP_SLEEP_STATES is not set, we have an unused
function that causes a build failure.
Enclose that function in the #ifdef.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-11 13:09:52 -06:00
Ulf Magnusson
fdb936adae openisa_rv32m1: kconfig: Remove base address/size symbols
RISCV_RV32M1_VECTOR_BASE_ADDR is unused after commit 34b0516466
("boards: riscv32: rv32m1_vega: enable MCUboot for ri5cy core") (it was
called RISCV32_RV32M1_BASE_ADDR then).

RISCV_RV32M1_VECTOR_SIZE is still used, but is always 0x100, so remove
it too.

These symbols were only defined in a Kconfig.defconfig file.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 12:44:47 -06:00
Feng Cheng
ee57c8e749 drivers: flash: Add the flash driver of the stm32f1x family
Most of the code is copied from the stm32f0x family
Tested on stm32f103ze soc

Signed-off-by: Feng Cheng <i@fengch.me>
2019-12-11 12:40:33 -06:00
Ulf Magnusson
5c28f39e7f doc: genrest: Use a separate index page for all symbols
Add an option --separate-all-index that makes genrest.py generate a
separate index-all.rst index page that lists all symbols, instead of
listing all symbols in index.rst. index-all.rst is linked from
index.rst.

This was originally motivated by an external project where index.rst
becomes the top-level page, which runs into a Sphinx bottleneck with
sphinx_rtd_theme. See https://github.com/sphinx-doc/sphinx/issues/6909.

This turned out pretty nice after some feedback from Ruth Fuchss, so use
it for Zephyr too.

Also unclutter the generated documentation a bit by removing some
headings. This makes the navigation menu on the left nicer too.

Piggyback making genrest.py executable, which is handy when running it
manually.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 12:32:30 -06:00
Ulf Magnusson
984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00
Anas Nashif
d91f993e66 sanitycheck: export compile commands on --cmake-only
export compile commands when running with --cmake-only, this can be used
for analysis and coverage statistics.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-11 11:33:44 -06:00
Dominik Ermel
a70a926432 tests: settings: Reducing duplicated code in FS tests
Common code has been moved out of FS specific source into common
source files.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2019-12-11 08:19:20 -05:00
Andrei Emeltchenko
5f629c8929 tests: logging: Remove unneeded excludes
Remove unneeded platform excludes.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-11 06:39:09 -06:00
Andrei Emeltchenko
62617d996e tests: logging: Fix build errors
Add filter "not CONFIG_LOG_IMMEDIATE" since the test relies on the
macros defined when CONFIG_LOG_IMMEDIATE not defined.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-12-11 06:39:09 -06:00