Commit graph

41120 commits

Author SHA1 Message Date
Flavio Ceolin
17c7db6bbe lib: posix: Explicitly ignoring return of memcpy
According with MISRA-C the value returned by a non-void function has
to be used. As memcpy return is almost useless, we are explicitly
ignoring it.

MISRA-C rule 17.7

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-19 14:37:25 +01:00
Flavio Ceolin
8f3459b3db coccinelle: Updating ignore_return to support memcpy
The return of memcpy was being ignored just like memset's return. Just
adding it to coccinelle script.

MISRA-C rule 17.7

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-19 14:37:25 +01:00
Flavio Ceolin
27435e4cb3 log: Explicitly ignoring return of memcpy
According with MISRA-C the value returned by a non-void function has
to be used. As memcpy return is almost useless, we are explicitly
ignoring it.

MISRA-C rule 17.7

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-12-19 14:37:25 +01:00
Krzysztof Chruscinski
b467de5849 shell: Add dropping of expired messages
Log message get timestamp when being added to shell log message queue.
When adding to log message queue timeouts then all messages added
before timeout are dropped.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-19 14:37:00 +01:00
Krzysztof Chruscinski
08f0d93cbb shell: Improve handling of log messages
If burst of log messages was passed to the shell log
backend, it was likely that messages were lost because
shell had no means to control arrivals of log messages.

Added log message enqueueing timeout to the shell instance
to allow blocking logger thread if short-term arrival rate
exceeded shell capabilities.

Added kconfig option for setting log message queue size
and timeout in RTT and UART instances. Added section in
shell documentation which explains interaction between
the logger and shell instance acting as a logger backend.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-19 14:37:00 +01:00
Marcin Szymczyk
801b54edb9 usb: hid: boot protocol
Set_Protocol and Get_Protocol requests are handled now.
Tested with USB3CV.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-12-19 07:36:18 -06:00
Armando Visconti
4446b16e24 driver: sensors: convert lsm9ds0_mfd to use information coming from dts
Convert lsm9ds0_mfd accel/magn driver to get the device name as well
as i2c slave information from device tree. Updates the build_all
test accordingly.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-19 07:31:18 -06:00
Armando Visconti
6e2a1b62c4 drivers: lsm9ds0_mfd: Fix typo in get accel/magn channels
Fixed channel type in get accel/magn channel routines,
where, by mistake, GYRO definitions were used instead of
ACCEL/MAGN ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2018-12-19 07:31:18 -06:00
Kumar Gala
0b9cfe70ed ci: bump number of builders to 7
Temp bump number of builders to 7 since we getting a lot of timeout
issues with normal PRs.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-18 10:57:28 -06:00
Jakub Rzeszutko
f0b19181e0 bt_shell: fix command bt advertise valid argument count
Changed number of valid arguments from two required to
one required and one optional.

Command can be called with required <type: off, on, scan, nconn>
and optional <mode: discov, non_discov>".

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-18 18:52:00 +02:00
Krzysztof Chruscinski
fcc7240fbe logging: Add handling of dropped messages to native POSIX backend
Extended native POSIX backend to handle dropped messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-18 13:42:41 +01:00
Krzysztof Chruscinski
31a90ca592 logging: Add handling of dropped messages to RTT backend
Extend RTT backend to handle dropped messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-18 13:42:41 +01:00
Krzysztof Chruscinski
1edf09e17a logging: Add handling of dropped messages to UART backend
Extend UART backend to handle dropped messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-18 13:42:41 +01:00
Krzysztof Chruscinski
a7568e4a6a logging: Handle dropped messages in log_output
Extended log_output interface to handle dropped
messages. Log_output is printing a message containing
number of dropped messages.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-12-18 13:42:41 +01:00
Ulf Magnusson
1581155828 menuconfig: Add show-help mode
Update menuconfig (and Kconfiglib, just to sync) to upstream revision
e629c33d31e22, to add the commit below.

  menuconfig: Add show-help mode

  Pressing F toggles show-help mode, where the help window at the bottom
  displays the help text of the currently selected item, if any. Can be
  handy when browsing through symbols.

  Also mention the different modes that are available in the module
  docstring.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-12-18 13:28:37 +01:00
