Commit graph

462 commits

Author SHA1 Message Date
Carles Cufi e5df55e1c1 samples: micro:bit: Convert pong sample to new GPIO API
Convert to the new GPIO API, tested on bbc:microbit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Carles Cufi 51b9c6ed9c samples: micro:bit: Convert sound sample to new GPIO API
Convert to the new GPIO API, tested on bbc:microbit.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-02-05 12:00:36 +01:00
Daniel Leung be8ca9da96 samples: up_squared/gpio_counter: update to new GPIO API
Update the gpio_counter sample app for the UP Squared board:
() Update configuration calls to use new flags.
() Separate pin configuration into setting it to input, and
   setting the pin for interrupt.
() Use gpio_pin_set() instead of gpio_pin_write().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-02-05 12:00:36 +01:00
Armando Visconti 3bb513bf2a sample/board: sensortile_box: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Armando Visconti 692996dd00 sample/board: 96b_argonkey: update to use new GPIO API
Get rid of all the deprecated functions and definitions
replacing them with the new ones.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2020-02-05 12:00:36 +01:00
Peter A. Bigot d715fbba63 samples: boards: nrf: add battery measurement sample
Use the voltage divider devicetree binding to demonstrate measurement
of battery voltage for two Nordic-based boards that have the necessary
circuitry.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2020-02-03 16:26:51 +01:00
Ulf Magnusson 6608beaaaa console: kconfig: Do not assign promptless CONSOLE_HAS_DRIVER
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.

These configuration files all enable UART_CONSOLE, which selects
CONSOLE_HAS_DRIVER.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2020-01-14 15:42:33 +01:00
Henrik Brix Andersen db611e6781 drivers: pwm: add support for inverted PWM signals
Add support for requesting an inverted PWM pulse (active-low) when
setting up the period and pulse width of a PWM pin. This is useful
when driving external, active-low circuitry (e.g. an LED) with a PWM
signal.

All in-tree PWM drivers is updated to match the new API signature, but
no driver support for inverted PWM signals is added yet.

All in-tree PWM consumers are updated to pass a flags value of 0
(0 meaning default, which is normal PWM polarity).

Fixes #21384.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-01-07 18:13:18 +01:00
Daniel Leung e78704251b samples: intel_s1000_crb/audio: fix return for non-void function
The usb_transport_init() does not return a value when it fails to
initialize the USB device. So add a return value there.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-01-07 17:09:38 +01:00
Nick Ward b5f335b11b mcumgr: BT SMP transport config for authenticated requirement
This commit introduces a new Kconfig symbol MCUMGR_SMP_BT_AUTHEN.
When selected it configures the Bluetooth mcumgr transport to require
an authenticated connection.

If the Bluetooth mcumgr transport is selected then this new symbol is
selected by default.  Bluetooth SMP is also selected to ensure Zephyr
is configured with Bluetooth security features enabled to provide
Bluetooth authentication APIs to the user's app.  Users can choose to
disable this level of security for the Bluetooth mcumgr transport if
they do not require it.

Fixes #16482

Signed-off-by: Nick Ward <nix.ward@gmail.com>
2019-12-20 20:28:39 -05: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
Ulf Magnusson 984bfae831 global: Remove leading/trailing blank lines in files
Remove leading/trailing blank lines in .c, .h, .py, .rst, .yml, and
.yaml files.

Will avoid failures with the new CI test in
https://github.com/zephyrproject-rtos/ci-tools/pull/112, though it only
checks changed files.

Move the 'target-notes' target in boards/xtensa/odroid_go/doc/index.rst
to get rid of the trailing blank line there. It was probably misplaced.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-12-11 19:17:27 +01:00
Vikrant More 5af5407570 samples: mesh: nrf52: added some preprocessor directive
Added some preprocessor directive so that code get compile
for some more nRF52 boards which has only one LED & one button.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More b80b359955 samples: mesh: nrf52: minor improvement in MOVE msg handlers
Changes in MOVE message handler are  as per Mesh Model
Specification which says:

