Commit graph

42554 commits

Author SHA1 Message Date
Marcin Niestroj
7996f527d5 net: l2: ppp: ipcp: clear options after protocol goes down
Clear negotiated options in protocol down handler. That way all
addresses are properly requested (by sending 0.0.0.0 in Configure-Req)
in the subsequent option negotiation phases.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-09 13:45:18 +02:00
Vinayak Kariappa Chettimada
eb2a64989b drivers: flash: nrf: Fix flash operation timeout
Fix flash operation timeout due to incorrect use of
secondary ticker to abort any radio in use. Ticker id 0
is reserved for split controller's pipeline preempt timeout.
Using the same ticker id caused the secondary ticker to
not be started if controller is using the same ticker id
for pipeline preempt timeout.

Fixes #26333.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-07-09 07:17:41 -04:00
Peter Bigot
ca76a5be7c tests: drivers: spi_loopback: set CS GPIO flags
Hard-code the active level as there's no reason to make this
configurable.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
2036bbcde4 drivers: sensor: bme280: respect devicetree cs-gpios flags
Forward flags cell from cs-gpios devicetree property into device SPI
configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
9acf7867ec drivers: spi_flash_at45: respect devicetree cs-gpios flags
Forward flags cell from cs-gpios devicetree property into device SPI
configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
eac3f249c2 drivers: eth_enc424j600: respect devicetree cs-gpios flags
Forward flags cell from cs-gpios devicetree property into device SPI
configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
598f4e242d drivers: eth_enc28j60: respect devicetree cs-gpios flags
Forward flags cell from cs-gpios devicetree property into device SPI
configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
ceb5c751b3 drivers: eeprom_at2x: respect devicetree cs-gpios flags
Forward flags cell from cs-gpios devicetree property into device SPI
configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
0f7acb1dc3 drivers: adc_mcp320x: respect devicetree cs-gpios flags
Forward flags cell from cs-gpios devicetree property into device SPI
configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
62e045f979 drivers: adc_lmp90xxx: respect devicetree cs-gpios flags
Forward flags cell from cs-gpios devicetree property into device SPI
configuration.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
9dc7640ede spi-device: set CS gpio flags for all devices that had none
The generic SPI GPIO chip select support now respects devicetree flags
for signal active level.  Update all cs-gpios properties to specify
active low.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:07:07 -05:00
Peter Bigot
a0f025995d drivers: watchdog: update API to reflect additional return code
Allow feed operations that would stall due to internal peripheral
delays to complete immediately with -EAGAIN indicating that the feed
did not occur as expected.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-07-09 06:44:59 -04:00
Aastha Grover
cb0f65e410 requirements-build-test.txt: Updating mock module version
Updating mock module version to >=4.0.1 as sanitycheck testsuite
might fail in some systems due to old version.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2020-07-09 06:26:28 -04:00
Henrik Brix Andersen
b36aea82ce build: reports: add pahole target
Poke-a-hole (pahole) is an object-file analysis tool to find the size of
the data structures, and the holes caused due to aligning the data
elements to the word-size of the CPU by the compiler.

http://git.kernel.org/cgit/devel/pahole/pahole.git

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-07-09 06:24:00 -04:00
Anas Nashif
b8c7de6d9a actions: update daily version for testing
Update versions.json with the daily commit that device testing will be
performed on.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-09 11:29:56 +02:00
Daniel Leung
36c1866cfd benchmarks: sys_kernel: limits to 1 CPU
The sys_kernel tests have some loops that work only with 1 CPU
being active. So limits the number of CPUs to 1 even when SMP
is enabled. This also allows qemu_x86_64 to run, so remove it
from the exclude list.

Fixes #26627

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-09 11:29:07 +02:00
Marcin Niestroj
fdeed32844 adc: adc_shell: suppress -Wchar-subscripts with isdigit()
Suppress -Wchar-subscripts warnings when building with Newlib, by
casting isdigit() parameter to unsigned char.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-09 11:28:54 +02:00
Andrei Gansari
0d5e9f9620 drivers: soc_flash_mcux check before reading
LPC55xxx SoCs don't allow reading erased areas, the flash memory
controller (FMC) will trigger an ECC error for that area. To prevent
reading unwritten areas the low level FMC command of margin checking is
used, this will fail if the area to be read is not correctly written
(margin_check) or area is erased (blank_check).
In the case of an erased page, we return dummy data so the application
can program that area.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2020-07-09 11:28:25 +02:00
Alexandre Bourdiol
c8ceca2d53 drivers: STM32 dualcore concurrent register access protection with HSEM
In case of dualcore, STM32H7, STM32W and STM32MP1,
protect concurrent register write access with HSEM.
Done for following drivers:
clock_control, counter, flash, gpio, interrupt_controller

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-07-09 11:27:56 +02:00
Krzysztof Chruscinski
a7725aef0e samples: subsys: logging: logger: Fix performance showcase
Sample tries to estimate maximum number of messages that can be
logged. It was using two system cycles and counting number of
messages logged in that window. It did not take into account the
fact that clock frequency may vary and logging speed also varies
(especially if LOG_IMMEDIATE is enabled). Presented results may
be faulty and misleading.

