Commit graph

42567 commits

Author SHA1 Message Date
Maureen Helm 18bb0b8904 boards: arm: Clean up lpcxpresso55s16 board.cmake
Cleans up the lpcxpresso55s16 board.cmake to make it consistent with
other lpc boards. jlink.board.cmake sets the default runner to jlink if
not already set.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:58:50 -05:00
Maureen Helm 8a8b90d6d1 boards: arm: Clean up zephyr-app-commands usage in frdm_k82f board doc
Cleans up the frdm_k82f board document to make its usage of
zephyr-app-commands consistent with other frdm boards.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:58:50 -05:00
Maureen Helm 877997e71f boards: arm: Remove OPENSDA_FW cmake variables from nxp boards
The OPENSDA_FW and LPCLINK_FW cmake variables are remnants of pre-west
days where we used an environment variable to set the desired debug host
tool, such as jlink or pyocd, based on which debug probe firmware was
loaded on the board. We now have two possible ways to do this, neither
of which requires the nxp-specific OPENSDA_FW or LPCLINK_FW variables:

1. Set standardized cmake runner variables when generating the build
   system:
   $ west build -- -DBOARD_FLASH_RUNNER=jlink -DBOARD_DEBUG_RUNNER=jlink

2. Use the west "--runner" argument with the debug and flash commands:
   $ west debug -r jlink

Remove the now unnecessary OPENSDA_FW ond LPCLINK_FW variables and
update board documentation accordingly.

A few boards (frdm_kw41z, hexiwear_k64, mimxrt10{20,50,60,64}_evk)
reordered pyocd.board.cmake and jlink.board.cmake includes to preserve
the default runner when OPENSDA_FW was not explicitly set.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:58:50 -05:00
Maureen Helm eb43207508 disk: Remove unused variables in nxp usdhc driver
Removes unused instances of struct usdhc_priv in the nxp usdhc driver.
The DISK_ACCESS_USDHC_INIT macro is responsible for instantiating these
variables.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm 04f2ab9af1 disk: Remove extra copy of config struct in nxp usdhc driver
Updates the nxp usdhc driver data structure to keep a reference instead
of a copy of the constant config structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm 6fa92fe7da disk: Move variable from config to data struct in nxp usdhc driver
Moves the source clock frequency variable in the nxp usdhc driver from
the config structure to the data structure in preparation for removing
the writable copy of the config structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm ec53518fa5 disk: Remove instance conditionals from nxp usdhc driver functions
Refactors the nxp usdhc driver to remove instance-specific conditionals
from driver functions. Now all instance-specific details, such as power
and card detect gpios, are contained in the driver config structure.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Maureen Helm 47463173c7 disk: Create device instance macro in nxp usdhc driver
Creates a new device instance macro in the nxp usdhc driver to use with
DT_INST_FOREACH.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-07-09 07:56:44 -05:00
Christian Taedcke 3dbe9f2960 sanitycheck: native: Add option to enable UBSAN
Add option for native platform to enable undefined behaviour sanitizer.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-07-09 07:49:57 -04:00
Trond Einar Snekvik cb7835d18f Bluetooth: Mesh: Wait for proxy on node reset
Adds idle wait callback to proxy by counting the number of pending
notifications.

Ensures that all connected nodes have received messages before resetting
the mesh stack.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-07-09 13:49:26 +02:00
Marcin Niestroj 559cf02107 drivers: lora: sx1276: configure reset gpio only once
Reset gpio is configured during driver initialization. There is no
reason to do it repeat that process later, so replace
gpio_pin_configure() with gpio_pin_set().

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-09 13:47:42 +02:00
Marcin Niestroj 71bdb35191 drivers: lora: sx1276: rework gpio configuration
Introduce sx1276_configure_pin() helper macro, which hides lots of
boilerplate preprocessor and C code. Doing so allows to uncover
inconsistent gpio initialization flow and prevent such in future. Also
add error log whenever gpio_pin_configure() fails.

It seems like output of gpio_pin_configure() for several
gpios (antenna_enable, rfi_enable, rfo_enable) was assigned to variable,
but its values was never checked. Return value from gpio_pin_configure()
of tcxo_power gpio was even not catched. The only output gpio
configuration that was handled properly was actually reset gpio.

Fix that inconsistent behavior by always checking return value of
sx1276_configure_pin().

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-07-09 13:47:42 +02:00
Krzysztof Chruscinski 2809cad50e logging: Add fields initialization in z_log_msg_std_alloc
Added initialization of ids fields in the log message in
z_log_msg_std_alloc(). If user space is enabled then msg_free()
function is reading log level and previously it may have been
uninitialized.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2020-07-09 13:46:07 +02:00
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