"Upon receiving a Generic Move Set message, the Generic Level
Server shall respond with a Generic Level Status message.
The target Generic Level state is the upper limit of the
Generic Level state when the transition speed is positive,
or the lower limit of the Generic Level state
when the transition speed is negative."

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More 102d402fc5 samples: mesh: nrf52: added some more macros support
Added some more macros support.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More c4edc2d78b samples: mesh: nrf52: removed redundant global variable
Removed global variable 'default_tt' & code depend on it
which is redundant as per latest implementation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More 13a5addffa samples: mesh: nrf52: corrected sequence of get & publish messages
Corrected sequence of execution of get & publish messages.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More f8c03d79f6 samples: mesh: nrf52: added separate update_vnd_led_gpio()
Added sepate function update_vnd_led_gpio().

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More c97e872e7d samples: mesh: nrf52: used constrain functions whereever possible
Added support of constrain_temperature() function.
Used constrain_lightness() & constrain_temperature()
whereever possible.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More ff323ce0e8 samples: mesh: nrf52: separately save default & last target values
Separately saved default & last target values of lightness,
temperature & delta_uv on flash (using settings layer).

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More 5ad88281b0 samples: mesh: nrf52: rename enum attributes
Rename attributes in enum state_binding.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More 89a0986dff samples: mesh: nrf52: implementation based on single pointer
Implement thing based on single struct light_ctl_state pointer
in entire Application.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Vikrant More b5ebc66889 samples: mesh: removed redundant code, blank lines & comments
Removed redundant code, unnecessary blank lines & comments.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-12-11 12:52:17 +02:00
Kumar Gala 24ae1b1aa7 include: Fix use of <misc/FOO.h> -> <sys/FOO.h>
Fix #include <misc/FOO.h> as misc/FOO.h has been deprecated and
should be #include <sys/FOO.h>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-12-10 08:39:37 -05:00
Peter Bigot e83b079e22 samples: nrf52: replace power_mgr with system_off
The Nordic SOC doesn't support multiple system power states, only one
deep sleep state.  Replace the old example with a simpler one that can
be used to measure CPU active, normal sleep, and system off modes.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-12-09 16:33:03 -05:00
Anas Nashif 70758c4374 tests: fix test identifiers
The seasonal overhaul of test identifiers aligning the terms being used
and creating a structure. This is hopefully the last time we do this,
plan is to document the identifiers and enforce syntax.

The end-goal is to be able to generate a testsuite description from the
existing tests and sync it frequently with the testsuite in Testrail.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-12-09 15:53:44 -05:00
Jennifer Williams 6c2d25204c samples: boards: Add readme for gpio counter.
This adds a README.rst for the UP Squared board GPIO counter sample
using details in the application source code and giving context.
This offers overview, requirements, and instructions to build and
flash, in complement to the cited reference.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2019-12-09 12:45:04 -05:00
Aurelien Jarno a5c53ff3ae samples: mesh_badge: fix temperature format
The sensor API returns the temperature in celsisus degree. The Bluetooth
temperature characteristics uses M = 1, d = -2, b = 0, which corresponds
to a resolution of 0.01 degree. This means that the value returned by
sensor_value_to_double has to be multiplied by 100.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-12-09 11:51:46 -05:00
Aurelien Jarno 0e11d1385b samples: mesh_badge: fix property ID
The mesh_badge sample uses a GATT Characteristic instead of a Mesh
Device Property to report the temperature. In addition to that the
status message is filled with with a GATT Unit instead of a the Mesh
Device Property.

Fix that by reporting a Present Device Operating Temperature, ie 0x0054
instead. This has the advantage of keeping the an s16t value to report
the temperature. This however change the marshalled format from B to A.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-12-09 11:51:46 -05:00
Aurelien Jarno 1ac90bf47e samples: mesh_badge: fix unknown sensor status message
When the value of an unknown sensor property ID is requested, the length
field should represent the value of zero, as explain in the comment in
sens_unknown_fill. However the marshalled representation of a zero
length is wrong in the code. The format A uses a 1-based uint4 length
value, so the range 0x0–0xF represents the range 1-16. The zero length
is represented by format B using the 0x7F value.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2019-12-09 11:51:46 -05:00
Andrzej Głąbek d3ea66d493 samples: boards: Merge nrf91/ with nrf52/ and rename it to nrf/
The following samples:
- boards/nrf91/nrfx
- boards/nrf52/power_mgr
are actually not specific to nRF91 and nRF52 Series SoCs, respectively,
hence the current naming of the above board/ subdirectories may be
misleading. Thus, use nrf/ directory for holding all nRF board specific
samples that apply to several boards.

