Commit graph

525 commits

Author SHA1 Message Date
Anas Nashif da5f185e06 samples: add test identifier
Add unique identifier instead of just 'test' for samples.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-03-29 17:44:11 -04:00
Patrik Flykt 21358baa72 all: Update unsigend 'U' suffix due to multiplication
As the multiplication rule is updated, new unsigned suffixes
are added in the code.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Patrik Flykt 24d71431e9 all: Add 'U' suffix when using unsigned variables
Add a 'U' suffix to values when computing and comparing against
unsigned variables.

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2019-03-28 17:15:58 -05:00
Cinly Ooi 097a71cbfe samples: watchdog: Confirm that reset occured
Updated test harness to check for a second instance of
"Watchdog sample application". This is to confirm the
board did reset itself.

Signed-off-by: Cinly Ooi <cinly.ooi@intel.com>
2019-03-28 09:35:30 -05:00
Erwan Gouriou 25d04049ce samples/drivers/counter: alarm: fix printk usage
When displaying int and u32_t, use %u instead of %d.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-03-26 07:29:08 -05:00
Flavio Ceolin 11abc64315 samples: can: Check return of can_attach_isr
Problem spotted by coverity, CID 195786

Fixes #14417

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2019-03-14 19:15:03 -05:00
Maksim Masalski b324f35e61 macros: deleted macros SECONDS(), MSEC(), USEC()
Changed everywhere these macros to the K_MSEC(), K_SECONDS()

Signed-off-by: Maksim Masalski <maxxliferobot@gmail.com>
2019-03-04 19:04:21 -05:00
Sebastian Bøe 4e5300ba7f cmake: Drop all in-tree usage 'set_conf_file'
Port all users of 'set_conf_file' to use the built-in rules
instead. This follows the convention-over-configuration principle to
make the system as a whole simpler and more consistent.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-03-01 09:44:09 +01:00
Kumar Gala bb6b1918b2 drivers: can: stm32: Cleanup Kconfig enablement
Follow the pattern we have for other peripherals in that if the driver
class (CAN) is enabled than enable the driver for that class
(CAN_STM32).  Also have the STM32 CAN driver depend on being on a STM32
SoC.

Remove setting of CONFIG_CAN_STM32 in any .conf files as it will get set
of CONFIG_CAN is set/enabled.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-25 10:05:21 -06:00
Jukka Rissanen c478b5bb6e can: Rename can_msg and can_msg_filter structs
In order to follow the naming from Linux, change the name of
can_msg to zcan_frame, and can_msg_filter to zcan_filter.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-22 08:07:03 -05:00
Jukka Rissanen 58f3ae5334 can: Add Linux compatible frame and filter structs
Add new "struct can_frame" which is compatible with Linux so that it
is easier to port socket-can applications from Linux.
Rename existing can_filter to can_msg_filter so that the name will
not conflict with Linux compatible can_filter struct.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-02-22 08:07:03 -05:00
Krzysztof Chruscinski 3605e48c44 shell: Modify subcommands to use SHELL_STATIC_SUBCMD_SET_CREATE
It is planned to deprecate SHELL_CREATE_STATIC_SUBCMD_SET macro
which is replaced by SHELL_STATIC_SUBCMD_SET_CREATE.

Additionally, removed irrelevant comments about alphabetical
ordering which is no longer needed.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-02-20 07:31:35 -05:00
Kumar Gala 1f68831197 samples: Use DT_ prefix define for DT filters
Update the filters that are extracting info from DT to use a define that
has a DT_ prefix so its clear that its coming from DT_.  Also this lets
us remove any non-DT prefixed defines in the conf db.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-02-14 10:45:25 -06:00
Erwan Gouriou 50eff0bf33 samples/drivers/flash_shell: Add nucleo_f746zg to platform_whitelist
In order to enable build of stm32f7 flash driver in sanitytests,
add nucleo_f746zg to flash_shell platform whitelist.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-12 20:16:22 -05:00
Andy Ross 453ce6afb8 samples/drivers/counter/alarm: Fix YAML schema failure
On my build host (where apparently the Python has a different version
of yaml than CI) this test is producing schema faiulres from the YAML:

    E: samples/drivers/counter/alarm/sample.yaml: can't load (skipping):
       <SchemaError: error code 2: Schema validation failed:
     - Value 'None' is not of type 'str'.
       Path: '/tests/test/harness_config/regex/1'.: Path: '/'>

The bug seems to be that the regex must be a list of strings, and the
empty list element is being parsed as a python None.  Just remove,
presumably the intent was an empty string, which is a noop in a regex
anyway.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-02-12 20:15:32 -05:00
Anas Nashif f164b056b0 samples: fix alarm sample doc and inclusion
Fix reference for alarm sample and how it is included in the
documentation.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-02-07 16:14:00 -05:00
Erwan Gouriou da744314ca samples/drivers: Provides basic sample for counter alarm
Provide basic sample to exercise counter alarm API.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-02-07 16:14:00 -05:00
Marc Pignat 8b6204b7ae samples/drivers/led_apa102: add a sample for using APA102 LEDs strip
Add a sample demonstrating usage of the APA102 driver, heavily based
on led_ws2812. Tested on nucleo_l432kc with an Adafruit DotStar strip.

Signed-off-by: Marc Pignat <marc@absintheaudio.com>
2019-02-07 11:19:00 -06:00
Marc Pignat 9dba1feaf1 samples: rename led_apa102c sample to led_apa102c_bitbang
There is a apa102 driver, and an upcomming patch will provide a sample
for using it, but let's keep the bitbang version which is intersting.

Signed-off-by: Marc Pignat <marc@absintheaudio.com>
2019-02-07 11:19:00 -06:00
qianfan Zhao 634e482fe1 samples: watchdog: Remove stm32 iwdg sample
STM32 iwdg driver are convented to new API now, the old sample
are doesn't need again.

Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2019-02-01 19:16:59 -05:00
Kumar Gala 75d84ffd7a led: lp3943: Remove dts_fixup.h
Since the lp3943 led driver still supports both DTS and non-DTS
configuration, we update the code to use DT_<COMPAT>_<INSTANCE>
defines for the CONFIG_HAS_DTS_I2C case.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 09:09:36 -06:00
Kumar Gala 489cecd505 led: pca9633: Remove dts_fixup.h
Since the pca9633 led driver still supports both DTS and non-DTS
configuration, we update the code to use DT_<COMPAT>_<INSTANCE>
defines for the CONFIG_HAS_DTS_I2C case.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 09:09:36 -06:00
Kumar Gala be0d753721 led: lp5562: Remove dts_fixup.h
Since the lp5562 led driver still supports both DTS and non-DTS
configuration, we update the code to use DT_<COMPAT>_<INSTANCE>
defines for the CONFIG_HAS_DTS_I2C case.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-31 09:09:36 -06:00
Kumar Gala 003bdb5fb6 led_strip: lpd880x: Add Device Tree support
Convert the lpd880x driver to use device tree and new DT_<COMPAT>
defines.  Support both LPD8803 & LPD8806 device tree compats.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-29 12:04:07 -06:00
Kumar Gala 8b691f50ca led_strip: ws2182: Add Device Tree support
Convert the ws2812 driver to use device tree and new DT_<COMPAT>
defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-18 12:47:45 -06:00
Karol Lasończyk c0a5739bda drivers: watchdog: align sample and test to new DT
Sample application and test are aligned to new DT naming convention.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2019-01-15 12:40:13 -06:00
Andy Ross b69d0da82d arch/x86_64: New architecture added
This patch adds a x86_64 architecture and qemu_x86_64 board to Zephyr.
Only the basic architecture support needed to run 64 bit code is
added; no drivers are added, though a low-level console exists and is
wired to printk().

The support is built on top of a "X86 underkernel" layer, which can be
built in isolation as a unit test on a Linux host.

Limitations:

+ Right now the SDK lacks an x86_64 toolchain.  The build will fall
  back to a host toolchain if it finds no cross compiler defined,
  which is tested to work on gcc 8.2.1 right now.

+ No x87/SSE/AVX usage is allowed.  This is a stronger limitation than
  other architectures where the instructions work from one thread even
  if the context switch code doesn't support it.  We are passing
  -no-sse to prevent gcc from automatically generating SSE
  instructions for non-floating-point purposes, which has the side
  effect of changing the ABI.  Future work to handle the FPU registers
  will need to be combined with an "application" ABI distinct from the
  kernel one (or just to require USERSPACE).

+ Paging is enabled (it has to be in long mode), but is a 1:1 mapping
  of all memory.  No MMU/USERSPACE support yet.

+ We are building with -mno-red-zone for stack size reasons, but this
  is a valuable optimization.  Enabling it requires automatic stack
  switching, which requires a TSS, which means it has to happen after
  MMU support.