Andrei Gansari
574014146d mimix1050rt: ethernet initialization corrected
Fixes board PHY initialization.
ENET_RST and ENET_INT pins are also used as USER_LED/JTAG_TDI and
INT1_COMBO/JTAG_TDO. Initialization needs to set these pins to power and
interrupt for the PHY Transciver. PHY reset works without busy waiting.
Moved pin initialization back to PRE_KERNEL_1 to fix UART bug and busy
wait not required.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2018-12-18 12:49:24 +01:00
Jakub Rzeszutko
cab9fa35ad shell: fix tab key functionality.
Fixing commit:#7ad59c84c84e8b7ea3c0438ff01c8a6343e65812

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-18 12:42:29 +01:00
Aurelien Jarno
9fe81e9165 dts: stm32f7: move flash0 node below flash-controller
Due to a bad timing in merging PR #10744 and PR #12083, the flash0 node
in stm32f756Xg.dtsi ended-up at the root of the device tree, while the
flash0 node it is trying to override in stm32f7.dtsi is now under
/soc/flash-controller.

This patch fixes that by moving it at the right location.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-18 09:38:57 +01:00
AJ Palmer
a8ce329cc9 boards: arm: nucleo_f756zg: Added SPI support
Added support for SPI 1 available from the arduino connector (plus an
extra gpio). Tested against samples/sensor/bme280.

Added warnings in documentation, pinmux and dts highlighting a potential
conflict if using SPI_1 and on-board ethernet at the same time.

Signed-off-by: AJ Palmer <ajpcode@hotmail.com>
2018-12-17 11:35:27 -06:00
AJ Palmer
98d551039e boards: arm: nucleo_f756zg: Added PWM support
Added PWM support for one of the gpios connected to the arduino uno v3
connector.

Signed-off-by: AJ Palmer <ajpcode@hotmail.com>
2018-12-17 11:35:27 -06:00
AJ Palmer
e7cb2d65f9 boards: arm: nucleo_f756zg: Added I2C support
Added I2C support to the I2C bus connected to the arduino uno v3
connector.

Signed-off-by: AJ Palmer <ajpcode@hotmail.com>
2018-12-17 11:35:27 -06:00
AJ Palmer
0efd0ece95 boards: arm: nucleo_f756zg: Added USB support
Added pinmux and device tree information required to use the on-board
usb otg port.

Signed-off-by: AJ Palmer <ajpcode@hotmail.com>
2018-12-17 11:35:27 -06:00
AJ Palmer
de3a2c65fc boards: arm: nucleo_f756zg: Added ethernet support
Added pinmux and defconfig information required to use the on-board
ethernet.

Signed-off-by: AJ Palmer <ajpcode@hotmail.com>
2018-12-17 11:35:27 -06:00
AJ Palmer
2f04dc69c0 boards: arm: nucleo_f756zg: Created new board and soc definition
Added board definitions for nucleo_f756zg. Features include gpio,
pinmux, uart (ST Zio, ST-Link and Arduino Uno v3 interfaces).

Added basic documentation and some soc definitions for the
stm32 f756XX soc.

Signed-off-by: AJ Palmer <ajpcode@hotmail.com>
2018-12-17 11:35:27 -06:00
Kumar Gala
cca5b61e84 arc: cleanup linker scripts to include autoconf.h first
The various linker scripts on arc would include autoconf.h in the arch
linker script but might have CONFIG_ symbols referenced in the soc
specific linker script.  Move autoconf.h inclusion to top of the soc
specific linker script out of the arch specific one so we know
autoconf.h is seen before any CONFIG_ references.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-17 10:08:02 -06:00
AJ Palmer
e841d42eca boards: arm: nucleo_f746zg: Highlight possible pin conflict
Updated .dts and pinmux.c to highlight pin conflict on PA7 if ETH and
SPI_1 are selected together without modification.

