Commit graph

41120 commits

Author SHA1 Message Date
Christian Taedcke
a401aefa0a net: ppp: Implement missing ppp mgmt functions
The functions ppp_mgmt_raise_carrier_on/off_event() were not
implemented, but already documeted in the header net/ppp.h

Fixes #23420

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-03-24 14:29:49 -05:00
Alexander Wachter
802552414c drivers: flash: stm32g4: Fix erase on wrong bank
In the default configuration of the stm32g4 is the dual bank mode.
In dual bank mode, the flash is split into two banks with 256k each.
The erase pages have a range form 0 to 127, where each page has 2k.
If one wants to erase an area above 256k, the driver has to switch
to bank 2 befor erasing. Otherwise it will erase the page moulo 127.

Signed-off-by: Alexander Wachter <alexander.wacher@leica-geosystems.com>
2020-03-24 14:25:47 -05:00
Alexander Wachter
7b9320beed drivers: flash: stm32: Introduce logs in the flash code
This commit introduces some logs in the stm32 flash implementation.
Thith the logs it is easier to locate problems when they arrise.

Signed-off-by: Alexander Wachter <alexander.wacher@leica-geosystems.com>
2020-03-24 14:25:47 -05:00
Carles Cufi
7aa6e6fb46 ext: Remove unused Kconfig and folder
Get rid of an unused Kconfig file that was unintentionally left in the
folder, and the folder itself.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-03-24 14:20:31 -05:00
Martí Bolívar
49f97f64dd devicetree: add DT_HAS_DRV_INST(instance_number)
Convenience macro for checking the existence of a node by instance
number.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-24 14:04:27 -05:00
Peter A. Bigot
93309317d0 uart: sifive: fix interrupt-driven transmission
A txcnt of zero prevents transmission, as transmit requires the number
of entries in the transmit fifo to be strictly less than the txcnt
value.  Set the default to 1.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-03-24 13:28:58 -04:00
Anas Nashif
56993fb9ab sanitycheck: remove confusing message when loading files
This message was intended for retries only, not every time we loaded a
file with a test manifest.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-03-24 12:15:36 -04:00
Anas Nashif
c7092a1c4d ci: when merging files, keep one header row
When merging files, make sure to remove header rows from each file and
just keep one header. This will stop us from parsing header rows as
tests.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-03-24 12:15:36 -04:00
Anas Nashif
923b3bf0ae sanitycheck: Add named exceptions
Add named exceptions instead of a generic one. Should help point to the
right issue when something goes wrong.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-03-24 12:15:36 -04:00
Piotr Mienkowski
8a9df52943 drivers: gpio_gecko: convert to DT_INST defines
Convert the driver to use DT_INST_ defines, update all dependent dts,
soc and board files.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2020-03-24 10:14:21 -05:00
Martí Bolívar
29887ec619 CODEOWNERS: devicetree updates
Update maintainers for code and docs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-24 10:11:20 -05:00
Martí Bolívar
7d97bdd276 doc: release-notes-2.3: add devicetree changes
Mention the new devicetree.h API and link to relevant
resources.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-24 10:11:20 -05:00
Kumar Gala
8d2f22f9ea drivers: sensor: fxos8700: convert to new DT API
Use the new devicetree.h API instead of the legacy macros.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-24 10:11:20 -05:00
Kumar Gala
8f84520130 drivers: serial: uart_sifive: convert to new DT API
Use the new devicetree.h API instead of the legacy macros.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-24 10:11:20 -05:00
Martí Bolívar
ffcf7cad6a drivers: spi: convert spi_nrfx_spim.c to new DT API
This allows us to start using DT_NODELABEL() to access SPIMs that way,
instead of via an alias.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-24 10:11:20 -05:00
Martí Bolívar
f50b0689b5 drivers: serial: convert uart_nrfx_uart to new DT API
Use the new devicetree.h API instead of the legacy macros.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-24 10:11:20 -05:00
Martí Bolívar
0d1d441aec samples: convert blinky to new DT API
This doesn't sacrifice any readability when compiled for boards that
don't support this alias.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-24 10:11:20 -05:00
Martí Bolívar
6e57b42758 doc: dts: revisit documentation
This is joint work with Kumar Gala (see signed-off-by).