+ The OS runs in 64 bit mode, but for compatibility reasons is
  compiled to the 32 bit "X32" ABI.  So while the full 64 bit
  registers and instruction set are available, C pointers are 32 bits
  long and Zephyr is constrained to run in the bottom 4G of memory.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-11 15:18:52 -05:00
Anas Nashif 5060ca6a30 cmake: increase minimal required version to 3.13.1
Move to latest cmake version with many bug fixes and enhancements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-01-03 11:51:29 -05:00
Peter A. Bigot 173d07c6e5 samples: driver: i2c_scanner: use arduino-defined device if available
nucleo_l476rg uses I2C_3 rather than I2C_0, and uses special magic to
synthesize a corresponding define from a device tree node label.  Update
the sample to use the Arduino binding if that's present.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-02 13:02:38 +01:00
Peter A. Bigot c416f61974 samples: driver: i2c_scanner: fix support on Nordic TWIM driver
The Nordic TWIM driver uses DMA which requires that the source address
be located in RAM.  If it isn't the transfer will rejected as invalid.
Provide a RAM address even though it's never dereferenced.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-02 13:02:38 +01:00
Peter A. Bigot 75240aa504 samples: driver: i2c_scanner: fix upper bound on address range
0x77 is an available device address (and is the secondary address for
the BME280).  0x78 is a reserved address.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-02 13:02:38 +01:00
Andrzej Głąbek 23d28ab400 samples: Remove redundant Kconfig adjustments for nRF boards
The options selecting nRF drivers are now enabled by default when
an nRF SoC is selected as the build target.
The options selecting given hardware instances are now enabled at
the board level.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-12-21 21:01:37 +01:00
Tavish Naruka 72b0289de4 samples: driver: i2c scanner
Scans i2c bus for any devices present.

Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
2018-12-21 10:27:53 +01: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 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
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
Anas Nashif bf649de0b9 samples: gpio: make sample generic and use DT
Do not limit to whitelisted boards, instead make it build/run for any
board that defines required DTS macros.

Simplified documentation and made it more generic. Remove HW setup and
made sample work with built-in LEDs and buttons.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-12-11 13:13:26 -06:00
Jakub Rzeszutko b928b71756 shell: rename shell_help_print function
Function printing help has been renamed to shell_help.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko 3064ca4f2f shell: creating new module for help functionality
1. Created new shell module: shell_help.
2. Simplified command handlers with new shell print macros.
3. Removed help functions from command handlers.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Jakub Rzeszutko 5451ff2848 shell: remove "options" concept
Removing help "options" from shell API.

Currently SHELL_OPT macro is not used by users. What is more
commit: a89690d10f ignores possible options created in
command handler by the user. As a result they are not printed
in help message.

Second, currntly implemented "options" in command handlers options are
implemented without SHELL_OPT macro.

And last but not least this change will allow to implement
help handler in a way that user will not need to think about calling
functions printing help in a command handler.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-12-05 15:15:44 +01:00
Patrik Flykt 079f55d519 samples: Add 'U' to unsigned variable assignments
Add 'U' to a value when assigning it to an unsigned variable.
MISRA-C rule 7.2

Signed-off-by: Patrik Flykt <patrik.flykt@intel.com>
2018-12-04 22:51:56 -05:00
Henrik Brix Andersen 4844afa04a samples: drivers: watchdog: enable debug logging
Enable debug logging in the watchdog driver sample application to aid
in debugging watchdog drivers.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-11-27 14:15:58 -06:00
Anas Nashif 10970a60c0 sanitycheck: remove unused platforms keyword
This keyword had no effect and was being copied over to many samples
errornously.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-11-19 15:03:55 -05:00
Kumar Gala 1634cf2248 drivers/spi: Always selecet HAS_DTS_SPI once SPI is enabled
All drivers require DTS for their primary SPI settings.

Removing SPI_[0-9]_NAME config option added some more samples changes.
Usage of these options there was anyway not relevant.

Fixes #11064

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-11-16 14:02:00 -05:00
Spoorthi K 93ddc232d7 samples: drivers: Update yaml with regex and fixture
Include regex pattern matching of console output
to determine the sample execution status.

Add fixture to determine the hardware dependency
if any. If FRAM is connected to board externally,
then with fixture, automation would be able to
identify the board with sensor to trigger the
execution.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-11-14 23:43:48 -05:00
Andrzej Głąbek 20202902f2 dts_fixups: Use DT_ prefix in all defined labels not related to Kconfig
These changes were obtained by running a script  created by
Ulf Magnusson <Ulf.Magnusson@nordicsemi.no> for the following
specification:

1. Read the contents of all dts_fixup.h files in Zephyr
2. Check the left-hand side of the #define macros (i.e. the X in
   #define X Y)
3. Check if that name is also the name of a Kconfig option
   3.a If it is, then do nothing
   3.b If it is not, then replace CONFIG_ with DT_ or add DT_ if it
       has neither of these two prefixes
4. Replace the use of the changed #define in the code itself
   (.c, .h, .ld)

Additionally, some tweaks had to be added to this script to catch some
of the macros used in the code in a parameterized form, e.g.:
- CONFIG_GPIO_STM32_GPIO##__SUFFIX##_BASE_ADDRESS
- CONFIG_UART_##idx##_TX_PIN
- I2C_SBCON_##_num##_BASE_ADDR
and to prevent adding DT_ prefix to the following symbols:
- FLASH_START
- FLASH_SIZE
- SRAM_START
- SRAM_SIZE
- _ROM_ADDR
- _ROM_SIZE
- _RAM_ADDR
- _RAM_SIZE
which are surprisingly also defined in some dts_fixup.h files.

Finally, some manual corrections had to be done as well:
- name##_IRQ -> DT_##name##_IRQ in uart_stm32.c

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Andrzej Głąbek f39ba7230d dts_fixups: Update labels generated from DTS with DT_ prefix
All labels containing "_<8-hex-digits>_" or "16550_<3or6-hex-digits>_"
in their names, assumed to be generated by the extracting script,
are updated with the DT_ prefix, to reflect the recent changes made
to the script.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-11-13 10:44:42 -06:00
Krzysztof Chruscinski 97345dbb1b logging: Fix errors in log usage
Couple of findings which were revealed after changing
LOG_MODULE_REGISTER macro:
- missing semicolons after LOG_MODULE_REGISTER()
- missing LOG_LEVEL defines
- other

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-11-10 12:38:29 -05:00
Tomasz Bursztyka d658e03488 drivers/spi: Remove unused legacy options
These have been osbolete for some time already.

Fixes #11064

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-11-09 05:25:11 -06:00
Himanshu Jha 148d515f9b samples: flash_shell: Replace incorrect assignment to boolean expression
`shell_cmd_precheck()` function has the second argument as boolean
and currently we pass assignment expression instead of boolean
expression. Therefore, fix the expression by passing `argc == 2`
as the boolean argument.

Fixes #11099
Coverity-CID: 189507

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
2018-11-08 10:46:17 +01:00
Reto Schneider 7eabab2f5d samples, tests: Use semi-accurate project names
When using an IDE (e.g. Eclipse, Qt Creator), the project name gets
displayed. This greatly simplifies the navigation between projects when
having many of them open at the same time. Naming every project "NONE"
defeats this functionality.

This patch tries to use sensible project names while not duplicating
too much of what is already represented in the path. This is done by
using the name of the directory the relevant CMakeLists.txt file is
stored in. To ensure unique project names in the samples (and again, in
the tests folder) folder, small manual adjustments have been done.

Signed-off-by: Reto Schneider <code@reto-schneider.ch>
2018-10-27 21:31:25 -04:00
Jakub Rzeszutko 147122e77f shell: examples unification
Updating examples according to new return value of function
shell_cmd_precheck.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-19 13:35:56 +02:00
Anas Nashif deaab90641 tests/samples: cleanup tags
Remove redundant 'sample' tag and add something that matches the
functionality and features being tested, demonstrated.

Avoid short abbriviations and using full names for fs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Anas Nashif 20b73e74a1 tests/samples: rename 'app' tag to something meaningful
Remove very generic apps tag and replace it with something that matches
what the test/sample does.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Anas Nashif 733a054ab0 samples: fix sample tags
Use correct tags instead of obvious 'sample' tag.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-16 09:17:51 -04:00
Jakub Rzeszutko f6197c4f3c shell: create instances automatically basing on enabled backend
If user will enable shell than for each backend shell instance
will be created automatically.

Update all shell examples according to the new initialization
procedure.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-11 12:08:04 +02:00
Ulf Magnusson 92ef8582b9 Kconfig: Remove redundant $(ZEPHYR_BASE) from 'source's
The $srctree environment variable gives the path relative to which
'(o)source' statements work (the current directory is used if $srctree
is unset). It is set to $ZEPHYR_BASE in cmake/kconfig.cmake, so there's
no need to qualify the source of Kconfig.zephyr in sample Kconfig files
(or in external projects).

