Commit graph

41120 commits

Author SHA1 Message Date
Krzysztof Chruscinski
ffbd48e2c1 logging: Fix false strdup buffer freeing
Algorithm for freeing strdup buffers was only checking if argument
matches address within strdup buffer pool and was attempting freeing
even if format specifier was different than string.

Added fix where also format specifier is checked.

Extended logger test to verify correctness of function which searches
for string format specifiers within a string.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-20 08:49:01 -05:00
Krzysztof Chruscinski
ee14a49e91 tests: logging: log_core: Extended test_log_strdup_gc
Extended test to pass address within strdup buffer but with
different format specifier (not string). That should not trigger
string buffer freeing. If it does system may collapse (e.g. cortex-m0
may use unaligned access).

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-20 08:49:01 -05:00
Thomas Schmid
91e39d5ee7 drivers: adc: adc_stm32: fix clock setup
Fix clock setup for stm32 f3, l4, wb and g4 series.

The macro __LL_ADC_COMMON_INSTANCE() is called without argument, which
leads to a compile error. Fix by passing adc parameter.

Signed-off-by: Thomas Schmid <tom@lfence.de>
2019-12-20 08:04:09 -05:00
Gerson Fernando Budke
0567184b3b board: atsamr21_xpro: Update config
Enable radio transceiver configuration by default on atsamr21_xpro
board.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2019-12-20 07:58:59 -05:00
Gerson Fernando Budke
b2af5fd5e3 board: atsamr21_xpro: Update yaml with ieee802154
Add IEEE 802.15.4 feature to yaml config file.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2019-12-20 07:58:59 -05:00
Gerson Fernando Budke
8638a0cc3c board: atsamr21_xpro: Add at86rf233 dts binding
Add at86rf233 dts binding to enable IEEE 802.15.4 driver. The driver is
managed by sercom-4 at chip level.

see: SAM-R21_G.pdf section: 5.2 Internal Multiplexed Signals

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2019-12-20 07:58:59 -05:00
Andrei Gansari
6adde8c137 drivers: eth_mcux enable checksum and autonegotiation
Enable ETHERNET_HW_TX_CHKSUM_OFFLOAD, ETHERNET_HW_RX_CHKSUM_OFFLOAD,
ETHERNET_AUTO_NEGOTIATION_SET and the equivalent driver configuration
in eth_mcux driver.
Autonegoitiation was done at driver initialization.

Signed-off-by: Andrei Gansari <andrei.gansari@nxp.com>
2019-12-20 12:35:21 +02:00
Anas Nashif
2a5d61d3ea sanitycheck: define schema for hardware map
Add schema for hardware map and verify it.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-19 22:55:16 -05:00
Anas Nashif
fc85ff052f sanitycheck: support pre/post flash scripts
This is needed when a board needs to be reset using an external commands
or tools that are not part of the flash command. For example, power
reset or by poking a GPIO header on the board using external wiring.

add post_flash/pre_flash to the platform section in the hardware map.
For example:

- available: true
  connected: true
  id: OSHW000032254e4500128002ab98002784d1000097969900
  platform: reel_board
  post_script: /tmp/post_flash.sh
  pre_script: /tmp/pre_flash.sh
  product: DAPLink CMSIS-DAP
  runner: pyocd
  serial: /dev/ttyACM11

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-19 22:55:16 -05:00
Johann Fischer
5c48c2132d drivers: ssd16xx: derive buffer length from width and height attributes
Derive buffer length from width and height attributes and
do not use buf_size direct.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-12-19 22:17:36 +01:00
Johann Fischer
f54b106f60 drivers: ssd1306: cleanup and make functions static
Cleanup and make functions static.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-12-19 22:17:36 +01:00
Johann Fischer
d50ec79757 drivers: ssd1306: derive buffer length from width and height attributes
Derive buffer length from width and height attributes and
do not use buf_size direct.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-12-19 22:17:36 +01:00
Diego Sueiro
e924879ef7 samples/subsys/shell: Introduce Sensor Shell module
Adds the Sensor Shell module sample app.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-19 15:54:04 -05:00
Diego Sueiro
93e1560faa subsys/shell: Introduce the Sensor Shell Module
Adds a Shell Module for retrieving Sensor data. The following commands
were added:

sensor - Device commands
Options:
  -h, --help  :Show command help.
Subcommands:
  get            :<device_name> [chanel_idx]
  list           :List configured sensors
  list_channels  :<device_name>

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2019-12-19 15:54:04 -05:00
Sebastian Bøe
bb95dce98c west: Fix defining modules without a module.yml
It is supported to have a zephyr module that does not have a
module.yml, but zephyr_module.py does not support it and will drop
such modules.

To fix this we add support in zephyr_module.py.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-12-19 15:52:44 -05:00
David B. Kinder
efffdfc4d0 doc: tweak search to to understate certain docs
All docs are treated equally in the search results. The built-in search
system knows to emphasize hits in titles and object names, but could use
some help understating hits in non-definitive docs.  In particular, hits
to docs in the  /boards, /samples, and /reference/kconfig docs are often
not as important as hits in other docs, so let's push them later in the
search result output.

We can tweak the search results scoring (and thereby the order of
display) via the ``html_search_scorer`` setting in ``conf.py`` along
with a piece of JavaScript to adjust the result score.

Fixes: #16935

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-12-19 15:52:11 -05:00
Hake Huang
f1d515fa60 test: benchmarkis add frdmk82f board config
add board config file for latency_measure

Signed-off-by: Hake Huang <hake.huang@nxp.com>
2019-12-19 12:55:18 -05:00
Laczen JMS
0cf0eef7a6 drivers/flash: nios2_qspi add unaligned read test
Add unaligned test

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-12-19 12:53:22 -05:00
Laczen JMS
a91df4a077 drivers/flash: nios2_qspi byte read access
Correct nios2_qspi to allow byte size read access

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-12-19 12:53:22 -05:00
Mateusz Holenko
49da1b877e drivers: i2c_bitbang: read SDA on high clock
According to the I2C spec, the SDA signal must be
stable as long as the SCL signal is high (which
means it can change only when clock is low).

This commit reworks clock signal handling
in such a way that all reads are done
when SCL is high and SDA is stable.

Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-12-19 11:08:55 -05:00
Stephanos Ioannidis
382e6fbccf drivers: watchdog: Make WDT_DISABLE_AT_BOOT default to y
This commit consolidates the meaning of WDT_DISABLE_AT_BOOT option as
"disabling watchdog at Zephyr system startup for the SoCs that enable
the watchdog by default after reset", and makes this default to y in
order to prevent unintentional processor reset by the watchdog when
not explicitly configured and fed by the application.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-19 11:07:42 -05:00
Stephanos Ioannidis
2b441732ff interrupt_controller: gic: Support multiple GIC versions
The current GIC driver implementation only supports the GIC-400, which
implements the GICv2 interface.

This commit refactors the GIC driver to support multiple GIC versions
and adds GICv1 interface support (GICv1 and GICv2 interfaces are very
similar).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-19 11:05:27 -05:00
Stephanos Ioannidis
11d0f0a294 drivers: interrupt_controller: Refactor GIC configurations
The current GIC configuration scheme is designed to support only one
specific type and version of GIC (i.e. GIC-400 that implements the
GICv2 interface).

This commit adds a set of GIC version configuration symbols that can
be selected by the SoC configuration to specify which version of GIC
interface is implemented in the SoC.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2019-12-19 11:05:27 -05:00
Krzysztof Chruscinski
08a017a34b logging: Fix synchronous logging in thread context
Due to flipped logic is_irq_locked function was returning true then
interrupts were unlocked. Because of that CONFIG_LOG_BLOCK_IN_THREAD
feature was not working correctly and wasn't locking thread context
when log message buffer pool was empty.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-19 11:04:42 -05:00
Krzysztof Chruscinski
2c429ca24f soc: arm: nordic: Remove enabling of temperature sensor
nrf51 and nrf52 by default was enabling temperature sensor if sensor
API was enabled. It was causing code size increase even when
temperature sensor was not touched by anyone. Removed default enabling
of temperature sensor for both series.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-12-19 16:02:55 +01:00
Peter Bigot
816d2c47a4 samples: sensor: dht: add sample
Add a sample to test the Aosong temperature/humidity sensor.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-19 06:43:37 -06:00
Peter Bigot
0cfac519cc sensor: dht: convert from Kconfig to devicetree
Define a binding for the Aosong DHT family of temperature/humidity
sensors.  Remove the Kconfig settings, and update the driver to use
devicetree information.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-19 06:43:37 -06:00
Ulf Magnusson
7666e1cf7e tests: build_all: Add LPS22HH sensor
To get testing coverage after the fix in the previous commit.

