Commit Graph

516 Commits

Author SHA1 Message Date
Peter Bigot d7049b57d5 samples: microbit: pong: update work API usage
Use the reschedule solution as there may be cases where a newer
deadline should supersede an older one.

The implementation has no locking and so has data races between the
handler and external events.  Emit a console diagnostic in one case
where the race can be detected.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-03-16 19:58:12 -04:00
Kumar Gala d521129c4f dma: Kconfig remove unused kconfig symbols
All dma drivers are devicetree based now so we can remove the last
bits of Kconfig associated with the old driver style.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-02 20:28:35 -06:00
Kumar Gala 774ea5ad5b samples: board: nrf: battery: Convert to use DEVICE_DT_GET
Replace device_get_binding with DEVICE_DT_GET for getting access
to the io-channels/adc controller device.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-03-02 11:28:30 -06:00
Johann Fischer 9f3b60ab60 samples: intel_s1000_crb: replace deprecated HID macros
Replace deprecated HID macros.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-02-28 16:50:24 -05:00
Sylvio Alves 7fe8b710a8 wifi: esp32: add board wifi station sample
add esp32 wifi station  board example

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2021-02-25 17:00:20 -05:00
Piotr Szkotak feccb8f59f samples: boards: nrf: ieee802154: Optimize power on nRF53
Add an overlay disabling UART in the prj.conf.

Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
2021-02-18 15:24:30 +03:00
Peter Bigot bdba2e63f6 samples: nrf: system_off: add RAM retention example for nRF52
Add an object to retain data across both reboots and entry to
SYSTEM_OFF.  This only works on nRF52, since nRF51 and nRF53 require
different low-level operations to configure RAM retention.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-02-17 14:34:31 +01:00
Jose Alberto Meza 93a8f5f10e samples: boards: mec15xxevb: pm: Enable PECI and KSCAN drivers
Enable PECI and KSCAN drivers to evaluate any side-effect
in LPM entry/exit and power consumption.

Signed-off-by: Jose Alberto Meza <jose.a.meza.arellano@intel.com>
2021-02-16 15:45:56 +03:00
Jedrzej Ciupis 2d4c13459e samples: boards: Add tests section to 802154_rpsmg sample
This commit adds tests section to sample.yaml file of the
ieee802154/802154_rpmsg sample.

Signed-off-by: Jedrzej Ciupis <jedrzej.ciupis@nordicsemi.no>
2021-02-15 08:10:19 -05:00
Czeslaw Makarski 560c78c388 samples: 802154_rpmsg: Add SL fault handler
This commit adds the nRF IEEE 802.15.4 Service Layer Fault Handler
to the 802154_rpmsg sample.

Signed-off-by: Czeslaw Makarski <Czeslaw.Makarski@nordicsemi.no>
2021-02-15 08:10:19 -05:00
Czeslaw Makarski 12bc964c9b samples: 802154_rpmsg: Remove redundant kconfig
This commit removes the obsolete hardcoded kconfig in the
802154_rpmsg sample.

Signed-off-by: Czeslaw Makarski <Czeslaw.Makarski@nordicsemi.no>
2021-02-15 08:10:19 -05:00
Flavio Ceolin 86a624e2a2 power: Remove PM_STATE_LOCK option
Simplify pm subsystem removing PM_STATE_LOCK option. Constraints API is
small and is a key component of power subsystem.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-02-15 08:08:36 -05:00
Flavio Ceolin 3f87c5a0f4 power: Rename constraint API
Replace pm_ctrl_* with pm_constraint.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-02-15 08:08:36 -05:00
Gerard Marull-Paretas 68344cd87c samples: boards: stm32: add backup SRAM sample
The sample illustrates how to define and use a variable in the backup
SRAM.

Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
2021-02-15 08:04:24 -05:00
Maciej Perkowski 3e1badaaac samples: tests: Fix sample.boards.nrf.nrfx test
The sample was failing twister test with a timeout because there was
no pass/fail criteria for it (nothing was tested). The fix adds
harness on consolse and some output that can be verified.

Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
2021-02-11 13:58:25 -05:00
Vincent Wan 41a726dac8 samples: cc13x2_cc26x2: system_off: force soft off state
In the last step of the example, the system should go into soft off
state in order to match the original intent in the example to go
into the hardware's SHUTDOWN mode.

Fixes #31727

