Commit graph

18968 commits

Author SHA1 Message Date
Ricardo Salveti cec073c35c pwm: nrf5_sw: add support for SYS_LOG
Useful for debugging the period and pulse values used by the driver.

Signed-off-by: Ricardo Salveti <ricardo@opensourcefoundries.com>
2018-01-31 19:51:12 -05:00
Maureen Helm 928ff12c73 samples: drivers: Add freedom boards to flash_shell sample
Adds frdm_k64f, frdm_kw41z, and frdm_kl25z boards to the flash_shell
sample.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 16:43:40 -06:00
Maureen Helm 262595f09f drivers: flash: Implement flash page layout api in mcux driver
Uses the new flash erase-block-size dts property to implement the flash
page layout api in the mcux flash driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 16:43:40 -06:00
Maureen Helm d107411820 arm: nxp_kinetis: Define FLASH_DRIVER_NAME macro for kl2x and kwx SoCs
Defines the FLASH_DRIVER_NAME macro in soc.h for kinetis kl2x and kwx
SoC series. This macro is used by the storage and dfu subsystems, as
well as the flash_shell sample.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 16:43:40 -06:00
Maureen Helm f633c0f997 dts: bindings: Introduce flash erase-block-size property
Adds a new optional dts property to define the erase block size of a
flash device. This will be used by the mcux flash driver to implement
the flash page layout function.

The value is set for all kinetis devices to match
FSL_FEATURE_FLASH_PFLASH_BLOCK_SECTOR_SIZE.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 16:43:40 -06:00
Johan Hedberg d6b905910b Bluetooth: Mesh: Fix passing CID to model publication messages
The vendor variants of the model publication client messages were not
passing onward the CID, rather passing CID_NVAL which is clearly not
right.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-01-31 13:35:36 -08:00
Vinayak Kariappa Chettimada 9acfc7fb5c Bluetooth: controller: Fix to restrict addr set in initiator
Fix controller implementation to restrict HCI LE Set Random
Address command when advertising and/or active scanning
and/or initiator state is enable.

Fixes LL.TS.5.0.2 conformance tests:
LL/CON/INI/BV-01-C [Connection Initiation]
LL/SEC/ADV/BV-01-C [Advertising With Static Address]
LL/SEC/SCN/BV-01-C [Random Address Scanning]

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-01-31 10:54:26 -08:00
Andy Gross 94afaa3845 sensor: hts221: Fix assert logical error
This patch fixes a logical error in a assert statement uncovered by
Coverity.

Coverity-CID: 182588