Co-authored-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-19 06:41:25 -06:00
Ulf Magnusson
967b89a752 sensors: lps2hh: Fix misspelled GPIOS_CONTROLLER references
DT_INST_0_ST_LPS22HH_CS_GPIO_CONTROLLER should be
DT_INST_0_ST_LPS22HH_CS_GPIOS_CONTROLLER, which is the name generated by
gen_defines.py.

Discovered while working on unrelated removing of special-casing for
clocks.

Co-authored-by: Armando Visconti <armando.visconti@st.com>
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-19 06:41:25 -06:00
Emil Obalski
7fc0486ca0 doc: release notes: Update contents for 2.2.0
Update to API change in regards of USB changes.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Johann Fischer
ab346a502b usb: initialize USB descriptor earlier
Initialize USB descriptor earlier.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-12-19 13:08:55 +01:00
Emil Obalski
2128750138 usb: api: Add user device status callback
By this commit user gets possibility to register USB
device satutus callback. This callback represents device state
and is added so user could know what happend to USB device.

Callback is registered by providing it to usb_enable()
USB api is extended by this callback handler.

Samples using using USB are by default provide no callback
and the usb_enable() is called with NULL parameter.

Status callback registered by hid class is deleted as now
USB device has global callback for all classes within device.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Emil Obalski
d65027d8c0 usb: samples: Application calling usb_enable by itself
User app is reponsible for issuing usb_enable and
making USB hardware operative.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Emil Obalski
e3619d50e0 usb: Add mutex to usb_enable
The purpose of this commit is to prevent user from
calling usb_enable() twice from different contexes.

If for example user configures composite device with hid
and USB uart console (CONFIG_USB_UART_CONSOLE=y)
then introduced mutex will prevent from calling
usb_enable twice and thus lead to undefined behaviour of
usb driver controller.

usb_enable shall always be called once as it refers to usb driver
and for now only one USB driver instance is supported in Zephyr.
This mechanism ensures that.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2019-12-19 13:08:55 +01:00
Peter Bigot
bc2ecad363 samples: drivers: spi_flash: increase test data length
Some drivers may be unable to write less than 4 bytes.  Increase the
test to use at least 4 bytes and refactor so the logic is no longer
explicitly size-dependent.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-19 12:37:31 +01:00
Peter Bigot
bb106390a2 dts: bindings: generalize JEDEC SPI NOR descriptions
Currently most SPI NOR serial flash devices are accessed through the
spi-nor flash driver, but there are pending enhancements that will
access these devices through other driver implementations.  Several of
the descriptive properties of the flash memories are common regardless
of the interface selected.  Pull those out to a separate yaml file to
be included into the bindings for interface-specific node descriptions.

Also revise the documentation to note that the jedec,spi-nor
compatible depends on a commands set compatible with the Micron M25P80
serial nor flash; there is no JEDEC standard for these commands.
These devices do generally provide descriptive structures defined by
JESD216, but currently Zephyr doesn't make use of these structures.
The JEDEC CFI standard previously referenced in the description is not
relevant to these devices.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-19 12:37:31 +01:00
Peter Bigot
bd59397672 boards: nrf52840_pca10056: use correct maximum write speed for flash
MX25R64 supports maximum 33 MHz clock for READ operations in
high-performance mode.  The previous 80 MHz speed should have been
8 MHz and was for DSPI/QSPI operations.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-19 12:37:31 +01:00
Martí Bolívar
150eb6575c scripts: west build: slight --help tweak
We have an open request to make the help for the -t option a little
easier. Try to do that without adding too much length to the short
help.

Fixes: #16202
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2019-12-19 11:29:39 +01:00
Ulf Magnusson
5e55eda30e scripts: edtlib: Support nested nodes on buses
For the following devicetree, view 'nested' as being on the bus.
Previously, only 'node' was considered to be on the bus.

    some-bus {
    	compatible = "foo,bus-controller";
    	node {
    		nested {
    			compatible = "foo,device-on-bus";
    		};
    	};
    };