Signed-off-by: Vincent Wan <vanti.coder@gmail.com>
2021-01-28 08:15:55 -05:00
Flavio Ceolin 321ce7fb77 power: Use substate-id in pm subsystem
Change subsystem to use struct pm_state with substate-id instead of
using only the power state category.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Flavio Ceolin d21808b0b1 power: Remove residency and states from Kconfig
Residency time and power states are defined using device tree now.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Flavio Ceolin 579f7049c7 power: Move pm subsystem to new power states
Migrate the whole pm subsystem to use new power states information
from power_state.h and get states and residency properties from
device tree.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-22 09:31:20 -05:00
Peter Bigot 08f4ce4efb samples: boards: nrf: add clock_skew
Provide a demonstration of using the timeutil skew infrastructure to
measure the relative error of the two clock sources on Nordic boards.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-20 16:38:56 -05:00
Andrzej Głąbek 253d2470f2 samples/boards/nrf/nrfx: Make the sample usable on all nRF SoCs
Conditionally use either DPPI or PPI channel in the sample so that
it can be built for all nRF SoCs. Update documentation accordingly.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-01-13 08:03:06 -05:00
Flavio Ceolin 2b49266861 power: Add notifier API
Get rid of weak functions adding a new API to register an object to
receive notifications when the system changes power state.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-01-07 12:40:19 -05:00
Watson Zeng 7a3f9c4e39 tests: add filter for some tests using newlib
some tests configured with CONFIG_NEWLIB_LIBC=y,
it's better to add a filter filter: TOOLCHAIN_HAS_NEWLIB == 1
in those tests yaml file.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-12-16 08:57:40 -05:00
Anas Nashif 5e4222749a power: pm_force_power_state -> pm_power_state_force
Rename API to be more consistent with guidelines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-09 15:18:29 -05:00
Anas Nashif e0f3833bf7 power: remove SYS_ and sys_ prefixes
Remove SYS_ and sys_ from all PM related functions and defines.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-09 15:18:29 -05:00
Anas Nashif dd931f93a2 power: standarize PM Kconfigs and cleanup
- Remove SYS_ prefix
- shorten POWER_MANAGEMENT to just PM
- DEVICE_POWER_MANAGEMENT -> PM_DEVICE

and use PM_ as the prefix for all PM related Kconfigs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-12-09 15:18:29 -05:00
Peter Bigot f13eb90705 samples: nrf: battery: fix reference to ADC node
The sample referenced the ADC through an alias that either never
existed or (more likely) has since been removed.  Use the node label
instead.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-27 20:26:45 -05:00
Martin Jäger 0d64d6668d samples: boards: pine64_pinetime: add sample.yaml
This adds the board to CI so that compile issues will be detected in
the future.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-11-17 16:37:28 -05:00
Martin Jäger 87caab43fc samples: boards: pine64_pinetime: Fix main.c
Constify device pointer and remove legacy int types to make it compile.

Signed-off-by: Martin Jäger <martin@libre.solar>
2020-11-17 16:37:28 -05:00
Peter Bigot 56048bb500 samples: add FP formatting to all samples that require it
Samples that include floating-point format specifications may need
cbprintf FP support.  Make sure it's available.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-11-17 14:44:59 -06:00
Hubert Miś 9ec8aec794 samples: boards: nrf: ieee802154: New serialization sample
A new sample exposing IEEE 802.15.4 radio controller using serialization
over IPM drivers.

Signed-off-by: Hubert Miś <hubert.mis@nordicsemi.no>
2020-11-17 09:56:25 +01:00
Stephane Dorre 83b77bd52c samples: Adapt Pinetime sample program
Adopt latest Zephyr syntax
Improve project configuration
Improve sample code

Signed-off-by: Stephane Dorre <stephane.dorre@gmail.com>
2020-11-11 13:28:11 +01:00
Rafa Couto ce9947c243 boards: pinetime_devkit0 basic sample.
Basic sample program that uses the one led and button from the Pinetime.
Led will turn on everytime the button is pushed.

Signed-off-by: Rafa Couto <caligari@treboada.net>
2020-11-11 13:28:11 +01:00
Maksim Masalski b2bd0a0608 samples: add capture output for the mec15xxevb_assy6853 pm sample
To make it runnable in the sanitycheck necessary to add
capture output, because that sample runs infinite period of time
and can not finished by itself. To avoid timeout error
in the sanitycheck I added capture output for a several times.
Also added one more tag to describe that it is a power
management sample.

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-11-09 16:08:04 -06:00
Trond Einar Snekvik ad2fd44d7a Bluetooth: Mesh: Encapsulate feature config
Moves mesh feature configuration to a separate module, deprecating the
bt_mesh_cfg_srv structure. The initial values for the features should
now be enabled through KConfig, where new config entries have been added
for each feature.

This removes the upward dependency on the config server from the core
stack, and makes the config server a pure frontend for the configuration
states, as all spec mandated behavior around the feature states is now
encapsulated.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-11-09 11:23:34 +02:00
Trond Einar Snekvik bf58c4e3a8 Bluetooth: Mesh: light_vnd sample: Remove button text
Removes text from the readme of the onoff_level_lighting_vnd_app
claiming buttons control the LEDs before provisioning, as it's not
accurate.

Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
2020-10-29 14:12:05 +02:00
Maksim Masalski 56c02e535d samples: change name for the mec15xxevb_assy6853 pm sample
Power management sample for that board has very
confusing name that should be changed to something
more understandable.
Current name sample.board.sample.board.mec15xxevb_assy6853
I suggest to have new name
sample.board.power_management.mec15xxevb_assy6853