All 'source's in Zephyr assume that the Zephyr root directory is used as
the srctree as well, and would break otherwise.

Remove the $(ZEPHYR_BASE)s to make it clearer that all 'source'
statements work relative to the Zephyr root. There was some user
confusion on IRC.

Also explain how things work in the documentation.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-10-10 11:28:27 -05:00
Jakub Rzeszutko b0571746e2 shell: parsing output LF character
Some terminals literally interprets shell output data. Hence to print
a message in new line shell needs to send `\r\n` each time. To minimize
flash usage user can now send `\n` as a line delimiter and shell will
automatically add missing CR character.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-10 10:45:28 +02:00
Jakub Rzeszutko 3d4c525c4c samples: flash_shell: migrate example to new shell
Convert flash_shell example to use the new shell API.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2018-10-09 13:22:53 +02:00
Anas Nashif 27eec649bf samples: led: fix default log level kconfig
Use correct Kconfig for default log level.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif c60aa42da7 samples: flash_shell: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif a37274b8f4 samples: led_lpd8806: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif 6038070704 samples: led_pca9633: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif 567f818d44 samples: led_ws2812: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif 7d9d0451fb samples: led_lp3943: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif b5c795d909 samples: led_lp5562: move to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif f7009d3a95 samples: move crypto sample to new logger
move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif c4d1324ce4 samples: crypto: move to new logger
Move sample to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif 88587b34c8 samples: fix prj.conf to use new logger
Configure samples to use new logger.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Anas Nashif 3da714193f drivers: crypto: move to new logger
Move to new logger subsystem.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-10-08 17:49:12 -04:00
Sebastian Bøe 8eb734cd82 DT: Rename from dts.fixup to dts_fixup.h
The Zephyr configuration system uses many different files in many
different formats. It makes it a lot easier for users to understand
what these files do if when we use the correct file extensions.

To this end we rename the dts.fixup files to the correct file
extension '.h'.

This is a breaking change for out-of-tree fixup files. Such files will
be detected and given an appropriate error message.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-10-08 11:38:56 -04:00
Maureen Helm 75bc6ba454 drivers: boards: Merge HAS_DTS_I2C_DEVICE with HAS_DTS_I2C
Every board that uses dts-enabled i2c drivers has a board-level dts, so
there is no need to have separate configs HAS_DTS_I2C_DEVICE and
HAS_DTS_I2C.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-10-01 21:15:06 -05:00
Sebastian Bøe 72e7bfa680 cmake: Remove unnecessary KCONFIG_ROOT configuration
It is no longer necessary to set the KCONFIG_ROOT variable when the
KConfig file is in the application root directory.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-09-21 13:37:21 -04:00
Spoorthi K 58542d8d6c samples: Include regex matching in samples
Add harness console and include regex for output
pattern matching to determine correctness of
sample execution.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-09-21 00:40:44 -04:00
Krzysztof Chruscinski 527256501f shell: Rename shell to legacy_shell
New shell implementation is on the way. For now old one and all
references are kept to be gradually replaced by new shell.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2018-09-19 09:30:29 -04:00
Ulf Magnusson d713033d5c Kconfig: Use new preprocessor syntax for env. variables
With the new Kconfig preprocessor (described in
https://github.com/torvalds/linux/blob/master/Documentation/kbuild/
kconfig-macro-language.txt), the syntax for expanding environment
variables is $(FOO) rather than $FOO.

$(FOO) is a general preprocessor variable expansion, which falls back to
environment variables if the variable isn't set (like in Make). It can
also be used in prompts, 'comment's, etc.

The old syntax will probably be supported forever in Kconfiglib for
backwards compatibility, but might as well make it consistent now that
people might start using the preprocessor more.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-09-11 19:17:25 -04:00
Filip Kubicz 5c3992f34f dts: update I2C bindings for nRF chips
Change 'nRF5' family names to 'nRF' in I2C DTS.

Signed-off-by: Filip Kubicz <filip.kubicz@nordicsemi.no>
2018-09-11 11:41:37 +02:00
Flavio Ceolin f6210cf430 samples: drivers: crypto: Fix minimum values for mbedTLS
The latest mbedTLS (2.12) release increased resources requirements on
Zephyr, so it was required increasing the minimum SRAM to run this test
and the main stack size.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-06 21:11:31 -04:00
Flavio Ceolin 8b70ace563 crypto: tests: Change crypto tests to use Kconfig defined header
While it's possible to define which mbedTLS config header to use, our
samples should use config-tls-generic.h as default because this header
is configurable through Kconfig.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-09-06 21:11:31 -04:00
Karol Lasończyk c9e3c938e6 tests/samples: watchdog: Update projects' configuration
WDT_NRFX is now enabling by default. Its configuration from proj.conf
files was removed.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2018-08-20 06:38:02 -07:00
Karol Lasończyk 6c669ace6e samples: watchdog: Update watchdog example to new API
Watchdog example is updated to use new watchdog API.

Signed-off-by: Karol Lasończyk <karol.lasonczyk@nordicsemi.no>
2018-08-20 06:38:02 -07:00
Anas Nashif 36ef19217f samples: led_lp5562: cmake_minimum_required added
Add missing cmake_minimum_required()

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-16 08:39:55 -07:00
Johannes Hutter f8d53e5d20 samples: drivers: Add sample application for LP5562
Add a sample application to show the LP5562 driver. The three RGB
channels are used to set multiple colors after each other under the
assumption that accordingly colored LEDs are connected. Blinking is also
shown in multiple colors.

Signed-off-by: Johannes Hutter <johannes@proglove.de>
2018-08-16 06:28:53 -07:00
Sebastian Bøe 55ee53ce91 cmake: Prepend 'cmake_minimum_required()' into 'app' build scripts
Prepend the text 'cmake_minimum_required(VERSION 3.8.2)' into the
application and test build scripts.

Modern versions of CMake will spam users with a deprecation warning
when the toplevel CMakeLists.txt does not specify a CMake
version. This is documented in bug #8355.

To resolve this we include a cmake_minimum_required() line into the
toplevel build scripts. Additionally, cmake_minimum_required is
invoked from within boilerplate.cmake. The highest version will be
enforced.

This patch allows us to afterwards change CMake policy CMP000 from OLD
to NEW which in turn finally rids us of the verbose warning.

The extra boilerplate is considered more acceptable than the verbosity
of the CMP0000 policy.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-08-15 04:06:50 -07:00
ravishankar karkala Mallikarjunayya d71a1dfefd samples/driver/gpio : Updated gpio support
Updated gpio configuration for all boards

Signed-off-by: ravishankar karkala Mallikarjunayya <ravix.shankar.km@intel.com>
2018-08-12 06:57:55 -07:00
Ulf Magnusson a8aba2f8d0 Kconfig: Include Kconfig.zephyr last in sample Kconfig files
This will make adding properties to symbols in the base Zephyr Kconfig
files work the same as before.

I didn't actually spot any such cases, so this is just to play it safe.
It also makes the sample Kconfig symbols appear at the top in the
menuconfig interface, which might be nice.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-10 12:38:28 -07:00
Sebastien Bourdelin 2ef1e72607 samples: drivers: Add sample application for PCA9633
Add sample application for NXP PCA9633 LED driver. This application
test the 4 LEDs by doing the following:
 - turn on LEDs
 - turn off LEDs
 - set the brightness to 50%
 - turn off LEDs
 - blink the LEDs
 - turn off LEDs

The application is based on the stm32373_eval board and expects to have
a PCA9633 LED driver on the bus I2C-1 at the address 0x62.

Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
2018-07-02 10:25:47 -05:00
Leandro Pereira c16bce7a6a samples, subsys, tests: Use ARRAY_SIZE() whenever possible
The ARRAY_SIZE() utility macro will actually test the parameter types,
and ensure that it is only called with arrays, and not arrays decayed
to pointers.

Changes were performed with a simple Coccinelle script.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-14 19:12:51 -04:00
Anas Nashif 57f6790335 samples: can: move CAN sample under drivers
Move CAN driver sample under samples/drivers and add a sample.yaml.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-11 17:11:18 -04:00
Anas Nashif d05442ee9c samples: crypto: adapt harness
Adapt console harness to new changes in sample output.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-06-05 10:26:59 -04:00
Leandro Pereira d06eecbe29 samples: drivers: crypto: Update expected sample output
Some changes were made in the sample implementation that made the test
fail due to differences in the expected output.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-05 10:26:59 -04:00
Leandro Pereira 858cd199ed samples: drivers: crypto: Do not show colors in logs
Showing colors in logs make it harder to write test expectations.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-05 10:26:59 -04:00
Leandro Pereira cf3da3c6c4 samples: crypto: Ensure cap_flags is always initialized
Find the device and query its capabilities just once at boot, then
go through a list of tests to perform.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-05 10:26:59 -04:00
Leandro Pereira a026b9eaca tests: crypto: Fully initialize variables using named initializers
This should get rid of Valgrind warnings in #7478.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-06-05 10:26:59 -04:00
Leandro Pereira 9c113d29f5 samples: drivers: crypto: Print output length for all operations
Printing the output length for all encryption/decryption operation will
make it easier to know if a particular crypto driver shim provides this
information.  TinyCript and mbedTLS were not providing this, making the
out_len field useless.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-05-16 23:30:11 +03:00
Anas Nashif b3275d651c tests/samples: add hw dependencies
Add hardware dependencies and filters to make sure we do not explode if
for example we try to build a sample/test using rtc when the platform
does not support that.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-05-01 19:10:27 -04:00
Henrik Brix Andersen 2d1c5241bf samples: flash_shell: Use correct flash write block size
Change the flash_shell sample from using FLASH_WRITE_BLOCK_SIZE
definition to using the flash_get_write_block_size() api for the
selected flash_device.

