Commit Graph

43838 Commits

Author SHA1 Message Date
Marek Porwisz 05972fff5a lib: openthread: allow passing multiple libraries as mbedtls
Some implementation consist of multiple libraries to be linked instead
of one. Added possibility to pass multiple libraries. Additionally
renamed the config name as it was stateing something different than it
does.

Signed-off-by: Marek Porwisz <marek.porwisz@nordicsemi.no>
2020-09-04 11:10:34 +02:00
Siddharth Chandrasekaran ee99c34fb6 mgmt/osdp: Refactor struct osdp_cmd members for readability
Some of the names used in `struct osdp_cmd` where directly as in the
specification. Initially it appealed to keep them like that but with
time, a little more consistent naming of members helps if you haven't
read the specification document very recently.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-09-04 10:58:13 +02:00
Siddharth Chandrasekaran 4c9b0ae928 samples: mgmt/osdp: Add CP Sample
Add a OSDP CP mode sample that sends out a periocic command to a
connected PD. It also demosnstrates key press and card read callback
registration.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-09-04 10:58:13 +02:00
Siddharth Chandrasekaran ea03c9c304 mgmt/osdp: Add support for CP mode of operation
Following the PD mode implementation (9a91b4ad), this patch adds support
for CP mode of operation in OSDP.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-09-04 10:58:13 +02:00
Siddharth Chandrasekaran 9aa24d85a2 samples: mgmt/osdp: Scope PD sample for upcoming CP sample
Make changes to PD sample so a CP sample can be added in future along
with it.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-09-04 10:58:13 +02:00
Siddharth Chandrasekaran 31d2b991e0 mgmt/osdp: Refactor PD for upcomming CP changes
Some PD init sequence and other methods are useful in CP mode as well.
This patch refactors those methods to osdp_*(), moves them to common
source files and and exposes them from osdp_common.h.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2020-09-04 10:58:13 +02:00
Loic Poulain 4eba946e2b drivers: wifi: eswifi: Implement dns offload callbacks
Implement getaddrinfo and freeaddrinfo callbacks.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2020-09-04 09:51:09 +03:00
Loic Poulain 733af9a709 drivers: wifi: eswifi: Improve read work
Schedule read work every 100ms for better latency.
Reschedule read work directly in case of a packet is received
(fast dequeue).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2020-09-04 09:51:09 +03:00
Loic Poulain 6ea54db334 drivers: wifi: eswifi: fix socket poll
- Fix return value, must be number structures with events
- set revents flag

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2020-09-04 09:51:09 +03:00
Kumar Gala e4dd77ed72 soc: arm: atmel_sam: Add support for pinctrl flags
Add devicetree support to specify bias-pull-up, bias-pull-down, and
drive-open-drain for pin configuration.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-09-03 18:09:24 -05:00
Anas Nashif 0f831b1e15 sanitycheck: mark arc simulation smp systems as mdb
This changes back smp simulation systems to require mdb.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-03 15:10:07 -07:00
Kumar Gala 50a24950eb drivers: video: mcux_csi: Fix compile error
Fix compile errors of the form:

video_mcux_csi.c: In function 'video_mcux_csi_init_0':
video_mcux_csi.c:422:40: error: 'const struct device' has no member
				 named 'driver_data'
  422 |  struct video_mcux_csi_data *data = dev->driver_data;
      |                                        ^~

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-09-03 18:08:08 -04:00
Jukka Rissanen 57a894a5ee tests: net: dns_packet: Disable Ethernet when test is run
The test was failing when run in sam_e70_xplained board.
Because the test does not use any network packet TX/RX functionality,
disable Ethernet support so that when run in a board with network
capabilities, the network interface is not created.

Fixes #28000

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-03 18:05:51 -04:00
Jukka Rissanen 9d064e6ae9 net: tcp2: Fix connection close ack values
If we receive a TCP segment with FIN | ACK | PSH flags, then
update the ack values properly.

Fixes #27982

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-09-03 18:04:01 -04:00
Martí Bolívar c4deb9ebde doc: west: update west sign documentation
Update the documentation to reflect the easier flow.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar 003d30b6f0 cmake: flash signed binaries for mcuboot
When CONFIG_MCUBOOT_SIGNATURE_KEY_FILE is set and the build system
successfully creates signed outputs, use them as the default artifacts
to flash.

This flashes the non-confirmed variant regardless of
CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE, allowing POST code in the
application to confirm the image or not. Since this is used primarily
from development, I'd hesitate to assume the confirmed image is good.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar 3124c02987 cmake: flash/debug: refactor runner configuration
This commit message is a bit of a novel mostly:

- because the issues involved are longstanding
- as evidence this is not a capricious refactoring