Document the changes to the generated node macros in macros.bnf,
moving the old file to legacy-macros.bnf and putting it in its own
section.

The actual generated macros are now a low-level detail, so rewrite the
foregoing sections as examples in terms of the new <devicetree.h> APIs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-24 10:11:20 -05:00
Martí Bolívar
c3ec5db6d2 devicetree.h: add accessor API for nodes and properties
This is joint work with Kumar Gala (see signed-off-by).

Add helper macros which abstract the "true names" of each of the four
types of node identifier we intend to support (e.g. DT_ALIAS(),
DT_INST()).

These can be passed to a new DT_PROP() macro which can be used to read
the value of a devicetree property given a node identifier from one of
these four other macros, and the as-a-c-token name of the property.
Add other accessor macros and tests as well.

Add some convenience APIs for writing device drivers based on instance
numbers as well. Drivers can "#define DT_DRV_COMPAT driver_compatible"
at the top of the file, then utilize these DT_INST_* macros to access
various property defines.

For example, the uart_sifive driver can do:

  #define DT_DRV_COMPAT sifive_uart0

Then use DT_INST macros like:

  .port         = DT_INST_REG_ADDR(0),
  .sys_clk_freq = DT_INST_PROP(0, clock_frequency),

For convenience working with specific hardware, also add:

  <devicetree/gpio.h>
  <devicetree/adc.h>
  <devicetree/spi.h>

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-24 10:11:20 -05:00
Martí Bolívar
dc85edd2e9 scripts: dts: write new gen_defines.py
This is joint work with Kumar Gala (see signed-off-by).

This supports a new devicetree macro syntax coming. It's not really
worth mixing up the old and the new generation scripts into one file,
because:

- we aim to remove support for the old macros at some point, so it
  will be cleaner to start fresh with a new script based on the old one
  that only generates the new syntax

- it will avoid regressions to leave the existing code alone while
  we're moving users to the new names

Keep the existing script by moving it to gen_legacy_defines.py and
changing a few comments and strings around. It's responsible for
generating:

- devicetree.conf: only needed by deprecated kconfigfunctions
- devicetree_legacy_unfixed.h: "old" devicetree_unfixed.h macros

Put a new gen_defines.py in its place. It generates:

- zephyr.dts
- devicetree_unfixed.h in the new syntax

Include devicetree_legacy_unfixed.h from devicetree.h so no DT users
are affected by this change.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-24 10:11:20 -05:00
Kumar Gala
8af311ab3b edtlib: allow register addr / size to be None
If the #address-cells property for a register is 0 than we set the addr
value of the reg to None.  Similar, if #size-cells is 0 than we set the
size value to None for the reg.

Fixup kconfigfunctions.py to handle reg.size and reg.addr being None.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-24 10:11:20 -05:00
Kumar Gala
c7f2c89783 gen_defines.py: rename gen_defines.py to gen_legacy_defines.py
This rename is mostly to easy git managment and review so any changes or
the addition of the new gen_defines.py doesn't look like a diff against
the old code if you look at just that commit.

We keep changes to a minimum to just keep things building with the
renamed gen_legacy_defines.py.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-03-24 10:11:20 -05:00
Martí Bolívar
0de9a08e94 scripts: dts: edtlib: add EDT.chosen_nodes property
This returns the entire logical {name: Node} dictionary which is
currently being accessed element by element via chosen_node(name).