This fixes the flash_shell sample when using multiple flash devices
with different write block sizes.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2018-04-30 17:05:06 -04:00
Manivannan Sadhasivam 1572594b53 samples: drivers: Add sample application for LP3943
Add sample application for TI LP3943 LED driver. This application
displays a continuous pattern that turns on 16 LEDs at 1s one by
one until it reaches the end and turns off LEDs in reverse order.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2018-04-27 10:46:53 -05:00
Diego Sueiro 140daa2f27 sanitycheck: add min_flash option for 32K devices
Following tests were failing on a microcontroller with 32KB flash:
    test-mbedtls
    kernel.common

The min_flash option has been added in the test case yaml files.

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-04-21 06:57:38 -07:00
Tomasz Bursztyka 3f4cffc302 spi: Remove SPI legacy API
No drivers nor samples are using it anymore.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Tomasz Bursztyka 308f4df91d samples/drivers: Switch Fujistu FRAM sample to new SPI API
Replacing legacy API calls by news ones.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Tomasz Bursztyka 324265420b api/spi: Disable legacy API by default
Let's start deprecation work of the SPI legacy API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-04-04 19:02:35 +02:00
Carles Cufi 8aa9a37902 drivers: flash: nrf: Rename nrf5 to nrf
With upcoming ICs that are not in the nRF5x family, rename the flash
driver and all its dependencies from nrf5 to nrf.

Should also fix the issue introduced by f49150cab6 which broke the
assignment of the flash device due to a partial rename.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-03-20 20:07:09 +01:00
Johan Hedberg dd9f5e2a1d samples: led_strip: Extend ws2812 sample with ws2812b_sw support
Add support for building the WS2812 LED strip driver sample against
the new ws2812b_sw driver. Currently a configuration is only provided
for the BBC micro:bit board.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-03-03 20:46:53 +01:00
Alberto Escolar Piedras d118b6470e samples: drivers/entropy fixes
* .yaml: added expression for test
* README: Eeach second 9 bytes are generated not 10

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2018-02-23 07:34:07 -05:00
Leandro Pereira 2a98e7cfb4 samples: drivers: crypto: Print correct buffer comparison on failure
When testing whether the CTR mode decrypted the payload properly, a
comparison of `decrypt.out_buf` with the known plain text `plaintext`
is performed, but the buffer comparison that is printed uses
`plaintext` and `encrypt.out_buf` instead.

Coverity-CID: 181847

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2018-02-17 09:15:10 -05:00
Erwan Gouriou c734c2972f flash: remove obsolete FLASH_DRIVER_NAME
Replace seldom occurrences of FLASH_DRIVER_NAME by equivalent
and commonly used FLASH_DEV_NAME.

Fixes #5919.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-02-06 11:48:53 -06:00
David B. Kinder ec1b1df5ed doc: fix ReST heading underlines
The expected order for heading levels in our ReST documents is # for H1,
* for H2, = for H3, and - for H4.  Some documents snuck in without
following this guideline.

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2018-02-01 19:33:39 -08: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
Kumar Gala 26e4da52cf arm: nordic: flash: Use FLASH_DEV_NAME define
We want to move to use a common FLASH_DEV_NAME across the various flash
drivers. So samples, tests, or other code can be a bit more generic.  So
replace CONFIG_SOC_FLASH_NRF5_DEV_NAME with FLASH_DEV_NAME.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2018-01-25 15:23:00 -06:00
Anas Nashif 1a67aed51f samples: crypto: remove DEBUG/ASSERT from prj.conf
Those are added by sanitycheck, no need to have them enabled in the
project by default.

CONFIG_DEBUG is causing issues on qemu_nios2, see #5743.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif 5d3a534807 samples: use console harness for some samples
The output of those samples can be parsed and verified by sanitycheck,
so lets use the console harness for this.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Andrzej Puzdrowski 9fdcab9b1b samples: drivers: soc_flash_nrf5 fix missing flash write access
By default CONFIG_MPU_ALLOW_FLASH_WRITE=n so the example must have been
falling on any write to flash.
This patch adds CONFIG_MPU_ALLOW_FLASH_WRITE=y to project configuration.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-01-19 11:47:43 -06:00
Yannis Damigos 3d1115adea tests: Clear SPI_*_IRQ_PRI from tests and samples
Remove SPI_*_IRQ_PRI from tests and samples.
Using DT to get the *_IRQ_PRI, we can't
override it using Kconfig.

If needed, use a BOARD_NAME.overlay file to
override default values.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-01-17 11:51:48 -06:00
Anas Nashif c3880c0db4 samples: crypto: increase min_ram for sample
This samples does not fit on platforms with 8k RAM, increase minimal
requirements.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-13 10:48:36 -05:00
Anas Nashif c6d2ba996f samples: drivers: remove build_only flag
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 26ccc0bbcb samples: crypto: remove build_only and sample cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 0d841cf0f2 samples: entropy: filter based on HW capabilities
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 4599bbff67 samples: watchdog: fix dependencies and sample cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif d473d53da8 samples: rtc: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 7440a7ff23 tests: move aio sample to tests
This is clearly a test and not a sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 23f81eeb42 tests/samples: fixed yaml syntax
Use a map directory, avoid the list which makes parsing a bit
cumbersome.

Fixes #5109

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-11 14:47:08 -05:00
Anas Nashif d55884a34d sample: crypto: also test mbedTLS config
expand testing to mbedTLS

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-16 05:48:16 -05:00
David B. Kinder be9ee06bd9 doc: fix misspellings in boards and samples docs
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-11-15 12:59:22 -05:00
Carles Cufi 19d1e9afd1 samples: drivers: Convert doc to CMake
Convert doc of samples/drivers to CMake.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2017-11-12 21:13:23 -05:00
Sebastian Bøe 0829ddfe9a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Leandro Pereira da9b0ddf5b drivers: Rename random to entropy
This should clear up some of the confusion with random number
generators and drivers that obtain entropy from the hardware.  Also,
many hardware number generators have limited bandwidth, so it's natural
for their output to be only used for seeding a random number generator.

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-01 08:26:29 -04:00
Marti Bolivar 306c717b9e samples: drivers: add WS2812 sample application
This is similar to the LPD8806 sample, but uses the WS2812 driver
instead. The app configuration is a bit more finicky, so try to
provide helpful references. This could be made more beginner-friendly
with the addition of timing diagrams, etc., but this should be enough
for an experienced developer to use.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Marti Bolivar 3e674eac98 samples: drivers: add LPD8806 sample application
This sample displays the colors red, green, and blue on consecutive
LEDs in an LED strip, moving the starting point where red begins
further down the strip at each time step. The color band wraps around
to the beginning when it reaches the end.

Since this is the first application in samples/drivers to have
documentation, add samples/drivers/drivers.rst as well, and include it
in the top-level toctree from samples/samples.rst.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-28 13:23:30 -04:00
Adam Podogrocki 61467e019e iwdg: the sample of the use of STM32 Independent Watchdog
JIRA: ZEP-2347

Change-Id: I808e9f110681735cae45d14c5802636012f018cc
Signed-off-by: Adam Podogrocki <adam.podogrocki@rndity.com>
2017-10-23 09:51:16 +02:00
David B. Kinder 4600c37ff1 doc: Fix misspellings in header/doxygen comments
Occasional scan for misspellings missed during PR reviews

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-10-17 19:40:29 -04:00
Anas Nashif 0356590df5 tests: samples: fix yaml syntax
Fix indentation and syntax and make it pass yamllint tool.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-10-15 08:15:00 -04:00
Andrzej Puzdrowski a568e1399f sample: drivers: soc_flash_nrf5: Test of write-block-size get API
Added example code of using the new API for retrieving write-block-size.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-10-11 11:19:15 -05:00
Marti Bolivar 1047be9dbe samples: flash_shell: update to keep up with flash driver changes
Keep the flash shell up to date with the latest flash driver updates.