The runners.core.RunnerConfig Python class holds common configuration
values used by multiple runners, such as the location of the build
outputs and board directory.

The runners code, first written in 2017-ish, replaced various shell
scripts that got this information from the environment. Avoiding
environment variables was a requirement, however. It's ghastly to set
environment variables for a single command invocation on Windows, and
the whole thing was part of a larger push to make Zephyr development
on Windows better.

I had a hammer (the argparse module). Finding a replacement naturally
looked like a nail, so the information that ends up in RunnerConfig
got shunted from the build system to Python in the form of 'west
flash' / 'west debug' command line options like '--board-dir',
'--elf-file', etc.

I initially stored the options and their values in the CMake cache.
This was chosen in hopes the build system maintainer would like
the strategy (which worked).

I knew the command line arguments approach was a bit hacky (this
wasn't a nail), but I also honestly didn't have a better idea at the
time.

It did indeed cause issues:

- users don't know that just because they specify --bin-file on the
  command line doesn't mean that their runner respects the option, and
  have gotten confused trying to flash alternate files, usually for
  chain-loading by MCUboot (for example, see #15961)

- common options weren't possible to pass via board.cmake files
  (#22563, fixed partly via introduction of runners.yaml and the west
  flash/debug commands no longer relying on the cache)

- it is confusing that "west flash --help" prints information about
  openocd related options even when the user's board has no openocd
  support. The same could be said about gdb in potential future use
  cases where debugging occurs via some other tool.

Over time, they've caused enough users enough problems that
improvements are a priority.

To work towards this, put these values into runners.yaml using a new
'config: ...' key/value instead of command line options.

For example, instead of this in the generated runners.yaml file:

args:
  common:
  - --hex-file=.../zephyr.hex

we now have:

config:
  hex_file: zephyr.hex

and similarly for other values.

In Python, we still support the command line options, but they are not
generated by the build system for any in-tree boards. Further work is
needed to deprecate the confusing ones (like --hex-file) and move the
runner-specific host tool related options (like --openocd) to the
runners that need them.

Individual board.cmake files should now influence these values by
overriding the relevant target properties of the
runners_yaml_props_target.

For example, instead of:

  board_runner_args(foo "--hex-file=bar.hex")

Do this:

  set_target_properties(runners_yaml_props_target PROPERTIES
                        hex_file bar.hex)

This change additionally allows us to stitch cmake/mcuboot.cmake and
the runners together easily by having mcuboot.cmake override the
properties that set the hex or bin file to flash. (The command line
arguments are still supported as-is.)

Combined with 98e0c95d91ae16f14e4997fb64ccdf0956595712 ("build:
auto-generate signed mcuboot binaries"), this will allow users to
build and flash images to be chain loaded by mcuboot in a way that
avoids calling 'west sign' and passing 'west flash' its output files
entirely.

While we are here, rename runner_yml_write to runners_yaml_append().
This function doesn't actually write anything, and we're here
refactoring this file anyway, so we might as well improve the
situation while we're at it.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar e27b36807a cmake: rename and move runner_yml_props_target to boilerplate
Rename it to "runners_yaml_props_target", because the file name is
runners.yaml, not runner.yml.

Move it to the boilerplate definition so that we can modify it before
cmake/flash/CMakeLists.txt gets run.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar e63d299515 scripts: run_common: rename some variables
The 'runner_config' variable name is particularly misleading because
there is a class called RunnerConfig, and that variable does not
contain one.

Rename it to 'runners_yaml' since it contains the parsed contents of
the runners.yaml file. Rename the variable that refers to the path
itself to 'runners_yaml_path'. No functional changes expected.

This is prep work for redoing how actual RunnerConfig objects get
made.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar 36e0286e26 scripts: runners: switch RunnerConfig to NamedTuple
This adds type checking for free. No functional changes expected.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar c4254a7025 scripts: runners: type annotate runners/core.py
Before venturing off into refactoring land, let's make sure we have a
type checker running on the main APIs used by the various runners so
we don't miss anything obvious.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar bd827056f6 scripts: runners: add type checking for west_commands
Use mypy to type check the runners package.

The test procedure is now annoying enough to replicate locally that
I'm going to wrap it in a script. Do this for both UNIX and Windows
environments by writing that script in Python.

Keep the GitHub workflow up to date so we now get mypy results in CI.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar 1bb39a6434 scripts: runners: trivial comment and docstring fixes
Fix stale or incorrect text.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Martí Bolívar db4df3ce1a cmake: flash: remove stale cache variables
Commit c1f80db44a removed various
now-unused CMake cache variables, but it missed the ones that begin
with ZEPHYR_RUNNER_ARGS. Delete those now.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-09-03 16:49:09 -05:00
Gerard Marull-Paretas 52d2448717 samples: display: lvgl: add information for buydisplay shield
Add information for Buydisplay 2.8" TFT shield on README and add the
shield to tests list.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-03 16:36:50 -05:00
Gerard Marull-Paretas 0b2cb96516 boards: shields: add support for buydisplay 2.8" TFT touch display
Add support for the Buydisplay 2.8" TFT touch display shield for
Arduino.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2020-09-03 16:36:50 -05:00
Daniel Leung d1f57be7be i2s: cavs: cast device struct to void ptr for DMA user data
In the I2S CAVS driver, the DMA user data simply points to
the device struct. However, after the change to const-ify device
struct, this causes warnings from compiler because the user_data
assignment would discard the const qualifier. The user_data is
being used to point back to the device struct, and the DMA
callbacks are already casting the user data argument into
a const device struct. So it's a simple fix by casting
the device pointer to void pointer at device creation.

Fixes #28016

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-03 17:33:11 -04:00
Daniel Leung 9eebe6a45e cmake: add WEST to cached variable
Commit 79b1f89f7d causes the WEST
variable to no longer cached in the CMakeCache. However,
the Eclipse plugin needs this WEST variable so that it can
invoke west properly. So tell CMake to put it in the cache.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-03 17:32:48 -04:00
NavinSankar Velliangiri 1007e56c29 sample: mgmt: hawkbit: Add Hawkbit FOTA sample
Hawkbit FOTA sample with polling and Manual mode

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2020-09-03 22:13:52 +02:00
NavinSankar Velliangiri ddd6a650e2 mgmt: hawkbit: Add Hawkbit FOTA Support
Add Hawkbit FOTA support

Signed-off-by: NavinSankar Velliangiri <navin@linumiz.com>
2020-09-03 22:13:52 +02:00
Andrew Boie 860e965a4f tests: spinlock: fix occasional crash
lock_runtime is a stack variable whose contents could be completely
garbage, but only the 'locked' member was zeroed. zero the whole
thing to prevent spurious "recursive spinlock" errors from occasionally
popping up as the validation framework gets confused from garbage
data in the other memebers of this data structure.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-09-03 21:55:05 +02:00
Jakub Rzeszutko 5554bdcab3 shell: fix printing from other threads
This fix prevents a scenario when command callback calls shell_fprintf
after the shell cleared the command context flag and before setting
the prompt correctly.

Fixes #27522

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordisemi.no>
2020-09-03 21:54:47 +02:00
Erwan Gouriou 04113e2b35 boards: nucleo: Recommand pyocd pack --update command
Running pack --update gives more change to the pack --install to
succeed.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-09-03 21:54:37 +02:00
Erwan Gouriou cbbadfd688 boards: nucleo_g071rb: Fix pyocd target
In recent pyocd versions, `stm32g071rbtx` should be used as target
name.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2020-09-03 21:54:37 +02:00
Watson Zeng 1dddbecb35 tracing: swap: bug fix and enhancement for ARC
* Move switched_in into the arch context switch assembly code,
  which will correctly record the switched_in information.

* Add switched_in/switched_out for context switch in irq exit.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-09-03 21:54:15 +02:00
Mulin Chao 2612c50daa drivers: clk_ctrl: npcx: fixed 'line length exceeds 80 columns' warning.
Fixed 'line length exceeds 80 columns' warning by shortening the clock
controller device name from NPCX_CLOCK_CONTROL_NAME to
NPCX_CLK_CTRL_NAME.

Signed-off-by: Mulin Chao <MLChao@nuvoton.com>
2020-09-03 21:53:35 +02:00
Peter Bigot b3f0c3b4d7 lib: os: prf: correct use of istype functions
Character class functions from ctype.h may be implemented as macros
where the argument is used to index an array of class flags.  Using a
char value as an index produces diagnostics in some toolchains.
Explicitly cast the parameter to the type required by the API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-03 21:53:09 +02:00
Peter Bigot e812ee6c21 shell: support floating point output with newlib
shell_fprintf requires that formatted output be emitted with a
putchar()-like output function.  Newlib does not provide such a
capability.  Zephyr provides two solutions: z_prf() which is part of
minimal libc and handles floating point formatting, and z_vprintk()
which is core and does not support floating point.

Move z_prf() out of minimal libc into the core lib area, and use it
unconditionally in the shell.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-09-03 21:53:09 +02:00
Dominik Ermel 1b617a368f mgmt: smp: Change smp_shell_rx_byte to process data in bulk
The smp_shell_rx_byte has been renamed to smp_shell_rx_bytes and now
accepts data buffer pointer and its size as parameters. Return value
has been changed to size_t and represents number of bytes processed from
the given buffer.

The change has been done to more efficiently serve most common scenario
when the function is called in loop to process buffer, byte by byte.
Previously such operation required passing each byte separately,
with the change the function will work directly on source buffer
reducing number of calls and byte copy operations.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2020-09-03 21:53:00 +02:00
Andrzej Głąbek 460a97d378 drivers: usb_dc_nrfx: Enable and properly initialize nrfx POWER driver
This is a follow-up to commit 701e9befe4.

The NRFX_POWER Kconfig option should be enabled together with USB_NRFX,
not with CLOCK_CONTROL_NRF, as the USB driver is the actual user of
the nrfx POWER driver.

This patch adds also missing initialization of the nrfx POWER driver
and refactors a bit the usb_init() function introduced in the commit
mentioned above, so that it does not redefine the DT_DRV_COMPAT macro
and uses for conditional compilation the same Kconfig option that is
the dependency of NRFX_USBREG.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-09-03 21:52:52 +02:00
Andrzej Głąbek 30908a91ce tests: arm_irq_vector_table: Correct the name of nRF clock IRQ handler
It should be nrfx_power_clock_irq_handler, not nrfx_clock_irq_handler.
The latter is only present as a function if both nrfx CLOCK and POWER
drivers are used and it is then called from the actual IRQ handler,
which is always named nrfx_power_clock_irq_handler (also when only
the nrfx CLOCK driver is used as in case of this test).

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-09-03 21:52:52 +02:00
Andrzej Głąbek 76745bc085 modules/Kconfig.nordic: Enable NRFX_USBREG together with NRFX_POWER
On SoCs featuring the USBREG peripheral, the nrfx_power driver uses
the nrfx_usbreg one internally, so enable the latter when the former
is enabled.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2020-09-03 21:52:52 +02:00
Emil Obalski ec878bf6a3 usb: Fix USB GetStatus(Device) request handling
The device returns 2 bytes for GetStatus(Device) request.
If the device is self-powered then it shall respond with
bit 0 set to 1 when responding to GetStatus(Device) req.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-03 21:52:21 +02:00
Jordan Yates c4d0c1ee90 tests: uart_async_api: build segger rtt driver
Add a build only test to validate correct compilation of the uart_rtt
driver. No harness that connects to RTT is defined, and therefore the
test can't be run by CI.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-09-03 21:51:28 +02:00
Jordan Yates 1d0acd2bb8 drivers: serial: uart_rtt async support
Add support for `CONFIG_UART_ASYNC_API` to the uart_rtt driver.
As RTT provides no mechanism for knowing when new data has arrived,
the reception commands all return errors.

This fixes hard faults when asynchronous calls are made on the uart_rtt
driver, in addition to providing a small level of functionality.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-09-03 21:51:28 +02:00
Jordan Yates 3e33d73381 drivers: serial: uart_rtt converted to devicetree
Instantiate RTT UART instances from devicetree nodes instead of from
Kconfig symbols. While RTT is implemented using software, not hardware,
it is emulating a hardware device, and thus should be configured through
devicetree. This allows the simulated UART device to be selected via
devicetree aliases and chosen nodes.

The following devicetree snippet will instantiate RTT channels 0 and 2
as UART devices.
```
/ {
	rtt0: rtt_terminal {
		compatible = "segger,rtt-uart";
		label = "rtt_terminal";
		status = "okay";
	};

	rtt2: rtt_secondary {
		compatible = "segger,rtt-uart";
		label = "rtt_app_specific";
		status = "okay";
	};
};
```

Fixes the RTT portion of #10621.

Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
2020-09-03 21:51:28 +02:00
Erwin Rol 742256f8ed drivers: dma: stm32: only set mem pool size when using DMAMUX
The general DMA driver doesn't use kmalloc anymore so it doesn't
need a memory pool. The DMAMUX_SMT32 driver still uses kmalloc,
so move the HEAP_MEM_POOL_SIZE config under DMAMUX_STM32.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-03 21:50:58 +02:00
Erwin Rol f3ca040e41 tests: dma: loop_transfer: add board configurations
Add configurations for Nucleo F207ZG, F767ZI, L053R8, and L496ZG.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-03 21:50:58 +02:00
Erwin Rol fc71836769 tests: dma: loop_transfer: allow configuration of device and channel
Add Kconfig with the following options:

- DMA_LOOP_TRANSFER_DRV_NAME to set the DMA device name, because
  some SOCs do not allow memory to memory DMA on all DMA devices
- DMA_LOOP_TRANSFER_CHANNEL_NR some SOCs start counting the DMA
  channels at 1 instead of 0.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-03 21:50:58 +02:00
Erwin Rol 7b8b219d63 drivers: dma: stm32: check result of stream disabling
Use dma_stm32_disable_stream instead of stm32_dma_disable_stream
to check if the disabling of the stream really worked and if
not return an error.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-03 21:50:58 +02:00