It will be used in a new gen_defines.py for moving the handling of
chosen nodes into C from Python.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-24 10:11:20 -05:00
Martí Bolívar
2a91a0d8c7 dts: bindings: add fake 'vnd' vendor
This is useful for devicetree documentation, examples, and tests,
where we need to put something for the vendor but we can't use an
actual piece of hardware for some reason.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-24 10:11:20 -05:00
Dominik Ermel
8af6e47281 west.yml: Update mcumgr revision after fixes to file download
This is pulls required update to mcumgr that fixes file download.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-03-24 15:17:00 +01:00
Dominik Ermel
1f3c9a22a0 subsys/mgmt: Fix mcumgr file download
The commit reduces default MCUMGR buffer size and introduces changes to
mcumgr that fix problem with mcumgr not being able to download file off
the Zephyr running device.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-03-24 15:17:00 +01:00
Vinayak Kariappa Chettimada
915c510a0a Bluetooth: controller: split: Remove use of k_cpu_idle
Remove use of k_cpu_idle in controller, and refactor the
implementation used to start, wait and stop clocks needed
by the controller.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-03-24 13:38:59 +01:00
Anas Nashif
2f7c187d77 sanitycheck: cleanup loading of previous results
Merge two functions loading previous results into one and support
filtering based on status.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-03-24 08:11:07 -04:00
Anas Nashif
a45c1da6d7 sanitycheck: use status column for status
We used the column 'passed' as a boolean to signify pass or fail,
however we do have other states that need to be tracked.
Remove the boolean and use a text field instead that has the status as a
string.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-03-24 08:11:07 -04:00
Anas Nashif
49f6d5a6c6 sanitycheck: fix counting when using --test option
When running 1 specific test, counting was off. Combine functions adding
tests into one and optimize filtering.

Fixes #22270

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-03-24 08:10:44 -04:00
Ioannis Glaropoulos
551601ea27 west: update MCUboot SHA
Update MCUboot SHA to take into account the
update of the nRF51 board target name.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-24 11:45:27 +01:00
Ioannis Glaropoulos
6251530f12 boards: arm: nrf51dk_nrf51422: add note about the previous board name
Add a note in the board documentation with the nRF51 DK
board was named in earlier Zephyr releases (nrf51_pca10028).

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-24 11:45:27 +01:00
Torsten Rasmussen
1bc640b972 cmake: deprecation of board names
This commit introduces boards/deprecated.cmake to allow deprecation
of existing boards, when a board is renamed.

This allows users to still specify the old board name, and let Zephyr
build system to select the new board name.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-24 11:45:27 +01:00
Ioannis Glaropoulos
f3807f19dc boards: arm: nrf51_pca10028: rename board to nrf51dk_nrf51422
We rename the nRF51 Dev Kit board target (nrf51_pca10028)
to nrf51dk_nrf51422. We update all associated references
in the supportive documentation and all nRF51-related
cofigurations and overlay files in the samples and tests
in the tree.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-24 11:45:27 +01:00
Martí Bolívar
669cf582e9 modules: bump ci-tools version
Bring in a compliance check related to anonymous contributions.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-23 20:45:54 -04:00
Jose Alberto Meza
04e190ab87 drivers: peci: xec: Re-add error recovery handling
Using temp variable to avoid coverity issue without breakin
error recovery.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2020-03-23 17:16:46 -07:00
Flavio Ceolin
f0a4cb059d drivers: uart: Add uart_configure verification handler
uart_configure verification handler was missing what would cause a crash
if called from a user thread.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-03-23 15:23:50 -04:00
Flavio Ceolin
017c142fd2 drivers: uart: Add config_get verification handler
uart_config_get API was broken in USERSPACE because was lacking the
verification handler.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-03-23 15:23:50 -04:00
Ioannis Glaropoulos
5bd906463d tests: kernel: context: in README, fix text for k_cpu_idle testing
We update README file to correct the text for k_cpu_idle
testing, since now we cover the test for both tickless
and non-tickless kernel configuration.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-23 12:10:46 -07:00
Ioannis Glaropoulos
b9c89c0e7f tests: kernel: context: minor style and indentation fixes
Fix some minor style and indentation issues
in tests/kernel/context/src/main.c.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-23 12:10:46 -07:00
Ioannis Glaropoulos
703e8444af tests: kernel: context: test k_cpu_idle for tickless kernel
We fix the kernel.context test, so it tests the
implementation of k_cpu_idle for tickless kernel.
As most platforms now support tickless kernel by
default, this extension of the test is essential
to get coverage on k_cpu_idle() API.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-03-23 12:10:46 -07:00
Anas Nashif
24f77ca167 drivers: peci: remove self-assignment
Assigning "base->ERROR" to itself has no effect.