Signed-off-by: AJ Palmer <ajpcode@hotmail.com>
2018-12-17 08:27:11 -06:00
Maureen Helm
ac562d537b soc: arm: Don't touch interrupts in kinetis watchdog init
The early boot watchdog init for kinetis was incorrectly disabling and
reenabling interrupts to preserve timing during the unlock sequence.
However, interrupts are already disabled before this routine executes
and the kernel is not yet ready to enable them when this routine exits.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-12-17 08:26:30 -06:00
Maureen Helm
2346e318d3 dts: nxp: Add sram_l node to k64 dtsi
Adds a second sram node to the k64 device tree to acknowledge that the
additional sram is present in hardware, but deliberately not used in
zephyr until an outstanding issue is solved. The upper and lower sram
nodes are contiguous in the memory map, however the Cortex-M4
architecture does not support misaligned accesses across the boundary
between the two nodes.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-12-17 08:20:29 -06:00
AJ Palmer
5bf15a88e5 docs: spi.h: removed dev doxygen comment from struct spi_config
Removed a doxygen comment for a structure variable that has been
removed from spi_config.

Signed-off-by: AJ Palmer <ajpcode@hotmail.com>
2018-12-17 08:19:21 -06:00
Erwan Gouriou
1cfec48646 samples: yaml: filter can be limited to GPIO_CONTROLLER
It is safe to assume that if X_GPIO_CONTROLLER is defined (hence
generated) X_GPIO_PIN should also be defined.
If this is not the case, this is an issue and letting the sample
build will reveal the issue.
Update the yaml filter to rely only on _GPIO_CONTROLLER #define's


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-17 08:18:56 -06:00
Erwan Gouriou
a002cab080 samples/basic: disco: LED0 and LED1 might not share GPIO controller
In disco basic sample, same GPIO controller was used for LED0
and LED1, which is actually a particular case.

This change implements the general case, where LED0 an LED1 might
not have the same gpio controller.
Tested on nucleo_f429zi and frdm_k64f.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-17 08:18:56 -06:00
Erwan Gouriou
c338dd9b94 samples/drivers: gpio: LED0 and SW0 might not share GPIO controller
In gpio driver sample, same GPIO controller was used for out pin
(LED0) and in pin (SW0), which is actually a particular case.

This change implements the general case, where button an led might
not have the same gpio controller.
Tested on nucleo_f429zi and frdm_k64f.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-12-17 08:18:56 -06:00
Aurelien Jarno
c52a64624e drivers: usb_dc_stm32: add support for SoF event
Add support for SoF events to the USB STM32 device driver. When
CONFIG_USB_DEVICE_SOF is enabled, enable the corresponding interrupt
and provide a non-weak callback function calling status_cb.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-17 08:17:58 -06:00
Pushpal Sidhu
f603e2509d drivers: i2c_ll_stm32_v2: Handle errors during data transfers
Check for ARLO, BERR, OVR, and NACK errors during any kind of
transmission. Helps fix getting into a while(1) loop in any of these
scenarios when in polling mode.

Signed-off-by: Pushpal Sidhu <psidhu.devel@gmail.com>
2018-12-17 08:17:24 -06:00
Aurelien Jarno
a1c3b0aad3 usb: fix CDC ACM breakage with CONFIG_USB_DEVICE_SOF
Commit e4c447aac3 ("usb: add SoF event") added support for calling the
status callback with the USB_DC_SOF value for each SoF when
CONFIG_USB_DEVICE_SOF is enabled. The CDC ACM driver saves the latest
received status and compares it USB_DC_CONFIGURED to decide if it can
send data to the host. This therefore doesn't work any more when the
status callback is called regulary with USB_DC_SOF.

Fix that by ignoring USB_DC_SOF when saving the latest received status.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-17 08:16:49 -06:00
Aurelien Jarno
6752b5df3f drivers: flash: add driver for STM32F7x series
This patch adds a flash driver for the STM32F7x series, inspired from
the STM32F4x one. It has been tested on the STM32F723, but should also
work on other SoCs of the family.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-17 08:15:59 -06:00
Aurelien Jarno
48d1fbb352 drivers: flash: stm32: pass offset and len to flash_stm32_flush_caches
On SoC families using a Cortex-M7, it is possible to flush only specific
cache lines. Therefore pass the offset and len so that the flush can be
done with more granularity.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-17 08:15:59 -06:00
Aurelien Jarno
123b832a02 drivers: flash: stm32: don't flush i-cache after an erase
In general synchronisation between memory and the instruction cache
should be done explicitly, for example this is how it is done for RAM.
It is also done that way for flash writes in the current STM32 flash
driver.