- Get the driver name from soc.h
- Add a write_block_size command
- Implement flash_shell_page_layout() using flash_page_foreach()

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-10-06 22:12:23 -04:00
Marti Bolivar 219b3cd067 samples: drivers: add flash_shell
This is a simple shell module that allows arbitrary boards with flash
driver support to explore the flash device.

- Reading, erasing, and writing by device offsets are supported in all
  cases.

- If the flash page layout is available, it can be printed, and I/O
  can also be done to a specified page as well.

One known issue is that writing to flash on targets that require
doubleword-sized writes (e.g STM32L4) will fail since the number of
arguments required exceeds ARGC_MAX in shell.c. Addressing that is
left to future work.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-09-11 11:41:57 -04:00
Andrzej Puzdrowski 4255766ba7 samples: drivers: soc_flash_nrf5: Get flash page layout sample
Added sample code for testing and displaying the flash layout using
the recently introduced API.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2017-09-11 11:41:57 -04:00
Tomasz Bursztyka 087354019f samples/crypto: Add mbedtls shim driver support
Normalizing variables names and make sure tag handling behavior, which
might be different among backends, does not make the test failing.

Also, improving debug logs in case of error.

Change-Id: Ic317948aab459bfa75c9a72ac48cb2d12a0d0706
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 22:20:23 -04:00
Tomasz Bursztyka 422a769cc2 samples/crypto: Check error code everytime and improve logging
If the encryption/decryption failed there is no need to procceed
further.

Change-Id: If450e40ed6fd601b698b74c56ae21fc7f903d087
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-08-17 22:20:23 -04:00
Leandro Pereira d89e7e4e45 samples: drivers: gpio: Make the sample work with ESP32
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-08-09 12:26:14 -07:00
Erwin Rol 3ff4d7409f samples: random: Add sentinel to check for buffer overflows
Initialize the buffer to 0 and read one byte less than the
buffer size. The result should be that the last byte of
the buffer always stays 0. This way it is possible to verify
it the driver does not write outside the buffer.

Signed-off-by: Erwin Rol <erwin@erwinrol.com>
2017-07-07 07:27:39 -05:00
Anas Nashif c364e06ccb tests: move spi test under tests/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-07-05 12:43:13 -04:00
Neil Armstrong 395daba0d4 samples/spi: Enable test on STM32 SoCs
Add support for the STM32 SoCs.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-01 08:36:51 -04:00
Neil Armstrong 394aa8127a samples/spi: Permit specifying low test frequency
The STM32 lower frequency is different, let us specify a different one.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-01 08:36:51 -04:00
Neil Armstrong 9eb865e03a samples/spi: Make async test optional
Handle the case when the async transceive call returns ENOTSUP.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
2017-07-01 08:36:51 -04:00
Anas Nashif 3c50f7aa12 tests: samples: remove duplicate filtering
We have many testcases doing filtering both on the architecture level
and the platform level, which is redundant. Also many testcases are
running the same test twice on the same SoC for no good reason, cleanup
the tests and cleanup the filtering.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-27 17:44:23 -04:00
Anas Nashif 470c5f3189 tests: remove testcase.ini files
We now use yaml files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Anas Nashif cc24f4b03c tests: samples: convert testcase files to yaml
This will prepare test cases and samples with metadata and information
that will be consumed by the sanitycheck script which will be changed to
parse YAML files instead of ini.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-06-21 20:56:53 -04:00
Geoffrey Le Gourriérec 1975ce4f7c samples: gpio: Add support for SensorTag board.
Add extra #defines in samples/drivers/gpio to test
TI SensorTag board.

Signed-off-by: Geoffrey Le Gourriérec <geoffrey.legourrierec@smile.fr>
2017-06-16 16:18:12 -04:00
Tomasz Bursztyka cced7fd47a api/spi: Change transceive functions signature
Instead of NULL terminated buffer arrays, let's add a parameter for each
that tells the number of spi_buf in it.

It adds a little bit more complexity in driver's side (spi_context.h)
but not on user side (bufer one has to take care of providing the NULL
pointer at the end of the array, now he requires to give the count).

This will saves a significant amount of bytes in more complex setup than
the current dumb spi driver sample.

Fix and Use size_t everywhere (spi_context.h was using u32_t).

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-06-01 10:49:30 -04:00
Tomasz Bursztyka 0938ccbbc1 samples/spi: Add a quick test for spi_release() API function
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Tomasz Bursztyka d9007a09f8 samples/spi: Add an asynchronous call test
This gives a quicke example on how to use SPI asynchronous calls with
kernel's k_poll API.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Tomasz Bursztyka 761a1d9429 api: Add asynchronous call support to SPI API
Adding a struct k_poll_signal parameter to driver's API unique
exposed function.

If not NULL, the call will be handled as asynchronous and will
return right after the transaction has started, on the contrary
of current logic where is waits for the transaction to finish
(= synchronous).

In order to save stack, let's move the device pointer to struct
spi_config. So the call is still at a maximum of 4 parameters.

Adapting spi_dw.c and spi driver sample to the change so it still
builts.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Tomasz Bursztyka cd54dc66f2 samples: Add an SPI driver test application
This application intents to test an SPI driver by looping over MISO/MOSI
line where the controller will then send data to itself.

It will test various buffer tx/rx schemes.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-05-19 18:52:25 -04:00
Anas Nashif 51f9318a32 samples: lcd_hd44780: return if binding fails
Coverity-ID: 151980
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-05-18 11:19:11 -05:00
Justin Watson 558281b096 arch: sam3x: update Kconfig options after move to SAM SoC family tree
The files for the Arduino Due needed to be updated to use the new
configuration when the SoC moved from the atmel_sam3 directory to
the atmel_sam/sam3x directory.

Jira: ZEP-2067

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2017-05-03 13:51:37 -04:00
Tomasz Bursztyka fcb4ea1383 samples/crypto: Use sys_log properly
Sys log already break a line after each line, by default, so removing
the '\n' on log messages.

Enabling support for sys log colors.

Change-Id: Ica3a601aba0bbbd2d9438b41fb7bca0aad9c05f4
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-27 13:06:35 +00:00
Tomasz Bursztyka 50151db3c5 samples/crypto: Fix memory leaks
Don't return without freeing the session when relevant.

Change-Id: I9e5903791f8eb54026c4bb2ddda9f1fe9f3f7bb3
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-27 13:06:35 +00:00
Tomasz Bursztyka 0b5946e4b7 drivers/crypto: Use a proper driver name for TinyCrypt shim driver
Change-Id: I526677c98fa70e46f92dbb4e4569707e1cb8469a
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-04-27 13:06:29 +00:00
Kumar Gala e547533435 samples: convert to using newly introduced integer sized types
Convert code to use u{8,16,32,64}_t and s{8,16,32,64}_t instead of C99
integer types.

Jira: ZEP-2051

Change-Id: I08c682bfc0b80dfa88de859e90a011bcd2db2762
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-21 09:53:53 -05:00
Kumar Gala 789081673f Introduce new sized integer typedefs
This is a start to move away from the C99 {u}int{8,16,32,64}_t types to
Zephyr defined u{8,16,32,64}_t and s{8,16,32,64}_t.  This allows Zephyr
to define the sized types in a consistent manor across all the
architectures we support and not conflict with what various compilers
and libc might do with regards to the C99 types.

We introduce <zephyr/types.h> as part of this and have it include
<stdint.h> for now until we transition all the code away from the C99
types.

We go with u{8,16,32,64}_t and s{8,16,32,64}_t as there are some
existing variables defined u8 & u16 as well as to be consistent with
Zephyr naming conventions.

Jira: ZEP-2051

Change-Id: I451fed0623b029d65866622e478225dfab2c0ca8
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-04-20 16:07:08 +00:00
Anas Nashif 7c81d7f981 samples: remove lsm9ds0 sample code which does nothing
This sensor is supported already with many features, using it to test
SPI and I2C is an overkill. For both basic I2C and SPI samples we have
the FRAM samples supporting both IOs.

Change-Id: I794e584bd540d5fe6353fa3370aac0f1d6d105dc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-20 10:31:07 +00:00
David B. Kinder 30450fea2a spell: fix doxygen comment typos: /boards /samples
Fix doxygen comment typos used to generate API docs

Change-Id: I248d53000d8e57b902b9a18fdcfc9e995142a8b3
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-04-19 18:38:19 +00:00
Anas Nashif d7bc60f096 kernel: remove remaining microkernel references
Change-Id: Ie648dbaaf714316c21395bd43e555618013dbd19
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-04-10 20:21:05 +00:00
Kuo-Lang Tseng 4a363ff5bf samples: i2c_fujitsu: change hard-coded device name
Change to use the device config name defined by driver's Kconfig
for device binding, instead of hard-coding it which is not
portable.

Jira: ZEP-1764

