Commit graph

41120 commits

Author SHA1 Message Date
Paul Sokolovsky
bf070716d1 tests: mbedtls: Call mbedtls_platform_set_printf() only if needed
It exists only if MBEDTLS_PLATFORM_PRINTF_ALT is defined, whcih we
no longer do, but make the call condiitonal in case we'll need to
make it configurable later.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-23 09:27:59 -04:00
Paul Sokolovsky
af529d1158 libc: minimal: Implement exit()/_exit() functions.
Behavior is similar to newlib version: print "exit" message and go
into infinite loop.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-23 09:27:59 -04:00
Paul Sokolovsky
f0ea13d2a2 ext: mbedtls: Don't define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
That means that when mbedTLS will need functions like snprintf(),
printf(), a few others, they will be used from libc, as done
normally by most of software. Note that mentioned functions
aren't normally used on code paths doing TLS communication per se.
Instead, they are used by debug logging, additional "print info"
style functions, etc.

Before, when MBEDTLS_PLATFORM_NO_STD_FUNCTIONS was defined, those
functions were stubbed out, so silently didn't work as expected
(a specific symptom seen was that some debug messages were printed
as garbage, because an buffer on stack was passed to dummy snprintf
stub, which didn't do anything to it, and its uninitialized contents
were printed afterwards. Instead, the expectation was that an
application would call a "setter" function to set snprintf, etc.
implementations as provided by application itself.

For Zephyr, we clearly don't need to burden applications with such
setup, instead Zephyr, as an OS, provides integrated environment
were matters like that "just work". So, we just switch to libc-based
functions. If there ever will be usecases for
MBEDTLS_PLATFORM_NO_STD_FUNCTIONS, it can be made configurable later.

Fixes: #16303

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-23 09:27:59 -04:00
Jan Van Winkel
6b9e160b5a sanitycheck: Execute binary in output directory
Execute the test binary from the output directory instead of directory
where sanitycheck was started.

This will ensure that any artifact created with a relative path by the
test binary will be placed in the output directory instead of creating
the artifact in the directory where sanitycheck was executed and prevent
any possible conflicts.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-05-23 08:37:09 -04:00
Radoslaw Koppel
bf7b97bdf5 subsys/ztest: Documentation fix
Documentation moved to the right place.
The argument name of the macro is aligned between the macros.

Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
2019-05-23 08:35:06 -04:00
Brett Witherspoon
626349f16f drivers: adxl362: use burst transfer
It is recommended that multibyte (burst) transfers are used to read
acceleration and temperature data. This ensures the data is concurrent
and complete.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-23 06:55:38 -05:00
Maureen Helm
e0d7378712 boards: mimxrt1060_evk: Enable mcux lpi2c driver and pins
Enables the mcux lpi2c shim driver and pin muxes on the mimxrt1060_evk
board. Updates the board documentation and yaml supported list
accordingly.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-05-23 06:27:55 -05:00
Andrzej Głąbek
7f9f39fe3d boards: nrf52840_pca10059: Configure NFC pins as GPIOs by default
Since there is no NFC antenna connector on the dongle and the pins
P0.09 and P0.10 that are dedicated to NFC functionality are in the
group of just a few ones available for external connections, it seems
more reasonable to configure these pins by default as regular GPIOs,
as users will most likely want to use them in this way.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2019-05-23 07:01:05 -04:00
Wentong Wu
ec150d68e0 CODEOWNERS: Add code ownership for gen_relocate_app.py
Add myself as code owner for script gen_relocate_app.py.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-05-23 06:59:14 -04:00
Wentong Wu
cd92af1cab linker: kobject-text.ld: avoid backwards location counter
when kobject text area is greater than CONFIG_KOBJECT_TEXT_AREA,
there will be location counter backwards, change it to assert to
prompt configuring CONFIG_KOBJECT_TEXT_AREA larger.

Fixes: #16307.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-05-23 06:59:14 -04:00
Tedd Ho-Jeong An
fccb2e1ffc Bluetooth: GATT: Fix using a wrong handle
This patch fixes to use the right handle value.

Fixes #16341

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
2019-05-23 12:31:35 +03:00
Michael Scott
a923c2f1be net: openthread: fix off-by-one error in settings offset calculation
OpenThread uses CONFIG_OT_PLAT_FLASH_PAGES_COUNT to calculate the # of
pages at the end of flash to use for storing OpenThread settings.

This calculation has an off-by-one error which sets the offset for
the storage area as 1 page of flash too low.

For example, on nRF52840:
- default setting for CONFIG_OT_PLAT_FLASH_PAGES_COUNT is 4
- flash size is 1MB (0x100000)
- flash page size is 4096 (0x1000)
- expected offset is 0xfc000

Using the current logic we get an offset of: 0xfb000

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16339

Signed-off-by: Michael Scott <mike@foundries.io>
2019-05-23 10:47:20 +03:00
Kumar Gala
0d4290a2cb scripts/dts: Fix issue in label generation of registers
If we have something like:

       #address-cells = <1>;
       #size-cells = <0>;

       intc: ioapic@fec00000  {
	       compatible = "intel,ioapic";
	       reg = <0xfec00000 0x100000>;
       };

We should generate:

DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS_0
DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS_1

Instead we generated:

DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS
DT_INTEL_IOAPIC_FEC00000_BASE_ADDRESS_1

This was due to logic deciding if '_0' should be used not taking into
account #address-cells & #size-cells correctly.

Fixes: #16296

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 17:27:53 -05:00
Andrew Boie
fd49cf7d02 kernel: timeout: add syscall for runtime clk freq
If the system sets its clock frequency at runtime, this is
stored in a variable that can't be directly read by user
mode. For this case only, add a system call to fetch its
value and modify the definition of
sys_clock_hw_cycles_per_sec() to use it.

Since this is now a system call, store in a temporary variable
inside z_ms_to_ticks(). The syscall overhead only applies
when called from user mode, other contexts are completely
inlined.

Added stub syscall header for mocking framework, to get rid
of inclusion errors.

Fixes: #16238

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-05-22 23:33:55 +02:00
Kumar Gala
e541b16c54 boards: atmel: Enable hwinfo as a supported feature
Update the various board YAML files to list hwinfo as a supported
hwinfo.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 15:50:39 -05:00
Kumar Gala
9260561c63 dts: atmel: Fix node name for device_id
The node name for device_id was device_id@0 it should be
device_id@80a00c to reflect the first register region

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 15:50:39 -05:00
Jacob Siverskog
d145263691 doc: dfu: Fix module links
Link modules to their respective code directory.

Signed-off-by: Jacob Siverskog <jacob@teenage.engineering>
2019-05-22 12:41:09 -04:00
Antony Pavlov
8245195306 dts: import vendor-prefixes.txt from linux kernel
import linux-v5.1:Documentation/devicetree/bindings/vendor-prefixes.txt

Use vendor-prefixes.txt to check vendor prefixes
used in compatible strings and property names.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-22 12:40:20 -04:00
Antony Pavlov
f08148e640 scripts/checkpatch.pl: fix root dir detection and enable it
Don't try to find files specific for linux kernel.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-22 12:40:20 -04:00
Kumar Gala
343e16026e dts: x86: shring ioapic register size to 4k
Previous the register size was 1M, technically the there are only a
small handful of registers defined in the IOAPIC, so shrinking the size
to 4k, so its as most one page large.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 12:38:20 -04:00
Kumar Gala
e7cc51094a dts: x86: Move ioapic node out of cpu container
The IOAPIC node shouldn't have been in the cpu container, especially
since the cpu container does:

	#address-cells = <1>;
	#size-cells = <0>;

So the reg field of the IOAPIC would be treated as 2 registers instead
of a register and size.  Move IOAPIC node out of the CPU node fixes this
issue.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-22 12:38:20 -04:00
Marc Herbert
704b460b0d tests/bluetooth/tester: remove spurious CONFIG_GPIO=y
This tries to build gpio without any driver which fails at cmake time
like this:

CMake Error at ../../../cmake/extensions.cmake:378 (add_library):
  No SOURCES given to target: drivers__gpio
  Call Stack (most recent call first):
  ../../../cmake/extensions.cmake:355 (zephyr_library_named)
  ../../../drivers/gpio/CMakeLists.txt:3 (zephyr_library)

Remove TEST_USERSPACE workaround added in commit 3b53e69249 which
added gpio_handlers.c to the SOURCES.

Fixes #15232.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-05-22 10:54:40 -04:00
Anas Nashif
4a5751226c qmsi: move to a zephyr module
Adds https://github.com/zephyrproject-rtos/hal_qmsi as a module managed
by west.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-05-22 09:28:56 -04:00
Danny Oerndrup
025ffa2492 cmake: Toolchain abstraction: Abstraction of implicit-int error flag
Introducing the macro toolchain_cc_warning_error_implicit_int which,
abstracts the implicit_int error flag thus leaving it to the toolchain
to decide whether this flag is needed or not.

The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.

No functional change expected.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-05-22 15:28:07 +02:00
Danny Oerndrup
8e5a95e4df cmake: Toolchain abstraction: Introduce macros for MISRA SANE flags
The macros are named toolchain_cc_warning_error_misra_sane and
toolchain_cc_cpp_warning_error_misra_sane

These macros provide toolchain specific flag(s) relating to the MISRA
SANE configuration option.
The macros will place the flag(s) in a variable provided by caller,
which can then add to zephyr compile options.

The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.

No functional change expected.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-05-22 15:28:07 +02:00
Danny Oerndrup
8eaa906836 cmake: Toolchain abstraction: Added missing colon to some <at>Intent's
No functional change expected.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-05-22 15:28:07 +02:00
Asger Munk Nielsen
69790e5c73 Bluetooth: controller: Enable use of proprietary rx demuxing functions
Code refactored to allow calling of a proprietary rx demux function.
This will enable implementation of proprietary protocols and
functionality that is not yet public, while keeping a common zephyr
code base.

Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
2019-05-22 14:59:30 +02:00
Andrei Emeltchenko
03ef375f5f drivers: usb: usb_dc_nrfx: Set cfg.en to false on Reset
Set false to enable flag on USB Reset.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-22 11:19:49 +02:00
Andrei Emeltchenko
a95f6385f2 usb: device: Do not return error if ep already enabled
Fixes USB3CV Tool tests. One case is enabling endpoints with Set
Interface after Set Configuration. In this case we report warning and
continue without returning error.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-22 11:19:49 +02:00
Andrei Emeltchenko
1370f16287 usb: device: Disable endpoints on disconnect and suspend
Disable endpoints on following events: USB_DC_DISCONNECTED
and USB_DC_SUSPEND.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-22 11:19:49 +02:00
Andrei Emeltchenko
9f2ddc9f8e usb: webusb: Trivial syntax fix
Fix supended -> suspended.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-22 11:19:49 +02:00
Andrei Emeltchenko
83f625b4cc usb: device: Add debug logs catching re-enable failures
Add extra logs catching problem with re-enabling endpoints.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-22 11:19:49 +02:00
Andrei Emeltchenko
437ee504fa usb: device: Cancel all transfers on disconnect
Cancel all usb transfers when receiving USB_DC_DISCONNECTED.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-22 11:19:49 +02:00
Andrei Emeltchenko
f206170c65 usb: device: Do not call callback when transfer is cancelled
Only call callback when transfer is not cancelled.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-22 11:19:49 +02:00
Andrei Emeltchenko
bf76b2acc3 usb: device: Add transfer cancel helper
Add usb_cancel_transfers() helper to cancel all ongoing transfers.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-22 11:19:49 +02:00
Andrzej Puzdrowski
54000fb886 fs/nvs: fix startup for 2-sectors configuration
This patch fixes following bug:

After first GC operation the 1st sector had become scratch
and the 2nd sector had became write sector. After that NVS
was initialize (via reboot) again - it recognized the 1st
sector as write sector and 2nd as undone GC destination sector,
therefore it cleared 2nd sector and  re-run GC, which implied data loss.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-05-22 10:22:53 +02:00
Kamil Piszczek
b76edc1a1d tests: fs: nvs: garbage collector test
Added a simple test for the NVS Garbage Collector.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-22 10:22:53 +02:00
Kamil Piszczek
35a9299a76 tests: fs: nvs: test cases clean up flash on completion
Modified tests for the NVS to clean up the flash memory at the end of
their execution.

Signed-off-by: Kamil Piszczek <Kamil.Piszczek@nordicsemi.no>
2019-05-22 10:22:53 +02:00
Henrik Brix Andersen
cfa32af7f0 drivers: led: ht16k33: add missing variable initialization
Add missing initialization of a variable in the HT16K33 LED driver.

Fixes #16164.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-05-21 23:09:56 -04:00
Charles E. Youse
9ab293b919 tests/kernel/sleep: add tests for k_usleep() API
Test that k_usleep() allows sleep durations near the limit of what
the platform's tick rate will allow.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-21 23:09:16 -04:00
Charles E. Youse
a567831bed kernel/sched.c: add k_usleep() API function
Add k_usleep() API, analogous to k_sleep(), excepting that the argument
is in microseconds rather than milliseconds.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-21 23:09:16 -04:00
Charles E. Youse
b186303cb6 kernel/sched.c: refactor k_sleep() implementation for varied timescales
Current z_impl_k_sleep() does double duty, converting between units
specified by the API and ticks, as well as implementing the sleeping
mechanism itself. This patch separates the API from the mechanism,
so that sleeps need not be tied to millisecond timescales.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-05-21 23:09:16 -04:00
Anas Nashif
2f126bb51f doc: document submitting changes to modules
Instructions for submitting changes to modules and how they will be
integrated with the main tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-05-21 21:45:00 -04:00
Anas Nashif
9d3be3720a doc: move module related doc to guides
Move to a new guide which will expand on how to submit modules and how
to maintain them.

Also move topology documentation to repository management section where
it fits better.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-05-21 21:45:00 -04:00
Peter A. Bigot
ea6cad9b89 Bluetooth: controller: remove duplicated code
A conditional block to save a directed advertising report flag was
present three times.  Remove two of the blocks.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-05-21 21:42:01 -04:00
Michael Scott
c124cdbb37 boards: arm: particle_boron: fix SARA-R4 gpio definitions
These definitions were left incorrect after a gpio-map change was
added to the PR introducing the boron support for the SARA-R4 modem.

Correct the gpio defintions here so that the boron build doesn't
break.

Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16289

Signed-off-by: Michael Scott <mike@foundries.io>
2019-05-21 21:41:16 -04:00
David B. Kinder
cd6ba94bd4 doc: add references to builds mailing list
builds@lists.zephyrproject.org archives the CI build results for every
and nightly build.  Add references to this in the contribution
guidelines and introduction (pulled from README).

Also added a reference to the "Asking for Help" doc (there was a note to
add this once that doc was merged).

Fixes: #15652

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2019-05-21 21:40:20 -04:00
Joao Cordeiro
74f01067e7 samples: bluetooth: peripheral: Fix RX buffer size
GATT long messages require buffers to store multiple packets. The actual
configuration for the bluetooth peripheral sample defines only two
buffers to store these messages. As the default ATT payload size is
18 bytes, the maximum payload size for a long ATT message is 36 bytes.
As the variable `vnd_long_value[]` has a defined size of 74 bytes, it
cannot be fully modified due to the 36 bytes limitation.

Set CONFIG_BT_ATT_PREPARE_COUNT=5 so all the maximum payload size goes
to 90 bytes and all the 74 bytes can be written to `vnd_long_value[]`.

Signed-off-by: Joao Cordeiro <jvcc@cesar.org.br>
2019-05-21 16:15:44 -04:00
Derek Hageman
1202407b0c drivers: i2c: sam0: Fix missing break in speed setup
There was a missing break at the end of the high speed setup case,
so it would always return -ENOTSUP even when the high speed baud
was available.

Signed-off-by: Derek Hageman <hageman@inthat.cloud>
2019-05-21 15:57:21 -04:00
Brett Witherspoon
4817f41399 boards: cc1352r1_launchxl: enable support for I2C
Enable I2C support on the CC1352R LaunchPad.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-21 15:37:22 -04:00