Paths to the moved samples that are mentioned in their documentation
are also updated accordingly.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-12-09 16:10:19 +01:00
Vikrant More 459e05b103 samples: mesh: nrf52: corrected & improved transition implementation
Corrected & improved transition implementation so that
no_transition_work thread will not get triggered twice at the
end of transition.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-26 11:03:23 +02:00
Vikrant More c7f83f3865 samples: mesh: nrf52: improved comment
Improved comment content.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-26 11:03:23 +02:00
Vikrant More cbd0d6e847 samples: mesh: nrf52: added some Kconfig
Added some Kconfig which could help to improve Mesh
performance or Debugging.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-26 11:03:23 +02:00
Vikrant More aab640698b samples: mesh: nrf52: considered delay even in case of inst. transition
User can set transition time as Zero & delay as non-zero value.
In that case, we have to depend upon timer.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-26 11:03:23 +02:00
Armando Visconti 8d32c2ce84 samples/96b_argonkey: Add a note in microphone test README file
It is important to clarify when to launch audio capture command in
order to avoid that initial boot characters enter into the audio
file leading to bad initial data.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-11-19 07:29:34 -05:00
Vikrant More d2737d5fac samples: mesh: nrf52: coding style improvements
Corrected spellings in printk messages plus removed
unnecessary blank lines.

In case of Gen. Move client's message to Server, reduced
values of delta & transition time to improve demonstration.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-14 14:24:29 +02:00
Vikrant More 8dabf77f08 samples: mesh: nrf52: increased main stack size
Increased main stack size. This will solve issue mentioned at
https://github.com/zephyrproject-rtos/zephyr/issues/19685 which
is only related to onoff_level_lighting_vnd_app.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-14 14:24:29 +02:00
Daniel Leung 7cb9286895 samples: intel_s1000_crb: set CONFIG_NEWLIB_LIBC for math.h
Including math.h requires Newlib so enable it in project
configuration file.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-11-13 06:26:10 -06:00
Daniel Leung eca4d69f02 samples: intel_s1000_crb: fix no return on non-void func error
There are compiler error about the entry functions of two threads
not returning anything. So add return statement to fix it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-11-13 06:26:10 -06:00
Daniel Leung 66aefdbb93 samples: intel_s1000/i2s: fix uninitialized use warning
One of the return variable is declared and used, but never
assigned values. So fix it.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-11-13 06:26:10 -06:00
Vikrant More 235f5654d1 samples: mesh: nrf52: removed unnecessary global vaiable
Removed unnecessary global variable & replaced them with different
variable defined in struct light_ctl_state.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-13 11:29:14 +02:00
Vikrant More fb439fd98b samples: mesh: nrf52: corrected Gen. move msg handler implementation
Corrected Generic Move (Level) message handler implementation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-13 11:29:14 +02:00
Vikrant More 3bc931996d sample: mesh: nrf52: coding style improvement
Adjusted lines which are crssing limit of 80 characters to remove
check Warnings.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-13 11:29:14 +02:00
Vikrant More 3ed87e46fa samples: mesh: nrf52: removed redundant coding
Removed redundant coding which was related to old implementation.
Now Server will publish the new state information to the model’s Publish
Address only when there is mismatch between target & current values.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-13 11:29:14 +02:00
Vikrant More 6aaddb9922 sample: mesh: nrf52: complete inst. transition without timer
If transition time (tt) estimated equal to zero then transition
get completed without using timer.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-13 11:29:14 +02:00
Vikrant More 0bf0eb7f76 samples: mesh: nrf52: Simplified implementation
Create single structure of light_ctl_state & simplified
state binding algorithm.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-11-13 11:29:14 +02:00
Andrzej Głąbek 76da963107 samples/boards/nrf91/nrfx: Align implementation with nrfx 2.0.0
Complement GPIOTE HAL function calls with the NRF_GPIOTE parameter.
Update nrfx_gpiote_init() function call with the newly introduced
parameter.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-11-08 14:54:12 +01:00
Anas Nashif 7984f6c363 drivers: gpio: remove altera gpio driver
Remove unsupported driver.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-11-06 10:56:41 -05:00
Song Qiang 85a0cc8f9a boards: arm: 96b_argonkey: Update dma defconfig for tests
Previous defconfig for dma is DMA_STM32F4X in this board, while the new
generic driver uses DMA_STM32 to enable DMA support, and also dma driver
of stm32 now needs HEAP_MEM_POOL_SIZE to be big enough to hold dma
stream instances.