Change-Id: I61ed7cfd97e20faad8f1e98dacef9384e8fefc73
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-28 13:49:48 +00:00
Kuo-Lang Tseng e90aa43eaa samples: drivers: change hard-coded device name
Change to use the device name defined by driver's Kconfig for
device binding, instead of hard-coding it which is not portable.

Jira: ZEP-1764

Change-Id: I0dc9aa2cdf426af71f1ed6dcef1ec7cec19f4c3e
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-28 13:48:30 +00:00
Kuo-Lang Tseng 1980325392 samples: drivers: rtc: change hard-coded device nam
Change to use the device config name defined by driver's Kconfig
for device binding, instead of hard-coding it which is not
portable.

Jira: ZEP-1764

Change-Id: I7af234ada73302eb062340740df2fc7a8539150d
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-28 13:46:49 +00:00
Anas Nashif 87a422896c Revert "samples: i2c_lsm9ds0: change hard-coded device name"
This reverts commit 81f85f4e4b.

Need a better solution for this, the patch itself does not solve any problem
and fails on many platforms that do not have I2C enabled.

Change-Id: I060e3d7a9992db8a1ece6da5e8d3a521f4052395
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-24 06:30:39 -08:00
Andrew Boie 138579a3ad samples: add some missing testcase.ini
Issue: ZEP-1768
Change-Id: Ia59e02bdaf9302b991f0423ef5eba7b0102877b0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-02-23 13:28:03 +00:00
Kuo-Lang Tseng e47e85e279 samples: driver: led_apa102c: change hard-coded device name
Use the config name defined by the driver Kconfig in device
binding calls as that is safer because device name can change and
the app does not need to change.

Jira: ZEP-1764

Change-Id: I5a3e16e10f7700ec12edbd07603808cd32f15755
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:24:42 +00:00
Kuo-Lang Tseng 81f85f4e4b samples: i2c_lsm9ds0: change hard-coded device name
Instead of using a hard-coded device name in the device binding
call, use the config name defined by the driver Kconfig as that
is safer and the app does not need to change when the device name
is changed.

Jira: ZEP-1764

Change-Id: I99efc4bcae0d1acae70f7820f69dfffbe17510a6
Signed-off-by: Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
2017-02-23 13:24:04 +00:00
Anas Nashif fe118c4e95 license: replace APL2.0 license with SPDX
Some files made it through review process with full license header.

Change-Id: I2722b127c40b4b19500042c12e4fde85a165bae9
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-02-20 16:59:46 +00:00
Jithu Joseph 38aaa7c955 samples/drivers/crypto: crypto sample app
A sample application  to illustrate the usage of crypto APIs.
This shows the usage of AES - CTR, CBC and CCM  based encryption
and decryption.

origin: original

Change-Id: I17e4d966a70169b71a754c9cdc3f713a5d0c3ac0
Signed-off-by: Jithu Joseph <jithu.joseph@intel.com>
2017-02-15 01:08:16 +00:00
Baohong Liu 42af60328d samples: spi_flash: remove an unnecessary config symbol
Remove CONFIG_GPIO from the prj config file. It is redundant.

Change-Id: Ife4301e7ce480a9002cadcddfd5eaa569900a391
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2017-02-04 19:45:44 +00:00
David B. Kinder ac74d8b652 license: Replace Apache boilerplate with SPDX tag
Replace the existing Apache 2.0 boilerplate header with an SPDX tag
throughout the zephyr code tree. This patch was generated via a
script run over the master branch.

Also updated doc/porting/application.rst that had a dependency on
line numbers in a literal include.

Manually updated subsys/logging/sys_log.c that had a malformed
header in the original file.  Also cleanup several cases that already
had a SPDX tag and we either got a duplicate or missed updating.

Jira: ZEP-1457

Change-Id: I6131a1d4ee0e58f5b938300c2d2fc77d2e69572c
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-01-19 03:50:58 +00:00
Anas Nashif b52a5450b0 legacy: use k_cycle_get_32 instead of legacy sys_cycle_get_32
Jira: ZEP-1585
Change-Id: Idac4685625f191771b90ce78234d97f5143413f0
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-17 19:03:34 +00:00
Punit Vara 959988662f samples: basic: Move pwm driver samples
This patch moves pwm driver samples to samples/basic and also convert
documentation of PWM samples to RST.

Jira: ZEP-1536
Change-Id: Ib2b3ff8b1722a26618e9a6fe416e2138d82ca28b
Signed-off-by: Punit Vara <punitvara@gmail.com>
2017-01-11 15:15:31 +00:00
Anas Nashif eeb6a30f29 samples: apds9960: move under sensors and update docs
Change-Id: I8e5735f15dbba5b9fead8f677104843a947b28ca
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-11 12:24:58 +00:00
Marcus Shawcroft c66adc646d samples: Add random driver sample.
Change-Id: If0552cbd478e49c71bbfa02448113a3a0e3b4463
Signed-off-by: Marcus Shawcroft <marcus.shawcroft@arm.com>
2016-12-24 16:40:11 +00:00
Baohong Liu 34f735fe60 samples: i2c_fram: update some comments
Change-Id: Ie86f50828df8c5c3f975024c2e3bc4254714fa3c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-22 01:21:54 +00:00
Baohong Liu 3b831465a4 samples: spi_fram: correct syntax error and update comments
Correct some syntax error and update some comments. There is
no functionality change.

Change-Id: I86c922c8aabcc4464b86f33ad7edf6056b1d765c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-11 11:26:57 +00:00
Baohong Liu cdf41416bd samples: gpio: use correct gpio driver name
The gpio device driver name for the sensor sub-system was
renamed to GPIO_SS_x from GPIO_x recently. Let's use the
new gpio driver name for the sensor sub-system in the app.

Change-Id: Ie06b072d31e23e74c3ac41a4590845b24a020ed1
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-11 11:24:22 +00:00
Baohong Liu e0359b5b5c samples: aio: fix some coding style issues
Change-Id: I799b8543e50716fec1685d32810419c7c3d94bf2
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-10 12:24:30 +00:00
Baohong Liu fc7dec1e5a samples: spi_flash: remove redundant code lines from config file
Remove two configuration parameters related to gpio used as spi
chip slect from prj config file. since they are already in
arduino 101 board config.

Change-Id: Iebaab605d8a6394e27c70ebbf4bac37a24665522
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-12-10 02:18:01 +00:00
Erwan Gouriou 7e631bd07d samples: pwm: update PWM sample to support ST Nucleo boards
Change-Id: I483f70a6b55b42105e9a3366f8735903e23be294
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2016-12-06 10:31:46 -06:00
Vincenzo Frascino bd2717740a samples/drivers: Add Beetle to Watchdog test
This patch adds Beetle to the Watchdog test case.

Jira: ZEP-1300
Change-Id: I371ca2f89aaec8e07f45cfa04fc2618d009cf487
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@linaro.org>
2016-12-06 10:31:45 -06:00
Sergio Rodriguez b0c0548ad6 samples: drivers: current sensing : Exit from testcase if device not found
Exiting from the test case when the i2c device is not found, this
to avoid a null pointer dereference

This issue was reported by Coverity

Coverity-CID: 151982

Change-Id: Ib11224ef2a78170f6e4d20545f645b4f2ea4a181
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-29 03:45:39 +00:00
Sergio Rodriguez 710f9a22a8 samples: drivers: led_apa102c: Exit from testcase if device not found
Exiting from the test case when the gpio device is not found, this
to avoid a null pointer dereference.

This issue was reported by Coverity

Coverity-CID: 151980

Change-Id: I7aafbc993674c8874a16b5a9213108f5769114ec
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-28 17:49:31 -08:00
Juan Manuel Cruz ec27d03ed4 sensor: fixes program hangs in the apds9960 sample
If an i2c transaction fails the sample will hang the program into
an infinite circle.

This commit will remove the infinite circle and report back the
error code from the i2c transaction.

Change-Id: I38d350a805af6bec43f2fa8d4af6ce4e3cc27662
Coverity-CID: 151991
Coverity-CID: 151992
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-11-18 23:17:30 +00:00
Juan Manuel Cruz 2936f0e00e sensor: fixes dead code in the apds9960 sample
If the gpio or spi devices are not found there is no
need to keep the device busy in a loop for this particular
sample.

Since it is not possible to continue execution it is better
to simply end the application.

Change-Id: Ie25ea970a479db2a2f339ca2b37f88541a45ef97
Coverity-CID: 151973
Signed-off-by: Juan Manuel Cruz <juan.m.cruz.alcaraz@intel.com>
2016-11-18 23:17:29 +00:00
Sergio Rodriguez b03ddf491f samples: drivers: gpio: Exit from testcase if device not found
Exiting from the test case when the gpio device is not found, this
to avoid a null pointer dereference

This issue was reported by Coverity

Coverity-CID: 151980

Change-Id: I44f13131d44c7c093781e1f11f8481e7ef8175c9
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-18 00:05:31 +00:00
Sergio Rodriguez 41004171d3 samples: drivers: i2c fram : Exit from testcase if device not found
Exiting from the test case when the gpio device is not found, this
to avoid a null pointer dereference