Signed-off-by: Andy Gross <andy.gross@linaro.org>
2018-01-31 11:03:26 -06:00
Maureen Helm 7dc68b38c3 tests: build_all: Add missing sensors
Now that we have an application level dts fixup, we can re-enable the
fxos8700 sensor in the build_all test. Also added fxas21002 and max30101
sensors which were missing.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 10:17:58 -06:00
Maureen Helm a9c2dc011c hexiwear_k64: Add sensor dts nodes and fixups
Adds dts nodes and fixups for the fxos8700, fxas21002, and max30101
sensors to the hexiwear_k64 board. Tested with:
- samples/sensor/fxos8700
- samples/sensor/fxas21002
- samples/sensor/max30101

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 10:17:58 -06:00
Maureen Helm d60c184c8f frdm_kw41z: Add sensor dts nodes and fixups
Adds dts nodes and fixups for the fxos8700 sensor to the frdm_kw41z
board. Tested with samples/sensor/fxos8700

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 10:17:58 -06:00
Maureen Helm e27673a2f4 frdm_k64f: Add sensor dts nodes and fixups
Adds dts nodes and fixups for the fxos8700 sensor to the frdm_k64f
board. Tested with samples/sensor/fxos8700

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 10:17:58 -06:00
Maureen Helm 641aa5c58a dts: sensor: Add dts yaml bindings for the max30101 sensor
Adds dts yaml bindings for the max30101 sensor to allow the sensor
driver name, i2c driver name, and i2c address to be extracted from dts
instead of kconfig.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 10:17:58 -06:00
Maureen Helm fd8a9ae89c dts: sensor: Add dts yaml bindings for the fxas21002 sensor
Adds dts yaml bindings for the fxas21002 sensor to allow the sensor
driver name, i2c driver name, and i2c address to be extracted from dts
instead of kconfig.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 10:17:58 -06:00
Maureen Helm 88d5949b94 dts: sensor: Add dts yaml bindings for the fxos8700 sensor
Adds dts yaml bindings for the fxos8700 sensor to allow the sensor
driver name, i2c driver name, and i2c address to be extracted from dts
instead of kconfig.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 10:17:58 -06:00
Maureen Helm e92df9c01d samples: Build hts221 sensor sample only on supported boards
The hts221 sensor driver was implicitly made dependent upon the
disco_l475_iot1 board when it was converted to dts, so build the
associated sample only for this board. This issue was encountered when
adding sensor dts support to nxp boards, which don't have hts221.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-31 10:17:58 -06:00
Ramakrishna Pallala 301acb8e1b kernel: include: rename nano_internal.h to kernel_internal.h
Rename the nano_internal.h to kernel_internal.h and modify the
header file name accordingly wherever it is used.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-01-31 10:07:21 -06:00
Vinayak Kariappa Chettimada 7af9c7108f Bluetooth: controller: Fix for CPR with/without Feature Exchange
Fix implementation to support Connection Parameter Request
Procedure initiation with and without use of Feature
Exchange Procedure being performed in a connection.

Fixes LL.TS.5.0.2 conformance tests:
LL/CON/MAS/BV-81-C [Initiating Connection Parameter Request
	- Unsupported Without Feature Exchange]
LL/CON/MAS/BV-82-C [Initiating Connection Parameter Request
	- Unsupported With Feature Exchange]
LL/CON/SLA/BV-85-C [Initiating Connection Parameter Request
	- Unsupported Without Feature Exchange]
LL/CON/SLA/BV-86-C [Initiating Connection Parameter Request
	- Unsupported With Feature Exchange]

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-01-31 16:02:14 +01:00
Johan Hedberg 8fc4c99496 Bluetooth: Remove redundant AD parsing check
A few lines earlier the code bails out in case len is 0. Checking for
buf->len < 1 is the same as checking for buf->len == 0. Since len is
guaranteed to be > 0 here the check len > buf->len implicitly checks
for buf->len == 0, i.e. the second test can be removed.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-01-31 07:01:10 -08:00
Johan Hedberg 7ae78c9928 Bluetooth: Mesh: Fix segment transmission timeout
The timeout was hard-coded to 400ms, but the spec actually states:

"This timer shall be set to a minimum of 200 + 50 * TTL milliseconds."

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-01-31 06:59:49 -08:00
Johan Hedberg 1150858d8f Bluetooth: Mesh: Fix ack timeout calculation
The caculation was wrong since the value may be BT_MESH_TTL_DEFAULT,
i.e. 0xff, leading to much too large values.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-01-31 06:59:49 -08:00
Johan Hedberg fee8734874 Bluetooth: Mesh: Clear segment rx context when incomplete timer expires
https://www.bluetooth.org/errata/errata_view.cfm?errata_id=10321

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-01-31 06:59:49 -08:00
Johan Hedberg fde013b254 Bluetooth: Mesh: Take advantage of K_SECONDS macro
This makes the code slightly more readable.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-01-31 06:59:49 -08:00
Johan Hedberg a0ab6086e3 Bluetooth: Mesh: Fix ignoring old SeqAuth values
Replay protection is not enforced at the Lower Transport Layer, so it
is possible to get an old replayed segment here. In such a case
cleanly discard it instead of causing a valid existing transaction
from being discarded.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-01-31 06:59:49 -08:00
Michael Hope cff16051bb disk: delete the GET_DISK_SIZE IOCTL.
The argument is a u32_t which limits the maximum disk size to 4 GiB.
Rather than fix this, delete the ioctl and switch the only use to
GET_SECTOR_COUNT instead.

