Commit Graph

43766 Commits

Author SHA1 Message Date
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
Erwin Rol 2da881a0ed drivers: dma: stm32: prevent posible out of bound access
Set pointer to an array element only after checking the bounds
of the index.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-03 21:50:58 +02:00
Erwin Rol 3866b39bb2 drivers: dma: stm32: remove global function tables
Convert the driver from global function tables to functions
that use static const function tables.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-03 21:50:58 +02:00
Erwin Rol b05dc440e0 drivers: dma: stm32: convert global conversion tables to functions
Convert global conversion tables for id-to-stream and slot-to-channel
to functions that use local const static conversion tables.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-03 21:50:58 +02:00
Erwin Rol 67f68e68f1 drivers: dma: stm32: refactor irq handling
- Remove the need for kmalloc
- On hardware that supports it use 1 IRQ handler per stream to
  determine the stream ID, so the ISR does not have to loop
  over all ID's to see which one is active. On hardware (like
  STM32L0 and STM32F0) where up to 7 streams share 3 IRQ's use
  the loop to check which stream is active.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-03 21:50:58 +02:00
Erwin Rol c8ae070de7 drivers: dma: stm32: Improve code readability
Some small code readability changes.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-03 21:50:58 +02:00
Erwin Rol 1c6a405ccb drivers: dma: stm32: Use volatile for flag used in ISR
Use volatile for flag shared between normal code and ISR to
prevent the compiler from possibly optimizing it away.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2020-09-03 21:50:58 +02:00
Trond Einar Snekvik 3004975765 Bluetooth: Mesh: Fix Health model shell doc
The Health models' shell documentation was mistakenly labeled Heartbeat
Client and Heartbeat Server, and the Heartbeat configuration commands
were mistakenly categorized under these sections.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-09-03 21:50:41 +02:00
Crist Xu 6fcd5b567e drivers: i2c: Fix mcux driver transfer status after NACK
Adds a delay after transferring zero-length messages to
correctly detect a NACK.

Signed-off-by: Crist Xu <crist.xu@nxp.com>
2020-09-03 21:50:18 +02:00
Emil Obalski c5b96cce6c usb: samples: audio: Add samples to sanitycheck
Add nrf5340dk_nrf5340_cpuapp platform to build in sanitycheck.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-03 21:50:03 +02:00
Emil Obalski 0728949948 samples: usb: Audio samples support for nRF53
This patch adds support for USB Audio class samples for
nRF5340dk.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-03 21:50:03 +02:00
Emil Obalski d86c43fbb0 samples: usb: Software RNG for nRF53
nRF53 application core does not have RNG peripheral.
Software implementation must be used instead.
This patch adds config overlay for hid-cdc nRF5340 sample.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-03 21:50:03 +02:00
Emil Obalski c0f440a0f1 boards: Add USB support for nRF5340dk
This commits adds support for nrf5340dk.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-03 21:50:03 +02:00
Emil Obalski c4de4752df usb: Add USB support for nRF5340
This patch adds USB peripheral support for nRF530 for both
Secure and Non-secure.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-03 21:50:03 +02:00
Peter A. Bigot 338f0caca0 tests: fs: update for change in capability
FS_TYPE_END is no longer used as there is no hard-coded limit on the
number of file systems.  Replace with the limit used when only in-tree
file systems are enabled.

The test for unsupported file systems is no longer valid.  Instead
verify that attempting to register a file system when there is no room
for it fails as expected.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-09-03 21:49:34 +02:00
Peter A. Bigot ad782596ea fs: allow setting max file name explicitly
Zephyr allows an application to register additional file systems,
which may have maximum filename lengths different from the in-tree
FatFs and littlefs options.  Provide a Kconfig variable that allows
the default inference to be overridden.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-09-03 21:49:34 +02:00
Peter A. Bigot d0d3c4a3a7 fs: allow external file system implementations
The documentation claims that Zephyr supports external file system
implementations, and there's no reason not to do so.  Rework the API
to allow this.

Note that the file system type cannot legally be an enum anymore,
since we need to support file system types that don't have an
identifier assigned in that enum.  Rely on the implicit conversion of
enum values to int to preserve backwards compatibility.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-09-03 21:49:34 +02:00
Peter A. Bigot 353336d632 fs: make file system description const
There's no reason the table of pointers to file system functions needs
to be mutable at runtime.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-09-03 21:49:34 +02:00
Jeremy LOCHE ddcc385586 drivers: ethernet: stm32h7 reduce count of tx_buffer_def
Reduced the size of tx_buffer_def array to 1 to save
on function stack memory. Here only 1 buffer is
enough to call the transmit function.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-09-03 21:48:53 +02:00
Jeremy LOCHE 8e46f099bf drivers: ethernet: stm32h7 IT based ethernet TX
Modify the ethernet driver to use TX complete interrupts.
Adds HAL ethernet TX complete callback and locking semaphore.

Due to changing behavior/content of the TX DMA descriptors
on STM32H7 series, based on the state of the IP,
it is more reliable to wait for the TX complete interrupt to check
for DMA end of transmission event. This avoids polling the
DMA_DESC_OWN bit in the descriptors.

Improves reliability and performance of the ethernet peripheral.

Tested on CoapServer sample, Dumb HTTP server, telnet sample.

Signed-off-by: Jeremy LOCHE <lochejeremy@gmail.com>
2020-09-03 21:48:53 +02:00
Watson Zeng fad20c42c6 boards: arc: nsim: add a new board nsim_em7d_v22
Typically we have ARC core configurations where Fast IRQs (FIRQ) are
enabled together with multiple register files and those we have covered
by testing. But FIRQ & single register bank we only happen to have on
the older EMSK v2.2.it might be a good idea to add a similar
configuration to nSIM "boards" so that we keep it tested regularly.

nsim_em7d_v22 configuration is similar with em_staterkit_em7d_v22,
both configed with FIRQ & single register bank.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-09-03 21:47:51 +02:00
Rihards Skuja 38e1bf1f29 cmake: toolchain: fix unsupported warnings for C++ builds
Compile with arm-none-eabi-g++ (10.2.0 with -std=c++17) generates a
warning for every C++ source file:
"cc1plus: warning: command-line option '-Wno-pointer-sign' is valid for
C/ObjC but not for C++"

Get rid of those warnings by adding '-Wno-pointer-sign' to the list of
excluded CXX options.

Signed-off-by: Rihards Skuja <rihardssk@mikrotik.com>
2020-09-03 21:47:14 +02:00
Martin Jäger 81c7daea5b boards: nucleo_f091rc: Enable DAC driver
Also add this board to DAC driver sample

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-09-03 14:46:03 -05:00