Commit graph

2692 commits

Author SHA1 Message Date
Anas Nashif 3a0a592583 samples: hello_world: disbale asserts on single thread (REVERTME)
For some reason, single thread is stuck when asserts are enabled.

This is tracked in #5733.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif 40188a8449 samples: exclude some platforms due to bug [REVERTME]
Do not build for some unsupported architecture and exclude ARM qemu
platform due to bug #5735.

STACK_ALIGN 0x8
MPU STACK GUARD Test
Canary Initial Value = 0xf0cacc1a threads 0x200010e0
Canary = 0x20000240    Test not passed.
***** BUS FAULT *****
  Executing thread ID (thread): 0x200010e0
  Faulting instruction address:  0x209c
  Imprecise data bus error
Fatal fault in thread 0x200010e0! Aborting.
***** HARD FAULT *****
  Fault escalation (see below)
***** BUS FAULT *****
  Executing thread ID (thread): 0x200010e0
  Faulting instruction address:  0x1f4
  Imprecise data bus error
Fatal fault in ISR! Spinning...

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif 04035d19bc tests: nfc_hello: remove filter and support harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif a7a1e393ab tests: mem_domain_apis: remove filter and support harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif 9f6147395f tests: mpu_stack_guard: remove filter and support harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif d2b7749428 samples: event_logger: remove filter and support harness
Evaluate output from sample and record success/failure.

Enable on other platforms, this should not be whitelisted.

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
Anas Nashif 5ba7eed255 samples: philosophers: test more scenarios
Enable 2 additional documented scenarios:
- preempt only
- coop only

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif d6cc2909b8 sample: kernel_event_logger: cleanup headers
Remove unused and duplicated header inclusion.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif 1b1b7091ff sample: cpp_synchronization: support console harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif 5c8124f96b sample: philosophers: support console harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif 4843c69f06 sample: external_lib: support console harness
Evaluate console output of sample.

Enable on other platforms, this should not be whitelisted.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif a442987b02 sample: hello_world: support console harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Anas Nashif dfbc0f5efb sample: synchronization: support console harness
Evaluate console output of sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-25 04:45:35 +05:30
Vincent Veron 8310c53200 sample: sensor: Add vl53l0x sample application
This sample application allows to test vl53l0x distance sensor.
By default it is built with disco_l475_iot1 board as it is
built-in.

Signed-off-by: Vincent Veron <vincent.veron@st.com>
2018-01-23 10:14:49 -06:00
Paul Sokolovsky 6bab4998ba samples: net: zperf: Fix only IPv4/only IPv6 build, better messages
The code couldn't really build with only CONFIG_NET_IPV4 or
CONFIG_NET_IPV6 enabled, because some parts weren't covered
by #ifdef's. Regroup the code to get it covered.

Also, improve error/notice messages.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-01-22 10:15:27 +02:00
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
Anas Nashif ff0d690e79 samples: shell: add standalone version command
Combine modules with standalone commands.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-19 12:01:08 -05:00
Anas Nashif fa7f13ef00 shell: rename sample to be less generic
This sample implements a custom module, so rename it to allow for other
samples with specific features.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-19 12:01:08 -05:00
Anas Nashif dd013691b2 shell: add a shell banner
Give details about running version and add a line about usage.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-19 12:01:08 -05:00
Carles Cufi 72046a8abc doc: getting_started: Support multi-OS instructions
In order to be able to document the build on Windows and UNIX
systems, slight variations are required on the app commands
that are used throughout the documentation system.