Additional .conf files are added for also adding HEAP_MEM_POOL_SIZE
configuration to two test cases.

Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
2019-11-06 14:14:39 +01:00
Armando Visconti 4592be1664 sample/board: sensortile_box: add lis2md support
Add code to test lis2mdl magnetometer sensor.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-11-05 15:42:00 -06:00
Marcin Szymczyk d9611be72d samples: boards: nrf91: add nrfx sample
Adds a sample that shows how to use nrfx drivers in Zephyr.

Signed-off-by: Marcin Szymczyk <marcin.szymczyk@nordicsemi.no>
2019-11-03 13:00:37 +01:00
Johann Fischer 39708536ba samples: mesh_badge: allow to build for any version of the reel board
Allow to build sample for any version of the reel board.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-10-23 20:58:19 -04:00
Johann Fischer 20a118b90c samples: mesh_badge: do not use edge led
Edge LED will be configured as pwm led,
do not use it in the mesh_badge sample.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-10-23 20:58:19 -04:00
Johan Hedberg 5537181e1a Bluetooth: Fix missing includes for hci.h
With the changes in PR #19836 applications now need to explicitly
include hci.h to use defines from it. Fix two sample/tests apps which
were missing this.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-10-17 19:05:33 +03:00
Vikrant More f198258a8b samples: mesh: nrf52: removed redundunt code
Remove redundant code as per latest implementation.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-10-17 12:31:35 +03:00
Vikrant More 4d55fa50c5 samples: mesh: nrf52: amendment in States restoration implementation
For Genric OnPowerUp equal to 0x02 (Restore):
If a transition was in progress when powered down, the element
restores the target state when powered up. Otherwise the element
restores the state it was in when powered down.

This commit implements above mentioned logic.

Signed-off-by: Vikrant More <vikrant8051@gmail.com>
2019-10-17 12:31:35 +03:00
Armando Visconti 1c9840c420 samples/96b_argonkey: microphone: (FIX) stop dmic trigger
Stop the trigger (DMIC_TRIGGER_STOP) after acquiring microphone data

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-10-16 13:05:55 -05:00
Kamil Piszczek 366cf363b2 samples: migrating to NVS backend with settings
Bluetooth samples now use the NVS backend for Settings.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-10-11 14:55:24 +02:00
Peter Bigot 6e5db350b2 coccinelle: standardize k_sleep calls with integer timeouts
Re-run with updated script to convert integer literal delay arguments to
k_sleep to use the standard timeout macros.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-09 08:38:10 -04:00
David B. Kinder 82d6347355 doc: fix broken file and zephyr-app refs
found some references to files (via :zephyr_file: and :zephyr-app:) that
were moved, so the links were broken

Fixes: #19660

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-10-08 15:42:32 -05:00
Andrzej Głąbek 5239bef610 drivers: pwm_nrf5_sw: Remove PWM_NRF5_SW_0_DEV_NAME Kconfig option
This option determines the name under which the device represented by
the `sw_pwm` node is registered in the system. But when the value of
this option does not match the `label` property of the `sw_pwm` node,
a problem arises when the `sw_pwm` node is referenced by a "pwm-leds"
compatible node, since the `*_PWMS_CONTROLLER` macro that is generated
for this referencing node contains a non-existing device name (as it is
the `label` property value, not the Kconfig option value).
This commit solves the issue described above by removing the Kconfig
option and replacing all of its occurrences in sample applications
by the standard macro generated for the `sw_pwm` node, containing
the value of the `label` property of this node.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-10-04 17:21:32 +02:00
Peter Bigot ab91eef23b coccinelle: standardize kernel API timeout arguments
Use the int_literal_to_timeout Coccinelle script to convert literal
integer arguments for kernel API timeout parameters to the standard
timeout value representations.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2019-10-03 11:55:44 -07:00
Charles E. Youse dc8b3b1094 samples/board/x86_info: move to tests directory
This application's primary purpose is to provide some useful data to
the author of an x86 board support package for Zephyr-- it's not a
good sample.  It's not a good test either, but as a test it at least
prevents regressions in multiboot/ACPI builds.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse 7637571871 arch/x86: rename CONFIG_X86_ACPI and related to CONFIG_ACPI
ACPI is predominantly x86, and only currently implemented on x86,
but it is employed on other architectures, so rename accordingly.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse 200056df2f arch/x86: rename CONFIG_X86_MULTIBOOT and related to CONFIG_MULTIBOOT
Simple naming change, since MULTIBOOT is clear enough by itself and
"namespacing" it to X86 is unnecessary and/or inappropriate.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse 2cf52476ea arch/x86: add support for non-trivial memory maps
x86 has more complex memory maps than most Zephyr targets. A mechanism
is introduced here to manage such a map, and some methods are provided
to populate it (e.g., Multiboot).