This issue was reported by Coverity

Coverity-CID: 151982

Change-Id: Ifaed47b2b48359dacfdb3111ca2895d5912779e6
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-18 00:01:34 +00:00
Sergio Rodriguez 02902df44b samples: aio comparators: Use expected pointer type in printf
The data structure member being used  is character array,
dereferencig this array gives **char instead of the expected
*char type.

This issue was reported by Coverity

Coverity-CID: 152030
Coverity-CID: 152033

Change-Id: Ied67e4b2d47017e6ad5e40b9b6fca1b496c483ed
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-17 14:23:13 +00:00
Baohong Liu 933e34621b samples: spi_fram: add spi FRAM sample app
Add a sample app to demonstrate the usage of Fujitsu SPI
FRAM.

It uses SPI 1 on quark spi controller and gpio 20 as CS.

Change-Id: I30c83bdd8312ca0cab7a62e397c0cb4ade0821cb
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-09 20:33:04 +00:00
Anas Nashif d622b09bc0 samples: tests: remove obsolete KERNEL_TYPE and kernel variables
Remove those from Makefiles and testcase.ini, we now support unified kernel
only and sanitycheck script now knows how to deal with this.

Change-Id: I853ebcadfa7b56a4de5737d95f2ba096babb2e13
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-11-04 15:47:25 -04:00
Sergio Rodriguez fdf77e56bc samples: aio_comparator: use unified kernel
Use unified kernel for AIO comparator sample app.

Change-Id: Id6a9016a9c00d7400395dfbc431d7438804ffe37
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-04 17:26:16 +00:00
Baohong Liu 611420ced4 samples: spi_lsm9ds0: use unified kernel
Use unified kernel for lsm9ds0 (spi) app.

Change-Id: Ibd559b6879984d3964ba9e3f3d49d88e85291d8c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-04 01:39:49 +00:00
Sergio Rodriguez a770264ef3 samples: sensor_apds9960: convert to and build with unified kernel
Change-Id: I73863da2e9539fbcde79b39561badcd24c0bda80
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-03 21:00:41 +00:00
Baohong Liu f960e0fa08 samples: w25q80bl: remove the sample app
Remove this sample app. The component is no longer on the
board (quark_se_c1000_devboard).

Change-Id: I342616781e6f343cfc66b89cbdf85de5844f6f4a
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 12:03:08 -07:00
Baohong Liu 3a8d3dd07d samples: lcd_hd44780: use unified kernel
Use unified kernel for lcd hd44780 app.

Some delays were rounded up to multiples of millisecond, since
k_sleep only takes multiples of millisecond. Based on the lcd
datasheet, this should not cause any problem.

updated some comments based on what the code is actually doing.

Change-Id: I533c822dbaea0246dcd62a76cc23ce0d8edd4630
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 01:46:11 +00:00
Sergio Rodriguez cce647bf54 samples: watchdog: use unified kernel
Use unified kernel for the watchdog sample app.

Change-Id: I6b53f066033a451c3aafe7f3a528c7f3461ae305
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-03 01:39:52 +00:00
Sergio Rodriguez 3b0ecfa283 samples: current sensing : Use unified kernel for the current sensing app.
Change-Id: I739374a8134963bdca99f6de419809033a8a983e
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-03 01:39:34 +00:00
Sergio Rodriguez 7a0504e303 samples: soc_flash_nrf5: use unified kernel for SOC flash
Change-Id: I6f7a66d69919fe8d44b91ae52cb6f0aae6a3c7ba
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-03 01:39:17 +00:00
Baohong Liu 4b270bb544 samples: led_apa102c: use unified kernel
Use unified kernel for the led app.

Change-Id: Iadfcf9970bfa6a13f61b3b1833de2cf1d4af4b0b
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-02 17:32:11 -07:00
Baohong Liu f70bf9366f samples: gpio: use unified kernel
Use unified kernel for gpio app.

Change-Id: I08a85212ef4a06ba702eb0e7654855a9bac559a4
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 00:25:51 +00:00
Baohong Liu f3d0887fb0 samples: i2c_lsm9ds0: use unified kernel
Use unified kernel for i2c device lsm9ds0.

Change-Id: I1d8626571785bfc856e162bf5e1524a6530fe8e5
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 00:25:33 +00:00
Baohong Liu 4af945ed76 samples: rtc: use unified kernel
Use unified kernel for rtc app.

Change-Id: Ifafe48eb9d955b2954de9341c372e1fbc5538cf1
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 00:25:15 +00:00
Baohong Liu 8a2fbd8c90 samples: spi_flash: use unified kernel
Use unified kernel for spi flash app.

Change-Id: I723841ffd49ec7e36ad8c1aa19b168ba879a122e
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-03 00:25:01 +00:00
Sergio Rodriguez df605abea4 samples: i2c Fujitsu fram: use unified kernel for fram app
Use unified kernel for i2c Fujitsu FRAM breakout sample app.

Change-Id: I7c6f532850c7944bf1b7470e75fe19bc323b9fbc
Signed-off-by: Sergio Rodriguez <sergio.sf.rodriguez@intel.com>
2016-11-02 23:20:15 +00:00
Baohong Liu 6dd7080ffb samples: pwm: use unified kernel for servo control app
Use unified kernel for pwm servo control app.

Change-Id: I08106f774f6c7fa2a4cd1fb909529f84905b5ea2
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-02 23:20:00 +00:00
Baohong Liu dd273ffe7d samples: pwm: use unified kernel for RGB led app
Use unified kernel for pwm RGB led app.

Change-Id: I1b6d62d420371a34a5bada5769bcbea1bc1a9a6a
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-02 22:14:47 +00:00
Baohong Liu c5a5397804 samples: pwm: use unified kernel
Use unified kernel.

Change-Id: Ifd7f6d9779759bd78fef734519fd48f0d0c5fc4a
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-02 20:54:05 +00:00
Baohong Liu 94bf561cf1 samples: pwm: use unified kernel
Use unified kernel.

Change-Id: I9602ccde67a3f77addedd8ce9470795d9502c020
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-11-02 20:53:34 +00:00
Baohong Liu 9824608935 samples: pwm: use new API and add rgb led app
Add a new pwm app (rgb led) using the new API.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

To demonstrate the usage of the new PWM APIs, this app
to drive a rgb led is added. It will use the new API
pwm_pin_set_usec().

This app will be located in a new sub directory.

Jira: ZEP-745 ZEP-1029

Origin: Original

Change-Id: If8e5d8ab22dcf8b7cf3665e38949715c61ca9c03
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:02:23 +00:00
Baohong Liu 22a10c3b6c samples: pwm: use new API and add motor control app
Add a new pwm app (motor control) using the new API.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

To demonstrate the usage of the new PWM APIs, this app
to drive a servo motor is added. It will use the new
API pwm_pin_set_usec().

This app will be located in a new sub directory.

Jira: ZEP-745 ZEP-1029

Origin: Original

Change-Id: I65857848e64d0478c4e12d1317b2089cdd1ecf5c
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:02:06 +00:00
Baohong Liu 0273ddff24 samples: pwm: use new API and add fade led app
Add a new pwm app (fade led) using the new API.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

To demonstrate the usage of the new PWM APIs, this app
to fade led is added. It will use the new API pwm_pin_
set_usec().

This app will be located in a new sub directory.

Jira: ZEP-745 ZEP-1029

Change-Id: I8d929a21f7de88307c47b52f98f131e00b2fdbe7
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:01:28 +00:00
Baohong Liu e1db5f2019 samples: pwm: use new APIs and rename the app
Replace existing APIs which will be deprecated by
the new API in this app and rename the app.

Following the recent pwm RFC, all existing APIs will
be deprecated. Two new APIs will be added. The changes
for the new APIs and the required driver function have
been posted.

Since the two existing APIs (pwm_pin_set_period and
pwm_pin_set_values) used by this app will be deprecated,
this change is to replace them with the new API
pwm_pin_set_usec().

To demonstrate the usage of the new PWM APIs, more apps
will be added. All the apps will be located in their own
sub directories. The existing app is actually one to
blink LED. So, it is moved the "blink_led" sub directory.

Jira: ZEP-745 ZEP-1029