However in case of flash erases, the current STM32 flash driver flushes
the i-cache. It probably doesn't make a big difference for the
Cortex-M3/M4 families as the cache is very small. That said it might
have bigger impact on families based on Cortex-M7 as it has between 4KB
and 16KB of i-cache, that will be added latter in this patch serie.

This patch therefore remove the i-cache flush in
flash_stm32_flush_caches.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-17 08:15:59 -06:00
Aurelien Jarno
551f9c38b8 drivers: flash: stm32: always define flash_stm32_flush_caches
This reduces the amount of #ifdef and keep all of them at the same
place. The empty function is then optimized-out by the compiler.

At the same time change the negative test by a positive one to simplify
adding new entries.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-17 08:15:59 -06:00
Aurelien Jarno
8e356dbc88 drivers: flash: stm32: improve timeout handling
The timeout handling in the STM32 flash driver is currently a counter
in the busy check loop. This doesn't scale well across the whole STM32
family:
- The duration of the loop depends on the CPU speed, the activation of
  caches.
- The duration of the longest flash operation (a sector erase as the
  driver doesn't support mass erase) can varies a lot mostly depending
  on the sector size, 2K on F0 and L4 families or 128K on the F4 family.

In addition the timeout can change depending if the writing thread is
prempted or not.

Fix that by defining a timeout in ms depending on the family, and using
k_uptime_get to get a precise measurement of the time.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2018-12-17 08:15:59 -06:00
Jakub Rzeszutko
956b00388f shell: fix execute command when help not active
When help functionality is not compiled and command is called with
-h or --help option shell will now either pass this option as
an argument or it will print a message that command does not have
a handler.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-17 11:31:22 +01:00
Jakub Rzeszutko
f7f4fe33a1 shell: static functions cleanup
Removed shell_ prefix from static functions in .c files.
Added static functions for setting and getting shell
internal flags.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-17 11:31:22 +01:00
Jakub Rzeszutko
4d491b283b shell: remove obsolete \r characters
shell parses output string and it adds \r for each found \n.
It is no longer needed to keep \r for each shell message.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-17 11:31:22 +01:00
Jakub Rzeszutko
0c678fac9d shell: header file update
Minor formatting corrections in shell.h file.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-17 11:31:22 +01:00
Jakub Rzeszutko
7ad59c84c8 shell: minor shell source cleanup
Cleanup in shell.c file.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-17 11:31:22 +01:00
Marcin Szymczyk
b0bdc8a4bc samples: usb: hid-mouse: remove get_report_cb
Removed get_report_cb as it was an incorrect implementation
of Get_Report request. Correct response would be returning
current report value, not report descriptor.

Signed-off-by: Marcin Szymczyk <Marcin.Szymczyk@nordicsemi.no>
2018-12-17 11:27:14 +01:00
Robert Lubos
e8620e2cca ext: mbedtls: Unify mbedTLS Kconfig prefixes
Currently there is a mixed approach in prefixes from mbedTLS
configuration (MBEDTLS_ and TLS_). The latter was used in generic config
file and could bring up confusion that it can only be used with TLS
subsystem. Hence unify the approach to MBEDTLS_ prefix to avoid such
confusion.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-17 11:27:02 +01:00
Robert Lubos
41d57db4ac ext: mbedtls: Extend generic config file
Extend generic mbedTLS config file with additional algorithms. Add
separate RNG section. Add switches to enable all algorithms in specific
group.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2018-12-17 11:27:02 +01:00
Kumar Gala
2cc957e860 scripts: extract_dts_includes: Generate defines for chosen props
Generate a set of defines that convey if a given chosen property is used
or not.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-12-17 11:26:40 +01:00
Andrew Boie
07eb5d1eaa arch: arm: fix error reporting for stack overflow
Hardware-based stack overflow protection was reporting this
as an unknown error.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-12-14 16:21:58 -06:00