Fixes #23586

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-03-23 14:10:58 -04:00
Pooja Karanjekar
558b904d80 drivers: entropy: gecko: Implement ISR specific get entropy call
Add the get_entropy_isr API function for the gecko entropy
driver. When the function is invoked without the ENTROPY_BUSYWAIT
flag, it returns whatever data is available in a non-blocking manner.

Signed-off-by: Pooja Karanjekar <pooja.karanjekar@lemonbeat.com>
2020-03-23 18:42:46 +01:00
Emil Hammarstrom
9ec8da2363 scripts: Bump west version
Default to west >= 0.7.2

Signed-off-by: Emil Hammarstrom <emil.a.hammarstrom@gmail.com>
2020-03-23 17:55:14 +01:00
Emil Hammarstrom
df9adeca44 cmake: Bump MIN_WEST_VERSION to 0.7.1
Updated WEST_DIR requires version >= 0.7.0

Signed-off-by: Emil Hammarstrom <emil.a.hammarstrom@gmail.com>
2020-03-23 17:55:14 +01:00
Emil Hammarstrom
86116f090a cmake: flash: Update WEST_DIR path
West >= 0.7.0 moved main.py into app dir

Signed-off-by: Emil Hammarstrom <emil.a.hammarstrom@gmail.com>
2020-03-23 17:55:14 +01:00
Paul Sokolovsky
79a58ddffa tests: posix: pthread: Clean up test for pthread_getname/setname_np
Recently added test for pthread_getname_np()/pthread_setname_np()
functions used uninitialized array value. As we can't check behavior
for arbitrary uninitialized value, but at most NULL value, make the
test calls to explicitly use NULL, to make the test intent clear
(instead of for example initializing the original array with zeros).

Also, these test cases use variable names not consistent with Zephyr
codestyle, and named to generically to cause confuse when used in a
general context of the test_posix_pthread_execution() function, so
rename them to be specific. (And alternative would be to separate
pthread_getname_np()/pthread_setname_np() tests into a separate
function, but it was indeed practical to piggyback them on existing
test_posix_pthread_execution()).

Fixes: #23473

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2020-03-23 12:48:20 -04:00
Michał Grochala
c787b9ee87 boards: arm: nrf5340_dk_nrf5340: Configurable powering on Network MCU.
Added a configuration option for enabling the nRF53 Network MCU.
Some applications will just run on the Application MCU, then
Network MCU should stay off. By deafult Network MCU
will be enabled when BLE or IEEE 802.15.4 are used.

Signed-off-by: Michał Grochala <michal.grochala@nordicsemi.no>
2020-03-23 16:54:25 +01:00
Martí Bolívar
4ba332aca8 doc: rename reference/stability to reference/overview
This page has a lot more information about APIs than just stability,
and I believe it's currently our only exhaustive list of APIs.

Rename it to API Overview.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-03-23 15:40:12 +01:00
Peter Bigot
42f9d14a3f kernel: deprecate k_uptime_delta_32
The documentation motivates this function by saying it is more
efficient than the core 64-bit version.  This was untrue when
originally added, and is untrue now.  Mark the function deprecated and
replace its sole in-tree use with the trivial equivalent.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-03-23 10:26:05 -04:00