The x86_info tool is extended to display memory map data.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse a414eb99cc samples/boards/x86_info: add platform information tool
This sample demonstrates basic use of the x86 multiboot and ACPI
systems, and also provides some useful information about the board
it's booted on: data handed over by the multiboot loader (which is
either QEMU or GRUB at this point), basic APIC CPU topology, and
timer driver frequency (computed empirically).

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-29 12:30:34 -07:00
Charles E. Youse ce46e0df4d cmake: samples/tests: update cmake_minimum_required() to 3.13.1
Some samples/tests are still referring to 3.8.x versions.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-09-27 23:09:24 -04:00
Andrzej Głąbek c24c463328 soc: nordic: Include <nrfx.h> instead of <nrf.h> from <soc.h>
This change is done so that there is no need to additionaly include
<nrfx.h> before <soc/nrfx_coredep.h> (what might be a bit surprising)
and so that <nrfx_config.h> doesn't need to be include separately for
nRF SoCs requiring a special mapping of peripheral accessing symbols.

This commit removes also no longer needed inclusions and updates
the hal_nordic module with required minor correction of nrfx_glue.h.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-09-24 16:20:16 +02:00
Luiz Augusto von Dentz 03b9ce487c Bluetooth: GATT: Add support to setting permission on CCCD
This adds support to set different permissions to CCCD so security can
be checked when enabling notification which conforms to:

BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 3, Part G page 2360:

  '3.3.3.3 Client Characteristic Configuration

   Authentication and authorization may be required by the server to
   write the configuration descriptor.'

In addition to that also ensure that notification are not re-enabled
until the proper security level is reached to conform to the following
statement:

  '10.3.1.1 Handling of GATT indications and notifications

   A client “requests” a server to send indications and notifications
   by appropriately configuring the server via a Client Characteristic
   Configuration Descriptor. Since the configuration is persistent
   across a disconnection and reconnection, security requirements must
   be checked against the configuration upon a reconnection before
   sending indications or notifications. When a server reconnects to a
   client to send an indication or notification for which security is
   required, the server shall initiate or request encryption with the
   client prior to sending an indication or notification. If the client
   does not have an LTK indicating that the client has lost the bond,
   enabling encryption will fail.'

Fixes #17983

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-09-19 21:12:39 +03:00
Erwin Rol a720d38f29 samples: olimex_stm32_e407: fix coverity warning
Fix a Coverity warning when using %d to print the result
of a sizeof(...)

Since the result of the sizeof() use in the example
will always fit in a int, simply cast the result
to a int so the %d is always correct.

Fixes: #18373

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2019-09-19 11:07:57 -05:00
Armando Visconti af0e2c5df9 sample/board: add SensorTile.box sample for testing
Add sample to test SensorTile.box board.

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2019-09-19 09:47:45 -05:00
Ulf Magnusson 2481a12529 samples: intel_s1000: Simplify code and fix pylint warning
Empty sequences in Python are falsy, so

    if len(config_file) != 0:

can be simplified to

    if config_file:

pylint warning:

    C1801: Do not use `len(SEQUENCE)` to determine if a sequence is
    empty (len-as-condition)

Simplify the code a bit with os.path.join(), which indirectly gets rid
of the warning. os.path.join('', 'foo') returns 'foo', so things work
out when os.path.basename() returns '' (no directory) as well.

