Commit graph

43570 commits

Author SHA1 Message Date
Mulin Chao b3188f1c32 drivers: npcx: replace type of register base address with uintptr_t
Replace npcx register base address type, uint32_t, with uintptr_t.
It is easier to know what type of base address and for linear
addresses treated as integral values.

This CL also modified IS_BIT_SET() macro function to fit MISRA code
guidelines.

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
2020-09-01 13:35:25 +02:00
Mulin Chao 1eca7ab46a drivers: npcx: remove suffix '_t' of device register structure.
Remove the '_t' suffix of device register structure since it is used
mainly with typedefs.

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
2020-09-01 13:35:25 +02:00
Mulin Chao fb1c2b58ac tests: kernel: gen_isr_table: Add workaround for npcx7m6fb soc.
In NPCX7M6FB, it uses some the IRQs at the end of the vector table,
for example, the irq 60 and 61 used for Multi-Input Wake-Up Unit (MIWU)
device by default, and conflicts with isr used for testing. Moving IRQs
for this test suite to solve the issue.

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
2020-09-01 13:35:25 +02:00
Mulin Chao 288e35ab1a driver: uart: add wake-up support for uart device.
This CL configures the UART wake-up event triggered from a falling edge
(START condition) on CR_SIN pin. It also includes:

1. Introduce wui_maps property in yaml file to present relationship
   between Wake-Up Input (WUI) and UART device.
2. Implement wake-up mechanism by MIWU api functions.

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
2020-09-01 13:35:25 +02:00
Mulin Chao 6deb68a517 driver: gpio: add gpio driver support in NPCX series
Add gpio support for Nuvoton NPCX series. This CL includes:

1. Add GPIO device tree declarations.
2. Introduce wui_maps property in yaml file to present relationship
   between Wake-Up
   Input (WUI) and 8 IOs belong to the device.
3. Zephyr GPIO api implementation.
4. GPIO callback functions implementation with MIWU api functions.
5. Overlay file for gpio basic tests

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
2020-09-01 13:35:25 +02:00
Mulin Chao 84d90e456a driver: intc: add MIWU driver support in NPCX series.
The device Multi-Input Wake-Up Unit (MIWU) supports the embedded
controller (EC) to exit 'Sleep' or 'Deep Sleep' power state which allows
chip has better power consumption. Also, it provides signal conditioning
such as 'Level' and 'Edge' trigger type and grouping of external
interrupt sources of NVIC. The NPCX series has three identical MIWU
modules: MIWU0, MIWU1, MIWU2. Together, they support a total of over 140
internal and/or external wake-up sources.

In this CL, we use device tree files to present the relationship bewteen
MIWU and the other devices in different npcx series. For npcx7 series,
it include:
1. npcx7-miwus-int-map.dtsi: it presents relationship between MIWU group
   and NVIC interrupt in npcx7. Please notice it isn't 1-to-1 mapping.
2. npcx7-miwus-wui-map.dtsi: it presents relationship between input of
   MIWU and its source device such as gpio, timer, eSPI VWs and so on.

This CL also includes:
1. Add MIWU device tree declarations.
2. MIWU api function declarations and implementation to configure signal
   conditions and callback function mechanism. They can be be classified
   into two types. One is for GPIO which connects original gpio callback
   implemetation and the other is for generic devices such as timer,
   eSPI, and so on.

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
2020-09-01 13:35:25 +02:00
Emil Gydesen 9bf50ddb20 Bluetooth: Gatt: Added write callback for gatt (un)subscribe
Added a callback that lets an application get write error
(if any) when subscribing to a gatt characteristic.

Signed-off-by: Emil Gydesen <emil_gydesen@bose.com>
2020-09-01 13:34:25 +02:00
Christian Taedcke d026b5dd34 logging: net: Make autostart of backend configurable
In certain application configuration the networking log backend must not
be started, when the application starts. Starting it must be delayed
until routes to the logging server are established.

This commit introduces a new Kconfig setting to be able to control that
behaviour.

Fixes #27464

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2020-09-01 13:34:13 +02:00
Martí Bolívar f66a0c3772 build: auto-generate signed mcuboot binaries
Add new Kconfig options which depend on CONFIG_BOOTLOADER_MCUBOOT:

- CONFIG_MCUBOOT_SIGNATURE_KEY_FILE: the path to the key pair which
  should be used to sign the image, in PEM format. This is sent to
  imgtool via 'west sign' when set to produce zephyr.signed.bin and
  zephyr.signed.hex files as needed.

- CONFIG_MCUBOOT_EXTRA_IMGTOOL_ARGS: additional arguments to pass to
  imgtool.

- CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE: also generate
  zephyr.signed.confirmed.{bin,hex}

Add build system support for these options.

This makes a separate 'west sign' step unnecessary when using MCUboot,
if the application image is properly configured with the location of
the key file.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-01 13:33:46 +02:00
Martí Bolívar 9b6736748d scripts: west sign: add --quiet option
This suppresses stdout on normal runs.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-01 13:33:46 +02:00
Martí Bolívar a0382cb925 cmake: add IMGTOOL optional dependency
This will be used in subsequent patches to integrate imgtool into the
build when the user has set CONFIG_BOOTLOADER_MCUBOOT=y.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-01 13:33:46 +02:00
Martí Bolívar c32e90d2a5 build: update stale comment in boilerplate.cmake
The zephyr_property_target use cases have grown.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-01 13:33:46 +02:00
Martí Bolívar 79b1f89f7d cmake: west detection fixes and improvements
Starting with west 0.8, we will have a stable way to run west as a
python module. In west 0.7, we have an undocumented way.

Handle these two cases to override the WEST variable used by the build
system to run west inside the same python interpreter as the rest of
the build system. This makes it intuitive to shell out to west from
elsewhere in the build, without making people reimplement existing
commands in the west API when it is not necessary.

Do so for the 'west topdir' invocation in west.cmake as an example.

The check that looks for whether PYTHON_EXECUTABLE and WEST_PYTHON
match is also not working properly when symbolic links are in use.
Fix it by using REALPATH instead of ABSOLUTE in the
get_filename_component() calls.

Finally, print the error on a failed import that we expect to work.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-01 13:33:46 +02:00
David Leach f62fef5ae5 west: hal_nxp: Fix USB_DEVICE_CONFIG_ENDPOINTS definition
The define for USB_DEVICE_CONFIG_ENDPOINTS erroneously divided
the DTS value for number of USB endpoints by 2.

Signed-off-by: David Leach <david.leach@nxp.com>
2020-09-01 13:32:11 +02:00
Alexandre Bourdiol a6ad4ec95d drivers: entropy: stm32 full driver rework with software fifo
mimic nrf driver as suggested #27825

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-01 13:31:38 +02:00
Alexandre Bourdiol e141b77ca0 dts: arm: st: add interrupts property to rng node
Need to add interrupts property for stm32 rng rework

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2020-09-01 13:31:38 +02:00
Dominik Ermel 88deb80718 mgmt: smp: Fix shell sending SMP response to wrong UART
The commit fixes the problem where the SMP over shell responses have
been sent with use of k_str_out(), which is configured to use console
UART directly.  This caused problem when user decided to attach
shell to a different UART then the one that has been used by
the console driver, because the SMP responses would still be sent
to the console UART rather than the shell UART.

The updated code uses, for shell SMP responses, the UART that has been
selected for the shell.