Change-Id: Icc3fbf6b6c25db9590c63bc08f40ec62c87c0f16
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-10-31 20:01:05 +00:00
Anas Nashif adf8a30b80 samples: move grove lcd to samples/grove
Change-Id: Ibf97ad2a4bd1234960f6da9585eff122e5876f62
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:14:31 +00:00
Anas Nashif fa06c5b879 samples: move basic samples to samples/basic
Change-Id: I0915158424d9f105959e436af3378dc52753347c
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:14:31 +00:00
Anas Nashif 36e1e2dbaf move tests from samples to tests/
Change-Id: Ib183936134d27ff84d9af57e8e2e2d9f0cc2670f
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-27 22:13:36 +00:00
Ricardo Salveti 702cd6cb52 samples/soc_flash_nrf5: test non-word aligned writes
Change-Id: I0c109d1632a84ab2f239b7034f18556519aa158e
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2016-10-25 00:34:29 +00:00
Chuck Jordan 4c6feac28e samples: modify w25q80b1 sample to output "done" when done.
This sample justs outputs the SPI FLASH IDs.
I think we should improve this to also output done, otherwise
it looks like its stuck or something.

Change-Id: I18d5919c1e25bb5aaa9ceba53793cc14b15f3c77
Signed-off-by: Chuck Jordan <cjordan@synopsys.com>
2016-10-21 19:55:20 +00:00
Inaky Perez-Gonzalez 6ef9c853d1 samples/drivers/spi_lsm9ds0: don't run on QEMUs or FRDMs
These platforms don't have the hardware and will always fail.

Change-Id: I637d39f003bd1d507da0b5bb6fa12118040fcd63
Signed-off-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
2016-10-19 17:56:48 +00:00
Lee Jones d14e4522eb samples: drivers: dma: Improve failure debug granularity
When the sample fails, it's difficult to identify whether it failed
during the configuration or transfer stage.  Provide a little more
information which will allude to the nature of the failure.

Change-Id: I5272ce73f56b0e51c8439d5510e512b616665705
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2016-10-17 00:22:59 +00:00
Anas Nashif 43f1c36ed5 samples: button: modify sample to work on more boards
Change-Id: Ib29dc5ce70618f6c4d0a4d732910ea67f92c37a5
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-10-07 14:14:05 +00:00
Anas Nashif 179ce1c891 boards: remove obsolete board basic_minuteia
This board is not being used or tested and does not actually
run on any hardware, remove it in favor of well supported boards
for this CPU.

Jira: ZEP-850
Change-Id: I01c825c7eb44d6c321f2ffb88e8899da528921dc
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-22 22:09:34 +00:00
Anas Nashif 572f4a1a14 boards: remove obsolete board basic_cortex_m3
This board is not being used or tested and does not actually
run on any hardware, remove it in favor of well supported boards
for this CPU.

Jira: ZEP-850
Change-Id: Ied681b6059ad74f9d019054292c919a9f938e7d3
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-22 22:09:33 +00:00
Anas Nashif 5363d14a9e boards: rename Quark SE Devboard to Quark SE C1000
This board now has an official name and will be available soon:

http://www.intel.com/content/www/us/en/embedded/products/quark/mcu/se-soc/overview.html

Jira: ZEP-758
Change-Id: Ia16d33722308cf81471321c3063bdc75055a4d50
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:31 +00:00
Anas Nashif 5e4b62c35c boards: rename Quark SE Devboard to Quark SE C1000 (Sensor Subsystem)
Jira: ZEP-758
Change-Id: I8ee5a2f9e4a6ecbd15214e59321bf27a502ef6ee
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-16 03:10:30 +00:00
Anas Nashif 4589f2c468 samples: use printf/printk directly instead of macros
In many cases there is no need to define a macro for printing to
the console, just use the correct variant directly.

Jira: ZEP-240
Change-Id: I9952deda4bfc60424f01fca2443d037562d13d0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-14 16:56:02 +00:00
Andrew Boie 9436765914 samples: dma: don't skip this test case
There is no reason to skip it.

Change-Id: I45a9aa3f05263c6deb017c1513cafb9af055037a
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-09-12 17:53:22 +00:00
Anas Nashif c7faacf3d6 samples: move pci tests to tests/
Change-Id: Ibeb50b25b2f897dc1be87aa0739ef3f31d9015e8
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-12 12:26:06 +00:00
Anas Nashif 1ecbea283c samples: move spi tests to tests/
Change-Id: I8d4a50bcbf479c35ccb209fbb04b5b1095075933
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-12 12:26:06 +00:00
Baohong Liu 56011cee50 samples: remove stts 751 sensor app
Remove this app, since the sensor is not on the
board any more.

Jira: ZEP-763

Change-Id: I931acfe9f01b817bc0b24a4e0745bf759e53da90
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-09-10 11:29:05 +00:00
Andy Ross fb1daa0f97 samples/uart: Use the proper console
Don't try to detect the UART device manually, the list is missing a
bunch of boards (the Quark SE sensor subsystem variant, and both
Arduino 101 halves).  There's a config variable for that.

Change-Id: I903e52dcb6025e5da824faadb5e4bc59221fa210
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-09-09 21:37:56 +00:00
Andy Ross ee56af2a29 samples/drivers/uart: Fix line endings
This output is going to a terminal device, not a Unix tty descriptor
which will cook the output for us.  Newline moves the cursor down.
Carriage return moves it to the start of a line.  We need both.

Change-Id: If93d1a85d16cea93b4788fa55e694a7b77055bfe
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2016-09-09 21:37:55 +00:00
Anas Nashif af1eaf489d samples: adc: make project configuration arch agnostic and cleanup
- Set default board to Quark SE Debvboard

Jira: ZEP-690, ZEP-760, ZEP-782
Change-Id: I7f7cc45b527a116f88cf45796e46b429ae6f0060
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-07 22:09:59 -04:00
Andrew Boie cb34a2b629 samples: i2c_fujitsu_fram: fix incorrect printk() usage
Change-Id: I211f3b17103e3399ca1057fcc477d526f4076255
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-28 07:47:28 -04:00
Baohong Liu 4a8f65cccf samples: pwm: adapt to new api argument definition
Change the api argument format following the API
argument definition change in the driver. Some
definitions of CONSTANTs were changed accordingly.

Correct some comment error.

Jira: ZEP-642

Change-Id: I1b34640aa70f1597076e035e2b3b576d8337129a
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
2016-08-26 02:39:11 +00:00
Andrew Boie 2599c6075e Revert "sys_log: replace old debug macros at DMA sample"
This reverts commit 9a8ff013ab.

Change-Id: I1542d1275922671e89975479ec98e37d4b496eb3
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:26:29 -07:00
Andrew Boie c18ec01fdc Revert "sys_log: replace old debug macro on ADC driver sample."
This reverts commit eeb2b733e4.

Change-Id: I4174d3c91b78856266fc457f8107c0043bba0416
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:25:58 -07:00
Andrew Boie a713d4be6f Revert "misc: Remove generic PRINT macros from button samples"
This reverts commit 2939752a3e.

Change-Id: I36b8788938bcfa0db48ef618919a9821714096d0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:19:45 -07:00
Andrew Boie b3d65931a5 Revert "misc: Remove generic PRINT macros from aio samples"
This reverts commit b39399b069.

Change-Id: Idfa8e277af6f23c522f0afc4d4d0f29cb6bae307
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:19:45 -07:00
Andrew Boie 03c40a2685 Revert "misc: Remove generic PRINT macros from pci samples"
This reverts commit a0007012b7.

Change-Id: I72f4b8adfc33c833116fef9fc1cd8c542f3979b0
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:19:45 -07:00
Andrew Boie 83298d8020 Revert "misc: Remove generic PRINT macros from flash samples"
This reverts commit a6412042fb.

Change-Id: I190d418103bfdd3d6714d1ac063cc1e533ce60ad
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:19:45 -07:00
Andrew Boie 4bcefbba73 Revert "misc: Remove generic PRINT macros from spi samples"
This reverts commit ea3a836e7e.

Change-Id: I7ad5d5c77244b3cec3eaed45a0348610bae15dec
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:19:45 -07:00
Andrew Boie 701f0598a8 Revert "misc: Remove generic PRINT macros from sensor samples"
This reverts commit 107f38acf6.

Change-Id: I6c5aa1323da485fc7a04452537d67c797a18bba5
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-23 13:19:44 -07:00
Andrew Boie b1f206bc0f samples: pci_enum: build for sanitycheck
Change-Id: Ied0e889e2de102c5ccace64d51ac21672c53a231
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2016-08-15 09:38:53 -07:00
Juan Manuel Cruz Alcaraz 2939752a3e misc: Remove generic PRINT macros from button samples
Remove generic PRINT macros from button samples and replace
with SYS_LOG  module.

Jira: ZEP-240

Change-Id: Iae35d69a6a8473afdc1003ed629a21447a6f9a4a
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-05 20:36:56 +00:00
Juan Manuel Cruz Alcaraz b39399b069 misc: Remove generic PRINT macros from aio samples
Remove generic PRINT macros from aio samples and replace
with SYS_LOG  module.

Jira: ZEP-240

Change-Id: If50d8de2256f38902b5a4b68c57553cb5e8b8a94
Signed-off-by: Juan Manuel Cruz Alcaraz <juan.m.cruz.alcaraz@intel.com>
2016-08-05 20:36:56 +00:00