Signed-off-by: Michael Hope <mlhx@google.com>
2018-01-31 09:14:40 -05:00
Andrei Emeltchenko f3653b1a5c usb: Add sanitycheck configuration
Add configuration for sanitycheck for HID sample

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
Andrei Emeltchenko bab250a0e8 usb: samples: Add HID sample
Add simple USB HID sample device. Connecting to Linux registers as
input device, lsusb is able to show descriptors (unbinded from input)

...
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.10
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      32
          Report Descriptor: (length is 32)
            Item(Global): Usage Page, data= [ 0x01 ] 1
                            Generic Desktop Controls
            Item(Local ): Usage, data= [ 0x00 ] 0
                            Undefined
            Item(Main  ): Collection, data= [ 0x01 ] 1
                            Application
            Item(Global): Logical Minimum, data= [ 0x00 ] 0
            Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255
            Item(Global): Report ID, data= [ 0x01 ] 1
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Local ): Usage, data= [ 0x00 ] 0
                            Undefined
            Item(Main  ): Input, data= [ 0x82 ] 130
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Volatile
Bitfield
            Item(Global): Report ID, data= [ 0x02 ] 2
            Item(Global): Report Size, data= [ 0x08 ] 8
            Item(Global): Report Count, data= [ 0x01 ] 1
            Item(Local ): Usage, data= [ 0x00 ] 0
                            Undefined
            Item(Main  ): Output, data= [ 0x82 ] 130
                            Data Variable Absolute No_Wrap Linear
                            Preferred_State No_Null_Position Volatile
Bitfield
            Item(Main  ): End Collection, data=none
...

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
Andrei Emeltchenko f908387e9a usb: hid: Add macros for REPORT descriptor
Add macros for constructing HID Report Descriptors.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
Andrei Emeltchenko ad12038442 usb: hid: Use typedef for callbacks
Change to typedefs.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
Andrei Emeltchenko e8ccb16986 usb: hid: Add Human Interface Device (HID) class
Add support for Human Interface Device USB class.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
Andrei Emeltchenko 8f21a37861 usb: Clean up code to meet Zephyr standard
Add missing "{}" braces and remove unneeded "()" braces.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
Andrei Emeltchenko 60f8c6e272 usb: usbnet: Clean up code
Use common logging method and correct braces.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
Andrei Emeltchenko 17735e8a04 usb: netusb: Remove USB custom_handler()
Custom handler is not used, cleaning code.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
Andrei Emeltchenko 6e2e2dbb1b usb: msc: Clean up comment
Trivial cleaning

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-31 07:42:19 -05:00
Sebastian Bøe f5758b5d97 cmake: Fix dependencies between kobject_hash files
CMake's custom_command support is not great. It is technically
supported, but it is not easy to get it right.

As explained in "5. File-level dependencies of custom targets are not
propagated" from http://bit.ly/2GvwwEy. When a custom_command uses a
custom_target as input, the custom_command must DEPEND on both the
custom_target and the underlying file.

Longterm we need to do something more sofisticated to prevent these
issues from popping up. Like add some static analysis to detect badly
written CMake code or introduce an abstraction for custom commands
that is not affect by this issue.

This fixes #5881

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-31 05:54:19 -05:00
Michael Scott afb9830441 net: lwm2m: fix retransmit_request() pending process / packet send
During the CoAP API change, slight changes were made the ref / unref
packet pending process.  Let's re-align with the coap-client sample
in how we apply the packet refs in retransmit_request() and also
replace the lwm2m_send_message() call with a direct call of
net_app_send_pkt().  This avoids a second processing of the pending
packets and keeps the ref/unref flow cleaner.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-01-31 12:20:41 +02:00
Michael Scott db09596b1d net: lwm2m: correct packet pending process in lwm2m_send_message()
During the CoAP API change, the way packets were ref'd and then
unref'd in order to stop the packet sending functions from releasing
the net_pkts was changed and never updated in the LwM2M library.