I'm getting rid of pylint warnings for a CI check.

Also replace a '== None' with 'is None', which is more common.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-09-07 08:13:02 -04:00
Carles Cufi afcbc9992c doc: Use west everywhere to build and flash
Instead of having a mix of west and CMake/ninja instructions for
building and flashing, document it using only west. This will help
clarify that west is the default build tool in Zephyr and should also
reduce confusion over what tool to use.
Note that the biggest change is changing the default in
doc/extensions/zephyr/application.py for :tool:, from all to west.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-08-27 19:36:24 +02:00
Anas Nashif 45326cff1c samples: arc_secure_services: fix harness
Fix sample on nsim simulator and add console harness to evaluate output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-08-27 09:56:38 -04:00
Joakim Andersson 1fb68828ef Bluetooth: SMP: Add pairing failed reason
Forward the pairing failed SMP status code to the application

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-26 13:12:49 +02:00
Luiz Augusto von Dentz 5f3595e47c Bluetooth: GATT: Fix using variable size storage for CCC
This removes the necessity of registering the storage for CCC and make
it part of the declaration itself.

Fixes #18547

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-08-22 15:14:39 +03:00
Johann Fischer bd72ea1df9 samples: mesh_badge: fix font size
The order of the fonts in ROM has changed.
Since the sorting is not wrong, correct the
order in the application.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-08-20 16:18:02 +02:00
Wayne Ren 5a0acd5105 samples: add sample to show how ARC TEE works
* this is a simple sample to show how
 secure applicaiton and non-secure application work
 together. More details are in README.rst

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
2019-08-10 17:45:22 +02:00
Joakim Andersson c1a754f665 Bluetooth: Host: Print error codes in hex
Error codes are listed in header files and in the core spec as hex
values. Always print them in hex in debug for easier error code
checking.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-08-05 12:18:17 +02:00
Anas Nashif ffaba63b10 boards: remove arduino 101 and related boards
This board and SoC was discontinued some time ago and is currently not
maintained in the zephyr tree.
Remove all associated configurations and variants from the tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-07-29 21:30:25 -07:00
Maksim Masalski 9901d8cf4b samples: sample modified according to the changes in Zephyr macros
main.c file changes
1. Renamed <board.h> to <device.h>
2. <misc/printk.h> now is inserted into <sys/printk.h>
3. <i2c.h> and <gpio.h> now are inserted into
<drivers/i2c.h> and <drivers/gpio.h>
4. Deleted <errno.h> because it is not using
5. Deleted <pwm.h> because it is not using
6. Deleted <display/mb_display.h> because it is not using
in that project (legacy from old project).
7. Now we use the following commands to rename any
SW._GPIO_{CONTROLLER,PIN,FLAGS} to
DT_ALIAS_SW._GPIOS_{CONTROLLER,PIN,FLAGS} ,
so renamed SW0_GPIO_CONTROLLER to DT_ALIAS_SW0_GPIOS_CONTROLLER

prj.conf file changes
1. Deleted CONFIG_SYS_CLOCK_TICKS_PER_SEC=250
because apps shouldn't set tick rate.

Made a line follower robot sample using DFRobot Maqueen chassis
for micro:bit board. Deleted unused files.