Fix is attempting to adjust window size to increase precision of
the measurement.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-09 11:27:22 +02:00
Krzysztof Chruscinski
086a6b7c64 tests: portability: cmsis_rtos_v1: Fix systick test
Added missing perenthesis to TOLERANCE_PPC macro.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-09 11:21:03 +02:00
Anas Nashif
dc85b395b0 doc: add coding guidelines
Add the coding guidelines agreed upon by the project TSC with a
description of the staged approach needed to implement them

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-08 23:27:15 -04:00
Enjia Mai
5e9ae9ec76 tests: add test cases for improving testing of mutex
1. Test the priority inheritance mechanism.
2. Test the recursive mutex.

Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
2020-07-08 23:25:59 -04:00
Krzysztof Chruscinski
16fa71276a sys: util: Document limitation of IS_EMPTY macro
IS_EMPTY macro does not accept all type of arguments.
Added clarification.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-08 23:25:27 -04:00
Henrik Brix Andersen
fea4774e72 samples: canbus: canopen: add test case with program download support
Add a test case for building with program download support enabled.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-07-08 23:24:17 -04:00
Torsten Rasmussen
ef3c5e5516 cmake: west: invoke west using same python as rest of build system
When running CMake, then Python3 will be used.
This is detected through FindPython3, with a preference for using the
python or python3 in path, if any of those matches the required Python
minimal version in Zephyr.

It is also possible for users to specify a different Python, as example
by using:
`cmake -DPYTHON_PREFER=/usr/bin/python3.x`

However, when running `west` as native command, then west will be
invoked on linux based on the python defined in:
`west` launcher, which could be: `#!/usr/bin/python3.y`

Thus there could be mismatch in Pythons used for `west` and the python
used for other scripts.

This is even worse on windows, where a user might experience:
```
>.\opt\bin\Scripts\west.exe --version
Traceback (most recent call last):
  File "C:\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  ...
  File "C:\Python37\lib\socket.py", line 49, in <module>
    import _socket
ImportError: Module use of python38.dll conflicts with this version of
Python.
```

when testing out a newer Python, but the python in path is still a 3.7.

By importing `west` into zephyr_module.py and by using, as example
`python -c "from west.util import west_topdir; print(topdir())"`
we ensure the same python is used in all python scripts.

Also it allows the user to control the python to use for west.

It also ensures that the west version being tested, is also the version
being used, where old code would test the version imported by python,
but using the west in path (which could be a different version)

If the west version installed in the current Python, and west invocation
is using a different Python interpreter, then an additional help text
is printed, to easier assist users with debugging.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-07-08 23:23:04 -04:00
Gerson Fernando Budke
1b293b2ba5 boards: arm: samr21: Add active low CS gpio flags
Update cs-gpios flag with active low value to instruct spi driver how
to handle cs signal.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-08 23:22:19 -04:00
Gerson Fernando Budke
92bb6afcdd drivers: ieee802154: rf2xx: Add CS gpio flags from DT
The generic SPI GPIO chip select support now respects devicetree flags
for signal active level. This pass DT information to driver instance to
ensure proper behavior.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2020-07-08 23:22:19 -04:00
Kumar Gala
4e2988deeb edtlib: Fold _binding_compat into _init_compat2binding
We only have one use of _binding_compat and it doesn't need self, so
just fold it into _init_compat2binding.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-08 22:03:24 -04:00
Kumar Gala
6bf761fc0a dts: Remove support for deprecated DTS binding syntax
We deprecated a number of aspects of the DTS binding syntax in Zephyr
2.1.  Remove the support for the deprecated syntax.  Remove from docs
about the deprecated syntax as well.

Removed reference in release-notes-2.1.rst to legacy_binding_syntax
since that anchor doesn't exist anymore.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-07-08 22:03:24 -04:00
Maksim Masalski
2053814d7c tests: make code style changes according with review comments
Made light code style changes.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-08 21:59:22 -04:00
Maksim Masalski
6eabee2681 tests: rebase with 2.3 release changes
Rebase using the latest master changes for 2.3 release

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-08 21:59:22 -04:00
Maksim Masalski
416feaab0c tests: resolve shippable errors
During previous commit Shippable let me know about errors
for some boards, resolved them.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-08 21:59:22 -04:00
Maksim Masalski
7808a78417 tests: workqueue tests overhaul adding new tests
During inspection of the workqueue tests, I find out testing gaps.
Decided to add new test cases that can improve Zephyr OS testing
quality.
Added new test cases:
1. test_work_item_supplied_with_func
In docs described that work item supplied with a handler function,
prove that it works.
2. test_process_work_items_fifo
Test that system process work items in first-in, first-out manner.
3. test_sched_delayed_work_item
Verify that delayed work item processed after specific period of time
stated by user.
4. test_workqueue_max_number
Test the limit of number of workqueues created
5. test_cancel_processed_work_item Created test to increase branch
coverage.