Let's use coap_pending_cycle() and coap_pending_clear() to do the
ref/unref the same way as the coap-client samples in order to
match the pending process with the current CoAP APIs.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2018-01-31 12:20:41 +02:00
Vinayak Kariappa Chettimada d03ad43dbb Bluetooth: controller: Fix to restrict addr set in active scan
Fix controller implementation to only restrict HCI LE Set
Random Address command when advertising and/or active
scanning is enable.

Continues to pass the following LL.TS.5.0.2 conformance
test:
LL/SEC/SCN/BV-01-C [Random Address Scanning]

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2018-01-31 10:16:47 +01:00
Anas Nashif 44cab35004 boards: arc: default board with MPU enabled
em_starterkit_em7d has MPU enabled, so make it default for better test
coverage.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-30 21:05:24 -05:00
David B. Kinder 701bb2afba doc: fix misspellings in boards and samples docs
Fix misspellings found in board and sample docs missed during regular
reviews.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-01-30 20:27:43 -05:00
David B. Kinder 79e916542a doc: fix misspellings in doxygen API comments
Fix misspellings in API documentation derived from header files.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-01-30 20:04:21 -05:00
David B. Kinder baed5a59c7 doc: fix misspellings in Kconfig files
Fix misspellings in Kconfig files used for configuration docs.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-01-30 20:03:40 -05:00
Anas Nashif 4e2fcccc4c boards: make em_starterkit the defaule for ARC
When testing, make em_starterkit the default for sanitycheck to test new
features such as MPU.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-30 17:18:01 -05:00
Yannis Damigos a8a320c066 boards: disco_l475_iot1: Remove POLL dependency
We should enable CONFIG_POLL on application level when
we want to use SPI transceive_async() function.
This patch removes it from disco_l475_iot1 default
configuration.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-01-30 16:01:14 -05:00
Andrew Boie 578e6fdbb0 doc: user mode overview documentation
The existing docs immediately dive into the details without providing
the user with any kind of high level overview or description of the
threat model.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2018-01-30 10:32:39 -08:00
Maureen Helm afc78778d3 scripts: jlink: Do not mass erase flash by default
When adding support for the 'flash' command to the jlink runner, it was
not clear if the jlink commander would erase flash before programming,
therefore an explicit mass erase was implemented in the jlink runner as
a precaution and enabled by default.

The Segger folks later confirmed that the jlink commander does an
implicit erase of relevant flash sectors with the loadbin command,
therefore the explicit mass erase is not required.

Keep the mass erase option available in the jlink runner, but change the
default to false.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-01-30 11:09:06 -06:00
Ramakrishna Pallala 5155e68105 subsys: disk: Kconfig: add prompt messages for config options
Add prompt messages for config options dependent on DISK_ACCESS_FLASH

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-01-30 11:32:02 -05:00
Ramakrishna Pallala 275d16dc6c tests: Kconfig: add proper description to config option
Add proper description to the TEST_EXTRA_STACKSIZE config
option prompt message.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-01-30 11:32:02 -05:00
Anas Nashif 1fbc41b1e9 boards: 96b_carbon: add supported features
add i2c, spi and usb_device as supported feaures.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-30 09:01:18 -06:00
Alberto Escolar Piedras 2151b864d4 sanitycheck: fix crashes with symlinks in path
When building the testcase path, replace symlinks in path
with the realpath both in the testcase root and in ZEPHYR_BASE

For more info see issue #5772

Fixes: #5772

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-01-29 23:50:08 -05:00