Signed-off-by: Maksim Masalski <maxxliferobot@gmail.com>
2019-07-18 15:16:06 +02:00
Sathish Kuttan 3d32acf376 samples: intel_s1000: update sample audio app doc
Update to documentation for the sample audio application running
on Sue Creek S1000 board from Intel.
Added section on how to control the audio application on target
from a Linux host and updated the console output section
accordingly.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan a4c3de16f2 samples: intel_s1000: script to control from host
Add python script and associated configuration YAML file
to control audio sample application running on
Intel Sue Creek S1000 from a Linux host.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan 192ca06a9e samples: intel_s1000: add files to cmake build
Add tuning driver, audio block processing threads,
background processing thread and USB transport driver
to the cmake build in audio sample app.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan dff993ba11 samples: intel_s1000: update project configration
Add USB HID configurations to the audio sample app project
configuration.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan c3bf362c28 samples: intel_s1000: tuning commands in audio app
Add processing of sample tuning commands in the audio
sample app.
Add audio processing stubs.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan 47e2e624c8 samples: intel_s1000: track status of audio app
Add a status check to start/stop audio in order to start
audio only if it's not already running and to stop audio
only if it is running.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan 75ff541a01 samples: intel_s1000: add background thread
Add background thread in audio sample app for
Intel® Sue Creek S1000 board

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan a2f1ad41e8 samples: intel_s1000: audio processing threads
Add processing threads for small/large audio blocks
in audio sample app for Intel® Sue Creek S1000 board

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan 881971ad26 samples: intel_s1000: tuning driver for audio app
Add a tuning interface driver to send receive tuning/control
commands over a USB transport.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Sathish Kuttan 3adf7e034e samples: intel_s1000: USB control for audio sample
Add USB transport driver to control the sample application
from a host connected to Intel® Sue Creek S1000 board
via an USB interface.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-07-05 10:13:51 -04:00
Johann Fischer fc57ea8d3c drivers: ssd1673: rename driver to ssd16xx
ssd1673 driver supports different controllers,
rename it to more generic ssd16xx.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2019-07-04 07:27:09 -04:00
Andy Ross f288d1e4a7 tests: samples: Apps shouldn't set tick rate
Tick rate is becoming a platform tunable in the tickless world.  Some
apps were setting it due to requirements of drivers or subsystems (or
sometimes for reasons that don't make much sense), but the dependency
goes the other way around now: board/soc/arch level code is
responsible for setting tick rates that work with their devices.

A few tests still use hard-configured tick rates, as they have
baked-in assumptions (like e.g. "a tick will be longer than a
millisecond") that need to be addressed first.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-02 22:52:29 -04:00
Kumar Gala db167c606d dts: Rename LED._GPIO_* -> DT_ALIAS_LED._GPIOS_*
We use the following commands to rename any
LED._GPIO_{CONTROLLER,PIN,FLAGS} to
DT_ALIAS_LED._GPIOS_{CONTROLLER,PIN,FLAGS}

git grep -l LED._GPIO_CONTROLLER | xargs sed -i 's/LED\(.\)_GPIO_CONTROLLER/DT_ALIAS_LED\1_GPIOS_CONTROLLER/g'
git grep -l LED._GPIO_PIN | xargs sed -i 's/LED\(.\)_GPIO_PIN/DT_ALIAS_LED\1_GPIOS_PIN/g'
git grep -l LED._GPIO_FLAGS | xargs sed -i 's/LED\(.\)_GPIO_FLAGS/DT_ALIAS_LED\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-02 08:26:37 -04:00
Johan Hedberg 0d9dab300e Bluetooth: Introduce separate pool for discardable events
Introduce a separate buffer pool for events which the HCI driver
considers discardable. Examples of such events could be e.g.
Advertising Reports. The benefit of having such a pool means that the
if there is a heavy inflow of such events it will not cause the
allocation for other critical events to block and may even eliminate
deadlocks in some cases.

Also update all mesh samples not to specify explicit RX buffer counts
anymore. Instead, create appropriate defaults in Kconfig so that we
only need to override this in the app for cases like the bbc:microbit
with limited memory.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-07-01 16:36:15 +03:00
Kumar Gala 284bc9d964 dts: Rename SW._GPIO_* -> DT_ALIAS_SW._GPIOS_*
We use the following commands to rename any
SW._GPIO_{CONTROLLER,PIN,FLAGS} to
DT_ALIAS_SW._GPIOS_{CONTROLLER,PIN,FLAGS}

git grep -l SW._GPIO_CONTROLLER | xargs sed -i 's/SW\(.\)_GPIO_CONTROLLER/DT_ALIAS_SW\1_GPIOS_CONTROLLER/g'
git grep -l SW._GPIO_PIN | xargs sed -i 's/SW\(.\)_GPIO_PIN/DT_ALIAS_SW\1_GPIOS_PIN/g'
git grep -l SW._GPIO_FLAGS | xargs sed -i 's/SW\(.\)_GPIO_FLAGS/DT_ALIAS_SW\1_GPIOS_FLAGS/g'

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-07-01 07:14:36 -05:00
Anas Nashif efb8df5366 cleanup: include/: move misc/stack.h to debug/stack.h
move misc/stack.h to debug/stack.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00