Fixes #26939

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-09-01 13:30:41 +02:00
Ismael Fillonneau fc8f639b9a shields: Modify overlay file order
Shield overlay file has to be taken into account after board overlay
file.
ex: When a new node need to be created for a specific board (in
boards/shields/shield_name/boards/board_name/*.overlay) and used by the
shield (in boards/shields/*.overlay), the order of the overlay files is
important

Signed-off-by: Ismael Fillonneau <ismael.fillonneau@stimio.fr>
2020-09-01 13:30:06 +02:00
Pavel Král 0778a6aaf3 usb: Configurable transfer buffers
This patch removes the hard-coded number of transfer buffers and allows
you to increase the number of transfer buffers when multiple USB
devices are used.

Signed-off-by: Pavel Král <pavel.kral@omsquare.com>
2020-09-01 13:29:47 +02:00
Torsten Rasmussen 2fa48f79d1 cmake: warn user if CPPFLAGS is set as environment setting
Zephyr doesn't use CFLAGS, CXXFLAGS, and CPPFLAGS if they are defined
in environment.

In case user defines CFLAGS or CXXFLAGS in environment, then a warning
message is printed, however CPPFLAGS does not raise a warning.

CPPFLAGS is updated to follow the principle of CFLAGS and CXXFLAGS.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-09-01 13:29:24 +02:00
Joakim Andersson becd9cadfe Bluetooth: host: Fix option USE_IDENTITY for bt_le_ext_adv_* API
Fix option USE_IDENTITY for bt_le_ext_adv_* API.
The random static identity address that was set in bt_le_ext_adv_create
was overwritten in bt_le_ext_adv_start in the call to
le_adv_set_private_addr.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-01 13:28:56 +02:00
Joakim Andersson 213dbf3ed7 Bluetooth: GATT: Remove wrong documentation for GATT write callback
Remove paragraph in documentation of GATT write callback which is
clearly wrong and was meant for the read callback.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-09-01 09:33:12 +02:00
Henrik Brix Andersen d92b199173 doc: update list of architectures in introduction
List ARMv6-M (Cortex-M) as a supported architecture.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-08-31 17:37:25 -04:00
Peter Bigot 9024669a67 testsuite: fix unittest cross-language flags
Unit tests may include C++ code, so ensure the compiler flags are
consistent to avoid link errors.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-31 11:02:35 -04:00
Fabio Utzig c2b567f79e doc: update known issues for Sphinx>=3.2.0
Remove old known issues files and update with issues that still need to
be fixed in Sphinx>=3.2.0 and or Doxygen, including anonymous
union/struct parsing and duplicated symbols (eg struct and functions
having the same name).

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig 92431e2bae doc: fix :c:macro: usage
Remove parameters in :c:macro: usage because it's invalid syntax.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig e73d3c82d8 doc: update :cpp:var: to :c:member:
Update references to struct members to use :c:member:

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig 4c2f0605da doc: fix invalid usage of function to :c:macro:
Some macros were using :c:func: and :cpp:func: which forbids Breathe
from resolving those symbols. Update to :c:macro: for proper resolution.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig 43133c96f4 doc: update union reference to to :c:union
Update union reference from generic :c:type: to :c:union:.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig ce12936ce1 doc: update enumerator usage to :c:enumerator:
Following the change to use the C domain for parsing, update all
existing :cpp:enumerator: references to :c:enumerator:.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig bb93b337f9 doc: update enum usage to use :c:enum:
Update enum reference usage to use C domain.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig 1622b3e66b doc: do not use :c:macro: for NULL
`NULL` is not defined in the Zephyr sources, but rather a C definition
which is not resolved when building the documentation and generates a
warning. Fall back to using just emphasis.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig f635217f35 doc: add :c:macro to some symbols
Fix some C macros that are currently just emphasized in the
documentation with proper symbol resulition using :c:macro:

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig c79d2ce794 doc: update struct references to use :c:struct:
Sphinx>=3.0 includes the `struct` role in the C domain, which provides a
specific way to link to structs, while the old :c:type: role should be
primary used to typedefs. Update existing references, using :c:type:,
:cpp:type: or emphasized symbols that point to structs to use the new
role.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig 53fd5ff236 doc: update function references to use :c:func:
Following the change to use the C domain for parsing, update all
existing :cpp:func: references to :c:func:. Remove the parentheses as
well, if used, because they are not needed, this is already known to be
a function, and how it is displayed in the documentation later is a
semantic decision done by the output builder.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig a56446051e doc: add __subsystem attribute and c attributes
Add __subsystem to list of attributes for the parser, and make the c
parser accept the same attributes than the cpp parser, after the change
to use the c parser for ".c" files.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig dcfe684440 doc: move tabs to spaces in Sphinx config
Sphinx's config file is a python script, so follow the standards and use
spaces for identation.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig 2825f0bcac doc: switch from CPP to C domain for .c files
Older Breathe versions didn't work correctly with the C domain, so there
was a mismatch when refering to functions and #defines, using :cpp: or
:c: depending on the origin of the refered symbol. With Breathe >=4.19
the C domain works correctly so all symbols can be refered to with the
:c: role.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig 6111da4481 doc: use non-deprecated CSS/JS import methods
Update methods used to include JS/CSS files, avoiding deprecated
versions the don't work on Sphinx>=3.x. The new methods work on both
Sphinx==3.x and Sphinx>=2.4.x.

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Fabio Utzig 551f1789a5 doc: update versions of build tools
Update documentation build tooling:

- Sphinx>=3.2.0
- Breathe>=4.20.0
- docutil>=0.16.0

Signed-off-by: Fabio Utzig <fabio.utzig@nordicsemi.no>
2020-08-31 09:57:33 -04:00
Watson Zeng 0079cecc19 sanitycheck: add argument --pre-script
add argument --pre-script to specify a pre script. This will be
executed before device handler open serial port and invoke runner.

Currently, pre_script can only get from hardware.map file. just like:
./scripts/sanitycheck  --hardware-map xxx.map
and set pre_script in xxx.map file.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-08-31 15:54:32 +02:00
Watson Zeng 3b43d946fd sanitycheck: run custom pre script before open the serial port
In some cases it might be a good idea to reset the board for real to
make sure it is completely recovered from some failed state (simple
re-loading of the application binary or even Elf file contents doesn't
affect most of internal CPU states so doesn't help in recovery,
see https://github.com/zephyrproject-rtos/zephyr/issues/25022 &
https://github.com/zephyrproject-rtos/zephyr/issues/26665).
And so we may want to utilize some external utility which triggers the
hard reset (in case of ARC boards it is
https://github.com/foss-for-synopsys-dwc-arc-processors/rff-ftdi-reset).
So we need to have a way to execute an external command before each and
every test.

Now given we already have quite some call-backs we try to use them
before re-inventing the wheel. And pre_script seem to be a good option
with just on minor note - it is called after serial port gets open.
And while in some cases it might be OK if serial port on the board is
not affected by the board's reset, if it is affected we'll be losing
connection on reset (and that's the case with ARC boards BTW as the
FTDI USB-to-Serial IC is also wired to the reset signal on most of
the boards). That said we just move invocation of pre_script before
opening the serial port and everything should be good now.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-08-31 15:54:32 +02:00
Martí Bolívar 36aa42f384 ci: retry failed west update
Transient network errors may cause west update to fail. Retry it in
case that happens. Updates for projects which are already up to date
won't hit the network.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-08-31 09:42:51 -04:00
Andrzej Głąbek 8e5afef6da bluetooth: controller: nrf5: Add support for nRF52805
Add the nRF52805-specific file with radio related defintions.
Use also specific configurations for certain PPI channels used by
the controller, as this SoC has limited number of programmable PPI
channels.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-08-31 15:40:19 +02:00
Andrzej Głąbek 89c7588917 bluetooth: controller: nrf5: Refactor a bit radio_nrf5_ppi.h
Change hard-coded (D)PPI channel bitfield values to the BIT() macro
calls with the corresponding channel base value supplied as parameter,
to make it possible to actually change this base value if needed.
Remove unused *_EXCLUDE macros.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-08-31 15:40:19 +02:00
Andrzej Głąbek 2ba4f5d06f boards: arm: Add definition of nrf52dk_nrf52805 board
Add a board that uses the nRF52805 SoC.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-08-31 15:40:19 +02:00
Andrzej Głąbek c519184211 soc: nordic_nrf: Add definition of nRF52805 SoC
Add definition of the nRF52805 SoC together with the corresponding
dts files.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-08-31 15:40:19 +02:00
Anas Nashif ad44bed754 sanitycheck: fix footprint reports
By default show reports based on last release. Fix a few other issues
where we had 0 values and were dividing by zero.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-31 09:20:52 -04:00
Andrzej Kaczmarek 3e7db661d1 tests: Bluetooth: bsim_test_advx: Fix adv_type parameter
The value of adv_type shall be 0x07 for extended advertising, it will
be converted to 0x05 inside ll_adv_params_set after some checks.

This did not cause any issues with tests since input parameters in
already implemented test cases do not test any code that was skipped
by invalid parameter, however obvious one side-effect is that phy_p
would be always set to 1M regardless of input parameter so any test
case using Coded on primary would fail.

Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
2020-08-31 13:50:13 +02:00
Vinayak Kariappa Chettimada 293aa54ef3 Bluetooth: controller: Revert back to using EGU in nRF5340PDK
Refer to nRF5340 Engineering A Errata 29.
[29] SWI: SWIRQ is not functional.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-08-31 13:49:35 +02:00