This includes getting rid of the prompt symbol and providing commands
for both UNIX and Windows operating systems.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-01-18 16:53:31 -05:00
Andrei Emeltchenko 314d182f79 samples: zperf: Add USB RNDIS configuration check
Add configuration for zperf sample allowing to build USB dongle with
zperf for testing.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05:00
Andrei Emeltchenko 7e80f41162 usb: Rename SYS_LOG_USB to SYS_LOG_USB_DEVICE
At the moment CONFIG_SYS_LOG_USB_LEVEL name does not specify that this
is log level for the Device Stack. Make it clear renaming to the
proper name.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05:00
Andrei Emeltchenko 6e17e71fb5 samples: Correct default SYS_LOG_USB and SYS_LOG_USB_DRIVER levels
Making configuration files useful.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2018-01-17 18:53:05 -05: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
Erwan Gouriou 0a3d9933c2 sample: fix configuration for sensor HTS221 sample application
Since no GPIO trigger is configured in hts221 sample application,
update prj.conf to enable TIGGER_NONE flag


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-01-13 09:06:58 -08: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
Yannis Damigos 4b7f3e75dd samples: bmi160: Add testcase filter for SPI_LEGACY_API
Don't run testcase if CONFIG_SPI_LEGACY_API is false.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-01-11 14:35:45 -06:00
Yannis Damigos d907ed309e samples: bme280: Add testcase filter for SPI_LEGACY_API
Don't run testcase if CONFIG_SPI_LEGACY_API is false.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-01-11 14:35:45 -06:00
Anas Nashif a2002e6069 samples: nfc: update README
Update README for usage with CMake.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-11 12:50:14 -05:00
Tomasz Bursztyka 5195ddf472 drivers/ieee802154: Cleanup Kconfig
A very old reference to former net stack was still lurking around.
Removing it.

Taking the opportunity to clear up dependencies.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2018-01-10 21:53:01 -05:00
Sebastian Bøe 4d9499cbeb cmake: external_lib: Specify that the library should be GLOBAL
Having a library being GLOBAL, although not default behaviour, or
necessary for the sample, is expected behaviour for a library. It is
expected that like normal libraries, the target name will be
accessible from outside of the CMakeLists.txt file that created it.

Since samples are used as reference code, we specify GLOBAL so that
libraries are created with this intuitive behaviour.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-09 11:44:40 -05:00
Anas Nashif 9512f0ddf3 samples: rpl: do not build when assert is enabled
Was failing due to increased size of binary.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-09 11:13:08 -05:00
Anas Nashif 4d2ad0a8a5 Bluetooth: remove unused BT_DEBUG_COLOR
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-09 10:59:41 -05:00
Anas Nashif 2735c15120 samples: fix amg88xx sample.yaml syntax
Was still using old synatx.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 14:45:38 -05:00
Sebastian Bøe 830b8bdc17 samples: threads: Rewrite misleading sample
The basic/threads sample is printing a log that looks like this:

Toggle USR0 LED: Counter = 0
Toggle USR1 LED: Counter = 0
Toggle USR0 LED: Counter = 1
Toggle USR0 LED: Counter = 2
Toggle USR0 LED: Counter = 3
Toggle USR0 LED: Counter = 4

From that log you would think that it was logging when leds were
blinking, but actually the led-threads might have crashed, and it
would just continue logging anyway. All it's doing is executing
printk's at roughly the same frequency as the LED's are blinking.

This patch rewrites the sample to use a FIFO so that the printk's only
trigger if the LEDs are actually blinking.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-08 14:25:11 -05:00
Anas Nashif 33592e8aa8 cmake: remove IS_TEST handling
Depending on a path inside the Zephyr tree to determine if we are a test
does not scale. Also some samples were marked as TEST while they are
not, just to get some options defined for tests.

Idenitfying a test will be addressed in another patch introducing
CONFIG_TEST.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 10:03:57 -05:00
Anas Nashif 94066e0f15 tests/samples: remove unknown option LOG_CBUFFER/LOGGER_BACKEND
Those options are not part of Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 08:08:45 -05:00
Anas Nashif c78296dab4 tests: remove obsolete CONFIG_MDEF
CONFIG_MDEF is no more..

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-08 08:08:45 -05:00
Johann Fischer 7817622b4b samples: sensor: add amg88xx sample
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
2018-01-07 16:04:45 -05:00
Punit Vara 71948788eb tests: logger-hook: convert sample to ztest and move to test/
issue: #3302

Signed-off-by: Punit Vara <punit.vara@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-01-05 18:17:59 -05:00
Sebastian Bøe 47542598b6 cmake: Ninja: Fix the external_lib sample
This samples was failing to build with Ninja because Ninja detected
that libmylib.a was missing. Adding it as a BYPRODUCT in the
ExternalProject fixes the issue.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-03 13:19:59 -05:00
Sebastian Bøe 6f642a19fd cmake: Ported mbedTLS to use Zephyr interface libraries
mbedTLS include directories will now default to be in the 'app'
include path when mbedTLS has been enabled.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-01-02 22:09:01 -05:00
Ravi kumar Veeramally a0371ae92f net: tcp: Add initial support for TIMEWAIT timer
Right now in FIN_WAIT1 state, if we receive FIN+ACK message, then
tcp state changed to FIN_WAIT2 on ACK flag and immediately on FIN
flag state changed to TIME_WAIT. Then final ACK is prepared and sent
(in queue at-least) to peer. Again immediately state changed to
TCP_CLOSED, where context is freed. net_context_put frees context
and releases tcp connection. Final ACK packet which is in queue
is dropped.