In practice, this means that a 'bus:' key in the binding for
'foo,bus-controller' will now get matched up to an 'on-bus:' key in the
binding for 'foo,device-on-bus'.

Change the meaning of Node.bus and add two new attributes Node.on_bus
and Node.bus_node, with these meanings:

    Node.bus:
      The bus type (as a string) if the node is a bus controller, and
      None otherwise

    Node.on_bus:
      The bus type (as a string) if the node appears on a bus, and None
      otherwise. The bus type is determined from the closest parent
      that's a bus controller.

    Node.bus_node:
      The node for the bus controller if the node appears on a bus, and
      None otherwise

It's a bit redundant to have both Node.bus_node and Node.on_bus, since
Node.on_bus is the same as Node.bus_node.bus, but Node.on_bus is pretty
handy to save some None checks.

Also update gen_defines.py to use Node.on_bus and Node.bus_node instead
of Node.parent wherever the code deals with buses.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-19 11:02:28 +01:00
Ulf Magnusson
527343dfce dts: bindings: Replace 'child-bus:'/'parent-bus:' with 'bus:'/'on-bus:'
'child-bus:'/'parent-bus:' have been deprecated.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-19 11:02:28 +01:00
Ulf Magnusson
379145ffce scripts: edtlib: Rename 'child-bus:'/'parent-bus:' to 'bus:'/'on-bus:'
I keep mixing these up, so that's probably a sign that the names are
bad. The root of the problem is that "parent-bus" can be read as both
"this is the parent bus" and as "the parent bus is this".

Use 'bus:' for the bus "provider" and 'on-bus:' for nodes on the bus
instead, which is less confusing.

Support the old keys for backwards compatibility, along with a
deprecation warning.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-19 11:02:28 +01:00
Johan Hedberg
847f4e6ae6 Bluetooth: L2CAP: Fix checking for STATUS_OUT
The test_and_set_bit() should be checking if the flag was *not*
already set, since that's the scenario where we want to call the
status callback.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-12-19 11:28:24 +02:00
Johan Hedberg
525889c6b5 Bluetooth: L2CAP: Remove bogus NULL checks
The ch pointer is the result of a CONTAINER_OF() operation, so
checking it for NULL is pointless. Additionally, there's no place that
calls this function with chan set to NULL.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-12-19 11:28:24 +02:00
Johan Hedberg
0e91493ab4 Bluetooth: L2CAP: Make channel ops const
Make the channel ops struct const since there really isn't anything
there that needs to change at runtime. The only exception is the L2CAP
shell which was playing with the recv callback, however that can be
fixed by introducing a simple bool variable.

With tests/bluetooth/shell this reduces RAM consumption by 112 bytes
while adding only 16 bytes to flash consumption.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-12-19 11:28:24 +02:00
Martí Bolívar
bc444ec6e1 doc: releases: add python 3.6 requirement to notes
Add a release notes line item about the move to Python 3.6.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2019-12-18 20:26:39 -05:00
Anas Nashif
8d2675010a kernel: update SCHED_CPU_MASK Kconfig doc
Fix reference to APIs and reformat kconfig help message.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-18 20:25:33 -05:00
Daniel Leung
b61f448a3f xtensa: add support to build HAL as part of build process
This adds the necessary bits to build the Xtensa HAL as
a module, and removes the bits to use the HAL built with
the Zephyr SDK.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-18 20:24:18 -05:00
Daniel Leung
250041f4c8 west.yml: add hal_xtensa as a module
This adds hal_xtensa as a module.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-12-18 20:24:18 -05:00
Justin Brzozoski
0116729114 net: mqtt: Maintain count of PINGREQ awaiting response
Maintain a simple count of how many PINGREQ have been sent for the
current connection that have not had a corresponding PINGRESP.  Nothing
is done with this information internal to the MQTT driver, but it is
exposed to the application layer to monitor as desired.

Signed-off-by: Justin Brzozoski <justin.brzozoski@signal-fire.com>
2019-12-18 23:33:56 +02:00
Benjamin Valentin
2d5c6b4a72 tests: spi_loopback: Add atsame54_xpro configuration
Adds a board-specific configuration for the atsame54_xpro to the
spi_loopback test.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-12-18 22:12:15 +01:00