Modified existing test cases:
1. test_work_submit_handler updated Doxygen tag, added more detailed
description"

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-07-08 21:59:22 -04:00
Henrik Brix Andersen
736fcbec59 editorconfig: indent Kconfig files with tabs
Configure editors for indenting Kconfig* files with tabs.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-07-08 21:30:38 -04:00
Flavio Ceolin
c4f7faea10 random: Include header where it is used
Unit tests were failing to build because random header was included by
kernel_includes.h. The problem is that rand32.h includes a generated
file that is either not generated or not included when building unit
tests. Also, it is better to limit the scope of this file to where it is
used.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-07-08 21:05:36 -04:00
Flavio Ceolin
6216c6cf5b random: Add syscalls for random subsystem
Create syscalls to make possible using random APIs from user mode
threads. These APIs can have different implementations, like using
entropy driver or Xoroshiro128. Some of these implementations also have
some globals to preserve state between calls.

Make it run entire in user space would require user adding these globals
to their memeory domains and/or grant access to entropy device. Syscalls
simplify its usage.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-07-08 21:05:36 -04:00
Aastha Grover
177f2dac8b github workflow : Add github worklow for Sanitycheck testsuite
Add github worklow for sanitycheck tests to run sanitycheck
testsuite on any changes in sanitycheck, sanitylib or
scripts/tests/sanitycheck directory.

Signed-off-by: Aastha Grover <aastha.grover@intel.com>
2020-07-08 20:27:03 -04:00
Martí Bolívar
d8698cbdc6 sanitylib: pacify pylint
According to our compliance checks, we have 'useless-suppression'
and 'unused-import' on our hands:

W0611: Unused CLoader imported from yaml as Loader
W0611: Unused Loader imported from yaml
I0021: Useless suppression of 'unsubscriptable-object'

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-08 20:19:02 -04:00
Simon Glass
7f251a7d08 board: arm: google_kukui: Add a sample for kukui
It is useful to use kukui with a shell to test out its features., Add a
sample for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2020-07-08 19:21:40 -04:00
Christian Taedcke
82de647e31 drivers: i2c_gecko: Fix mutation of config_info content
Since the i2c init structure is moved from config_info to the stack,
this change requires 12 bytes more stack during driver initialization.

This fixes #25255

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-07-08 16:10:54 -05:00
Stéphane D'Alu
d9619e493d boards: decawave_dwm1001_dev: make button active low
Make the board button active low.

Signed-off-by: Stéphane D'Alu <sdalu@sdalu.com>
2020-07-08 16:10:25 -05:00
Daniel Leung
8c605f9e7e tests: timing_info: cleanup timing calculation code
() This is simply to clean up the code for cycles and timing
   calculations as there are quite a bit of unnecessary AND
   operations.
() This also moves the cycle calculation closer to the print
   statement as a few calculations were done between grabbing
   counter values.
() PRINT_STATS() now takes only two parameters as the third
   one was always calling CYCLES_TO_NS(2nd) anyway.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-07-08 16:50:26 -04:00
Raja D.Singh
bbabefb764 drivers: wifi: winc1500: Update to work with new timeouts
Change the driver to work without CONFIG_LEGACY_TIMEOUT_API option.

Signed-off-by: Raja D.Singh <rdsingh@iotwizards.com>
2020-07-08 15:38:43 -05:00
Christian Taedcke
f00f434aea samples: sensor: ccs811: Add board efr32mg_sltb004a
The ccs811 sensor is connected to exclusive i2c pins CCS811_I2C.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-07-08 15:31:03 -05:00
Christian Taedcke
2872af1a93 boards: efr32mg_sltb004a: Add support for sensor ccs811
The on-board sensor has a enable pin that must be pulled
high in order to power the sensor.
Since no i2c sensor connected to ENV_I2C is supported by zephyr yet,
changed the pins of i2c1 to be connected to CCS811_I2C pins.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-07-08 15:31:03 -05:00
Marcin Niestroj
8ab0d153a2 drivers: wifi: esp: fix reset control logic and respect reset dts flags
wifi-reset-gpios flags were not respected so far. This means that
setting reset as active low (which is required in most cases for ESP
modules/chips) was done inside esp driver with inverted logic. Use dts
flags instead, so "active low" property is configured the same way as
for other drivers (i.e. in device-tree instead of driver).

This change also allows to configure reset as active high, in case where
ESP's nRST signal is somehow inverted on the board (behaving as RST
signal instead).

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-08 15:17:26 -05:00
Anas Nashif
c53581dc1a templates: add template for hardware support
Add template for hardware support to properly label those requests and
distinguish them from other feature requests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-08 15:08:26 -04:00
Anas Nashif
7eeb572e8c templates: rename rfc template file
Remove the too many hyphens.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-07-08 15:08:26 -04:00
Martí Bolívar
148542c080 build: remove dead stores to environment
Now that kconfigfunctions.py is loading the EDT object from a pickle
file, I can't find any other reads of the environment variables it was
previously using to do that.

(The CMake variables with the same names are read in different places;
I'm specifically talking about environment variables here.)

Remove the dead stores.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-07-08 14:02:44 -05:00