As a side effect of freed ACK packet, peer device keep on sending
FIN+ACK messages (that's why we see a lot of "TCP spurious
retransimission" messages in wireshark). As a result
of context free (respective connection handler also removed), we see
lot of packets dropped at connection input handler and replying with
ICMP error messages (destination unreachable).

To fix this issue, timewait timer support is required. When tcp
connection state changed to TIMEWAIT state, it should wait until
TIMEWAIT_TIMETOUT before changing state to TCP_CLOSED. It's
appropriate to close the tcp connection after timewait timer expiry.

Note: Right now timeout value is constant (250ms). But it should
be 2 * MSL (Maximum segment lifetime).

Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
2017-12-31 11:58:27 -05:00
Anas Nashif eba1bbd705 samples: remove more build_only tags
Remove build_only and add harness type needed for the sample/test to
allow running with sanitycheck and on devices once we have harness
support.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif bca9c456d2 samples: remove build_only from various samples
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -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 b5b8095749 samples: bluetooth and net samples need test setup
remove build_only and make them depend on test harness (bluetooth)

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 6e7de15680 samples: TMP112: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 9f0e1b82f0 samples: TH02: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif c98513e6a5 samples: sx9500: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 31a23dca68 samples: mcp9808: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif a6119ee105 samples: max30101: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 482feb45e4 samples: bmi160: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 159e0a2167 samples: magn_polling: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 0448642b33 samples: hts221: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 42ac8abdc3 samples: fxos8700: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 1ac3cc9347 samples: fxas21002: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 21787c8d1a samples: bmi150: fix dependencies and test cleanup
Remove ARC unrelated configs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 200b2459cf samples: bmg160: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif da9a59e233 samples: bme280: fix dependencies and test cleanup
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif e7c009eec9 samples: apds9960: fix dependencies
depend on i2c and gpio drivers being available.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif 468e3f7a11 samples: apds9960: remove arc related configs
Also remove unused STDOUT_CONSOLE

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-28 20:24:29 -05:00
Anas Nashif c9d6b289c7 samples: pwm: depend on boards supporting PWM
Still need a better way to filter and a better way to support multiple
platforms with these tests, but for now we remove the build_only tag and
make it depend on real HW.

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
Alberto Escolar Piedras 04c7620580 native: blacklisted 3 testcases
The following 3 testcases are blacklisted for the POSIX
arch / simple_process BOARD:
* tests/drivers/ipm : won't compile due to missing
   __stdout_hook_install()  [part of minimal libc]
  (POSIX arch uses the native libc)
* tests/kernel/mem_protect/stackprot : will crash
  "natively" when trying to corrupt the stack and therefore
  will fail the testcase. The current understanding is that
  the POSIX arch should let the native OS handle faults,
  so they can be debugged with the native tools.
* samples/cpp_synchronization : it is not possible
  to build cpp code yet on top of the posix arch

Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
2017-12-27 14:16:08 -05:00
Ramakrishna Pallala b82dfb479b samples: boards: add sample for Altera Nios-II PIO core
Add a sample application for Nios-II PIO core on Altera MAX10 board.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2017-12-21 12:02:24 -08:00
Sebastian Bøe cf6cb590df cmake: Don't link with subsys__bluetooth unnecessarily
It is only necessary to link with subsys__bluetooth if the path
"subsys/bluetooth" is needed as an include directory. None of the
samples have this need.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-19 12:46:03 -05:00
Anas Nashif e2122cbf89 lib: move ring_buffer from misc/ to lib/
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-15 20:02:01 -05:00
Michael Scott 2fc554b8fc crypto: config: config-coap: add CONFIG for setting max content length
The CoAP samples use an MBEDTLS config "config-coap.h" which could be
re-used by the LwM2M sample, except that most servers use a larger
maximum content length setting of 1500 bytes.

Let's add a CONFIG to set this for users of the CoAP lib and set the
CONFIG value for the samples to the 256 size currently used.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-12-15 17:52:13 -05:00
Michael Scott 5f4c7fcf5c samples: lwm2m: update documentation for DTLS support
- Mention the prj_dtls.conf setting
- Explain setting up security in the Leshan Demo Server web UI.

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-12-15 16:46:48 -05:00
Michael Scott 100f8273dd samples: lwm2m: add support for DTLS
To test, use -DCONF_FILE=prj_dtls.conf

Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
2017-12-15 16:46:48 -05:00
Kumar Gala dfce457ebe samples: mesh/onoff-app: fix whitelist typo
Board name is nrf52840_pca10056 (with an underscore) instead of
nrf52840-pca10056 (with a dash).

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-12-14 14:02:09 -05:00
Anas Nashif 2c96dacf0a samples: mesh/onoff-app: fix sample.yaml syntax
Also, remove build_only, we can run on the whitelisted platform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-14 13:04:51 -05:00
Steve Brown bce1b974f0 samples: onoff-app: Add OnOff Model for the Nordic nRF52840-PDK board
Signed-off-by: Steve Brown <sbrown@cortland.com>

---

The updates to BlueZ' meshctl have not been submitted.

I am submitting this PR only for review. It could be committed
after the patches for the meshctl commands are applied.
2017-12-14 08:27:05 +02:00
qianfan Zhao b4f45b8a1d samples: webusb: fix array length in Product and SN string descriptors
Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
2017-12-12 09:28:42 -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
Sebastian Bøe 1588125672 samples: Don't read board from cmake -DBOARD=x
The CMakeLists.txt file was reading ${BOARD}, but this means the user
must set BOARD like this cmake -DBOARD=foo. The user must be allowed
to set BOARD from the environment.

The code was unnecessary anyway because the convention
prj_${BOARD}.conf is known by boilerplate and therefore not necessary
to specify.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-11 09:06:48 -05:00
Sebastian Bøe b7fa4f1e29 samples: echo_server: Test the nrf build in CI
This introduces an nrf build to CI for the echo_server sample. Doing
so ensures that https://github.com/zephyrproject-rtos/zephyr/pull/5018
cannot regress again.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-06 11:11:59 -06:00
Anas Nashif abbaac9189 cleanup: remove nanokernel/nano leftovers
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-12-05 09:44:23 -06:00
Sebastian Bøe 89516fbc25 cmake: Change the zephyr_get_* API to be LANG-aware
When exporting flags to an external build system we need to deal with
the fact that we sometimes use generator expressions. Specifically, we
use generator expressions that look like this:

$<$<COMPILE_LANGUAGE:CXX>:-fno-exceptions>

This patch replaces the old API with a new one where users can ask for
compile options for specific languages, like this:

zephyr_get_compile_options_for_lang_as_string(CXX x)

The existing API would have either crashed or silently omitted flags
when a COMPILE_LANG generator expression was present.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2017-12-05 10:08:40 -05:00
Kumar Gala 6b38f57225 Add missing license and copyright headers
The following files didn't have any copyright or license headers on them
when they got contributed.  So add the SPDX Apache license and
appropriate copyright info:

boards/arm/stm32l476g_disco/pinmux.c
samples/basic/threads/src/main.c
tests/net/socket/tcp/src/main.c

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2017-12-05 08:21:05 -06:00
Anas Nashif 467b3401e3 samples: logger-hook: remove unused configs
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-11-27 22:15:30 -05:00
Johan Hedberg 48aecd1513 Bluetooth: Mesh: Add IV Update test mode API
This makes it possible to pass all IV Update tests without having to
build a custom configuration for some of the tests. We also disable
the feature in all sample configurations, but leave it on in the
tests.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-27 10:17:54 +02:00
Jukka Rissanen 6faf997b97 samples: net: echo-server: Fix compilation with mbedtls
The echo-server compilation failed because mbedtls config file
was not found. Added suitable magic to CMakeLists.txt fixing that.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 18:45:35 -05:00
Jukka Rissanen 37247bda78 samples: net: zperf: Ignore error when creating TCP sample pkt
When sending TCP sample packet, just fill the packet to max and
ignore any overflow error.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 10:10:31 -05:00
Tomasz Bursztyka b52c0f24a6 net/ieee802154: Make RAW mode generic
- Renaming NET_L2_RAW_CHANNEL to NET_RAW_MODE
- Create a generic IEEE 802.15.4 raw mode for drivers
- Modify the IEEE 802.15.4 drivers so it passes the packet unmodified,
up to code using that mode to apply the necessary changes on the
received net_pkt according to their needs
- Modify wpanusb/wpan_serial relevantly

Fixes #5004

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2017-11-22 10:10:09 -05:00
Jukka Rissanen 93c426e778 samples: net: zperf: Check UDP pkt before accessing it
Check that we do not try to access fragment when UDP packet is
received if pkt is NULL. In practice this should not happen for
UDP but do the checks in proper order anyway.

Coverity-CID: 179252
Fixes #5057

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Jukka Rissanen f7f671d18b samples: net: zperf: Check pkt before accessing it
The pkt was accessed before NULL check.

Coverity-CID: 179250
Fixes #5059

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Jukka Rissanen b0b053e91e samples: net: zperf: Remove deadcode
As we are checking that pkt is not NULL already in the start
of the function, remove the checks later in the code in function
zperf_tcp_receiver.c:tcp_received()

Coverity-CID: 179248
Fixes #5061

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-22 07:44:10 -05:00
Johan Hedberg 4fe3e03152 Bluetooth: samples/mesh_demo: Fix address handling
Clean up and fix the address handling.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 13:30:30 +02:00
Johan Hedberg e31102c890 Bluetooth: samples/mesh_demo: Remove unused model publication
This app isn't (at least yet) using the model publication for
anything, and in fact this could cause trouble due to missing
publication net_buf_simple buffer.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 12:53:54 +02:00
Johan Hedberg 8f1541184f Bluetooth: Mesh: Fix non-periodic Model Publication
The only generally available model supporting publication that's
convenient to be used for testing is the Health Server Model.
Unfortunately since this model supports period publication, the
non-periodic side got less attention and had some bugs.

The first thing that needs to be done is to verify that the period
returned by bt_mesh_model_pub_period_get() is positive. If it's zero
then no periodic publication should take place.

Another thing that this patch cleans up is the naming of the callback
used for periodic publishing. There's no need do require the callback
to call bt_mesh_model_publish() since this must happen no matter what,
so instead rename the callback from 'func' to 'update' and have the
access layer call bt_mesh_model_publish() if the callback was
successful.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-22 12:53:54 +02:00
Jukka Rissanen 9d99691e7b samples: net: echo_client: Only send allowable number of bytes
Honor the device MTU when sending data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-20 16:39:36 -05:00
Jukka Rissanen d206ad2799 samples: net: echo-client: Fix compilation with mbedtls
The echo-client compilation failed because mbedtls config file
was not found. Added suitable magic to CMakeLists.txt fixing that.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2017-11-20 16:39:09 -05:00
Johan Hedberg e7bb76e2b6 Bluetooth: Mesh: Fix model publication
Model publication was broken in a couple of ways:

 - The Publish Retransmit State was not taken into account at all
 - Health Server used a single publish state for all elements

To implement Publish Retransmit properly, one has to use a callback to
track when the message has been sent. The problem with the transport
layer sending APIs was that giving a callback would cause the
transport layer to assume that segmentation (with acks) is desired,
which is not the case for Model Publication (unless the message itself
is too large, of course). Because of this, the message sending context
receives a new send_rel ("Send Reliable") boolean member that an app
can use to force reliable sending.

Another challenge with the Publish Retransmit state is that a buffer
is needed for storing the AppKey-encrypted SDU once it has been sent
out for the first time.To solve this, a new new net_buf_simple member
is added to the model publication context. The separate 'msg' input
parameter of the bt_mesh_model_publish() API is removed, since the
application is now expected to pre-fill pub->msg instead.

To help with the publishing API change, the Health Server model gets a
new helper macro for initializing the publishing context with a
right-sized publishing message.

The API for creating Health Server instances is also redesigned since
it was so far using a single model publishing state, which would
result in erratic behavior in case of multiple elements with the
Health Server Model. Now, the application needs to provide a unique
publishing context for each Health Server instance.

The changes are heavily intertwined, so it's not easily possible to
split them into multiple patches, hence the large(ish) patch.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2017-11-20 15:00:29 +02:00