Signed-off-by: Maksim Masalski <maksim.masalski@intel.com>
2020-10-21 07:58:03 -05:00
Xavier Chapron 824f423e54 misc: Replace assert include and calls by sys/__assert.h equivalent
Replace all calls to the assert macro that comes from libc by calls to
__ASSERT_NO_MSG(). This is usefull as the former might be different
depending on the libc used and the later can be customized to reduce
flash footprint.

Signed-off-by: Xavier Chapron <xavier.chapron@stimio.fr>
2020-10-02 11:42:40 +02:00
Emil Obalski ced6e606b2 usb: intel: Fix the sample, update to recent API change.
HID API has changed and now all usb HID callbacks require
pointer to device as a first parameter. This patch is fixing
regression issue.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-09-09 08:26:19 -04:00
Jennifer Williams e7eb428b01 samples: add missing sample.yaml files
Some samples were without sample.yaml. This adds
them.

Fixes #27813

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2020-09-03 09:49:28 -04:00
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00
Anas Nashif ec1a8377ab samples: intel_s1000: fix timeout variable
Fix timeout vairable on sample that was missed.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-09-01 21:25:52 -04:00
Peter Bigot 75f82dc09a samples: fix reStructuredText target directives
Without the leading underscore these are comments.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2020-08-28 12:54:40 +02:00
Anas Nashif dca317c730 sanitycheck: inclusive language
change whitelist -> allow.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2020-08-27 07:04:07 -04:00
Flavio Ceolin 0aaae4a039 guideline: Make explicit fallthrough cases
-Wimplicit-fallthrough=2 requires a fallthrough comment or a compiler
to tells gcc that this happens intentionally.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-08-24 20:28:47 -04:00
Emil Obalski 80a89ef799 console: usb: Remove obsolete Kconfig option.
This patch removes unused Kconfig option from console
subsystem. If application wants to wait until the console
port is connected, enabled and ready to receive data
it should use uart_line_ctrl_get() API function and
check for DTR flag.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-08-13 11:49:47 +02:00
Emil Obalski b552e60765 samples: usb: Make USB console samples call usb_enable()
usb_enable() must be called once by the application.
The application may want to register usb_dc_status_callback
and trace usb status codes (usb_dc_status_code).

After this patch all pre APPLICATION messages will be dropped
as USB console device is enabled in the application.

Application waits for console device until its ready by checking DTR
flag - uart_line_ctrl_get(). This function could be dropped but then
some log messages that were generated before USB device is ready
could also be dropped.

Signed-off-by: Emil Obalski <emil.obalski@nordicsemi.no>
2020-08-13 11:49:47 +02:00
Marcin Niestroj aad7e7b512 samples: nrf: onoff_level_lighting_vnd_app: build with mcumgr
There is an additional prj_smp_svr.conf configuration file provided,
which builds an image with mcuboot support. Enable it in sample.yaml,
so sanitycheck can detect build failures in future.

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-08-06 11:54:54 +02:00
Marcin Niestroj d7d1c4a58f samples: nrf: onoff_level_lighting_vnd_app: fix build with mcumgr
There is an optional mcumgr enabled prj_smp_svr.conf configuration
file. Using it results in following errors:

  .../src/smp_svr.c:12:10: fatal error: mgmt/buf.h: No such file or \
  directory
     12 | #include <mgmt/buf.h>
        |

Fix include paths to keep sample buildable with mcumgr enabled.

Fixes: c200b1c5e6 ("mgmt: Move mcumgr into its own folder")
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2020-08-06 11:54:54 +02:00
Joakim Andersson 6e2ffd28d0 samples: smp_svr: Fix configuration when BT_HCI_ACL_FLOW_CONTROL is on
Fix smp_svr Bluetooth configuration for when BT_HCI_ACL_FLOW_CONTROL
option has been enabled. In this case the CONFIG_BT_L2CAP_RX_MTU
is used instead of CONFIG_BT_RX_BUF_LEN to set the RX MTU.
This lead to a negotiated MTU of 23, which is not supported by
the SMP_SVP protocol.

Removed the board specific configuration files as these are just
duplications of the overlay-bt.conf or overlay-bt-tiny.conf and
the readme specifies how these should be used.

Reduced the TX MTU to end up with the same value as the RX MTU,
CONFIG_BT_RX_BUF_LEN - 4 (HCI ACL header) - 4 (L2CAP header).

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2020-08-06 11:46:48 +02:00