Commit graph

41264 commits

Author SHA1 Message Date
Andrei Emeltchenko
875d5a2bf6 tests: usb: desc_sections: Fix coverity issue
Coverity thinks that zassert_*() is debug stuff so move out increment.

Fixes #16163

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-17 08:06:28 -07:00
Kumar Gala
34bf5dd50a CODEOWNERS: Add codeowner for include/dt-bindings/usb/usb.h
Update CODEOWNER for new include/dt-bindings/usb/usb.h file.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-17 09:53:20 -05:00
Kumar Gala
2cac70e099 dts: bindings: usb: Add enum to maximum-speed property
Add enum to list what values of maximum-speed are exceptable since
enum's get represented as strings in DT.  This also allows us to
generate a code enum to correspond to the string.

We also introduce include/dt-bindings/usb/usb.h which is a hand coded
definition of the enum.  We don't have a great way to generate this
right now, however it would be better if we did.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-17 09:53:20 -05:00
Kumar Gala
983b493ac1 scripts/dts: Add support for enum's
Add specific enum generation support related to usb 'maximum-speed'
property.  This will generate a define with _ENUM with the integer
value of the enum as its ordered in the YAML.  The assumption right
now is that there's a matching enum in the code.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-05-17 09:53:20 -05:00
Luiz Augusto von Dentz
852b1dca55 Bluetooth: GATT: Fix not parsing result of Read by Type
When using the procedure Read By Type the response may contain multiple
instances so it needs to be parsed properly. When dealing with long
values only the beggining will be read, for the remaining bytes the
application should issue another bt_gatt_read with offset so Read Blob
procedure is used as recommended by the spec:

BLUETOOTH CORE SPECIFICATION Version 5.1 | Vol 3, Part F page 2312:

The Read Blob Request would be used to read the remaining octets of a
long attribute value.

Fixes #16107

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2019-05-17 15:29:37 +03:00
Wentong Wu
fc3270d09c tests: kernel: increase stack buffer when code coverage enabled
increase stack buffer when code coverage enabled.

Fixes: #15794.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-05-16 09:29:55 -07:00
Wentong Wu
7aecb03864 arch: arm: switching stack pointer with assembly code
With -O0 optimizion, gcc compiler doesn't inline "static inline"
marked function. So when function call return from function
set_and_switch_to_psp which is to switch sp from MSP to PSP, the
ending "mov sp, r7" instruction will overwrite the just updated
sp value(PSP) with the beginning stack pointer(should be MSP)
stored in r7 register, so the switch doesn't happen. And it causes
unpredictable problems in the initialization process, the backward
analysis for this problem can be found on Github issue #15794.

Fixes: #15794.

Signed-off-by: Wentong Wu <wentong.wu@intel.com>
2019-05-16 09:29:55 -07:00
Paul Sokolovsky
a2fa8e9c1c net: getaddrinfo: Implement initial handling of host == NULL
If host is NULL and ai_flags are AI_PASSIVE in a call to
getaddrinfo(), need to return "any" address.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-05-16 16:11:10 +03:00
Phil Erwin
ef621160f8 cmake: Fix missing dependency
KOBJ_OTYPE should depend on any changes to the tool that generates it,
gen_kobject_list.py.

Signed-off-by: Phil Erwin <erwin@lexmark.com>
2019-05-16 07:47:18 -05:00
Andrei Emeltchenko
b364b841cc usb: webusb: Fix callback not called
Until PR #15818 is applied we need to use this solution to get
callback called.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
2019-05-16 07:17:50 -05:00
Øyvind Rønningstad
79d2e31cff scripts: mergehex: Add --overlap argument
Allows specifying the 'overlap' argument in IntelHex::merge().
This is identical to the --overlap argument in hexmerge.py, which
is bundled with IntelHex.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2019-05-16 07:16:55 -05:00
Brett Witherspoon
61fb6b468d drivers: gpio_c13xx_cc26xx: fix control flow issue
The value of GPIO_INT_ACTIVE_LOW is 0, so the bit checking if statement
is never executed. Use GPIO_INT_ACTIVE_HIGH when checking this bit.

Fixes #16162

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-16 07:09:58 -05:00
Ulf Magnusson
9b6c2f4bf3 c++: kconfig: Fix choice dependencies and use 'menuconfig' symbol
- Make the 'C++ Standard' choice depend on CPLUSPLUS, so that it only
   shows up when C++ support is enabled.

   Also check that CPLUSPLUS is enabled before checking the standard in
   the top-level CMakeLists.txt, to avoid triggering an assert.

 - The 'C++ Options' menu now contains just CPLUSPLUS and its indented
   children. Remove one menu level by removing the menu and turning
   CPLUSPLUS into a 'menuconfig' symbol. Also change the prompt from
   "Enable C++ support for the application" to just "C++ support for the
   application", to make it consistent with e.g. "Logging".

 - Factor out the common CPLUSPLUS dependency with an 'if CPLUSPLUS'.

 - Order symbol properties more consistently with other Kconfig files,
   with the prompt at the top, etc.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-16 07:08:21 -05:00
Andy Doan
cbecaddff1 sanitycheck: Add a "test-only" option
This makes it easy to re-run tests from an existing build directory
w/o trying to rebuild artifacts.

Signed-off-by: Andy Doan <andy@foundries.io>
2019-05-16 07:08:01 -05:00
Andy Doan
79c48849fe sanitycheck: Allow custom arguments for west-flash
This allows you to use west to flash the device and pass custom
arguments to the flash command.

Signed-off-by: Andy Doan <andy@foundries.io>
2019-05-16 07:08:01 -05:00
Marti Bolivar
b3674f596b scripts: fix west TypeError on unknown arguments
Let's not mess with CommandContextError here, as the APIs have gotten
messed around a bit in various versions. Just use log.die() as that
will work with current and future west versions, and is clearer anyway.

Fixes west 247.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-05-16 14:00:53 +02:00
Marti Bolivar
6cb8e3ec53 doc: move sign command docs before catch-all page
The current order makes no sense. Move it earlier in the order, so the
catch-all page appears last.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-05-16 13:49:10 +02:00
Marti Bolivar
64c6a10bd1 doc: updates to west multi-repo docs
Minor updates.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-05-16 13:49:10 +02:00
Marti Bolivar
90276c28cd doc: updates for west installation docs
Grammar and formatting improvements, as well as changes requested in
review that weren't made (in particular, the ones recommending using
"pip3 show -f west" to see where west is installed instead of listing
common places that might not be right.

Signed-off-by: Marti Bolivar <marti.bolivar@nordicsemi.no>
2019-05-16 13:49:10 +02:00
Mieszko Mierunski
c4d90aabba tests: uart: Add long tranfer test to UART_ASYNC_API.
Add test where transfer time is longer than rx timeout.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-05-16 13:47:07 +02:00
Mieszko Mierunski
7b0576243a drivers: nrf: Fix long receptions in UARTE async API.
If reception was longer than rx timeout, UART_RX_RDY event
would provide data with delay, and synchronise at buffer end.

This change makes sure that all data is given to user when timeout
occurs.

Signed-off-by: Mieszko Mierunski <mieszko.mierunski@nordicsemi.no>
2019-05-16 13:47:07 +02:00
Antony Pavlov
a7a625098e boards/arm/olimexino_stm32: register led1
Make it possible to run basic/disco sample on olimexino_stm32.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
2019-05-15 20:51:17 -05:00
Karl Zhang
d75f3cede8 sample: mhu: IPM MHU dual core on V2M Musca
Sample walk through:
    1. CPU 0 will wake up CPU 1 after initialization
    2. CPU 1 will send to CPU 0 an interrupt over MHU0
    3. CPU 0 return the same to CPU 1 when received MHU0 interrupt
    4. Test done when CPU 1 received MHU0 interrupt

The wake up second core and private core ID are soc specific.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2019-05-15 15:37:50 -05:00
Karl Zhang
2a7824a8b0 drivers: ipm: mhu: Add MHU driver for V2M Musca
MHU (Message Handling Unit) enables software to raise interrupts to
the processor cores. It is enabled in SSE 200 subsystems.

This patch aims to implement inter processor communication.

Signed-off-by: Karl Zhang <karl.zhang@linaro.org>
2019-05-15 15:37:50 -05:00
Brett Witherspoon
07d21bef0d samples: add ADXL362 sensor sample application
Add a sample application that demonstrates how to use the ADXL362 with
data ready and threshold triggers.

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
2019-05-15 13:38:27 -05:00
Carles Cufi
bedfcf4d1b doc: coding style: Expand the list of keywords with braces
Zephyr requires braces on every code block that a keyword introduces, so
list the complete set in the documentation.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-15 13:25:10 -05:00
Filip Kokosinski
f9efca4b4f boards: riscv32: add LiteX VexRiscV board
Add LiteX VexRiscV board platform definitions and
default configurations.

Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-15 12:52:16 -05:00
Filip Kokosinski
342cbc9e01 soc: riscv32: add LiteX VexRiscV SoC
Add LiteX with softcore CPU VexRiscV SoC definitions and default
configurations.

Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-15 12:52:16 -05:00
Filip Kokosinski
b054517ce7 drivers: interrupt_controller: add LiteX interrupt controller driver
Add LiteX interrupt controller driver and bindings for this device.

Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-15 12:52:16 -05:00
Filip Kokosinski
c0c3cdfc57 drivers: timer: add LiteX timer driver
Add LiteX timer driver with bindings for this device.

Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-15 12:52:16 -05:00
Filip Kokosinski
b3739169cb drivers: serial: add LiteUART driver
Add LiteX UART driver with bindings for this device.

Signed-off-by: Filip Kokosinski <fkokosinski@internships.antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2019-05-15 12:52:16 -05:00
Ioannis Glaropoulos
0472bc467f dts: nordic: add missing erase-block-size entry
Adding missing erase-block-size entries for the flash-controller
nodes in the nrf52810 and nrf52811 .dtsi files.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-05-15 11:05:19 -05:00
Kumar Gala
233149eec5 dts: nordic: move flash/sram under SoC Node
Move flash-controller and SRAM node definitions under SoC node.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-05-15 11:05:19 -05:00
Benoit Leforestier
3ef630834a codeowner: add codeowners for /test/lib
Add codeowners for /test/lib

Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
2019-05-15 10:46:44 -05:00
Benoit Leforestier
472ea92e79 Build: Build with newlib-nano c library
Add an option for building with newlib-nano library.
The newlib-nano library for ARM embedded processors is a part of the
GNU Tools for ARM Embedded Processors.
Add mem_alloc tests with newlib nano.

Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
2019-05-15 10:46:44 -05:00
Ulf Magnusson
635755891e subsys/random: Hide 'Random generator' choice when empty
Prevent the choice from showing up in the menu when none of the choice
symbols are visible.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-15 05:10:56 -05:00
Ulf Magnusson
48edfc2203 console: kconfig: Put 'menuconfig CONSOLE_SUBSYS' in top-level menu
The 'Console' menu contains just 'config CONSOLE_SUBSYS' and its
indented children.

Remove one menu level by removing the 'Console' menu and turning
CONSOLE_SUBSYS into a 'menuconfig' symbol.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-15 05:10:01 -05:00
Ioannis Glaropoulos
424224afb7 arch: arm: fix ESF pointer in SecureStackDump()
This commit fixes a build error, when building with
CONFIG_ARM_SECURE_FIRMWARE=y. The error was introduced
in #15930 (6f19d0), where we added internal structure
to the exception stack frame struct.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-05-15 05:07:46 -05:00
Ulf Magnusson
6c55bb446c dfu: kconfig: Remove 'DFU Options' menu
This menu contains just the IMG_MANAGER symbol and its children. Remove
one menu level by making IMG_MANAGER a top-level 'menuconfig' symbol
instead.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-05-15 05:02:32 -05:00
Carles Cufi
fc3c2c0abb samples: basic: Add a minimal sample
Add a minimal sample that showcases minimal ROM sizes. It can be built
in several configurations, all very restrictive when it comes to
features enabled in order to verify the fact that we can fit in small
devices and to be able to accurately measure the sizes of the kernel's
basic features.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-15 10:44:59 +02:00
Carles Cufi
5ec96b1766 soc: nrf: Conditionally enable clock control and timer
The CONFIG_CLOCK_CONTROL and CONFIG_NRF_RTC_TIMER were
unconditionally selected when enabling any nRF SoC. But since
timers can be disabled in the kernel, depend instead on
CONFIG_SYS_CLOCK_EXISTS, which is only defined when kernel
timer support is included.

Note that ideally we would enable CONFIG_NRF_RTC_TIMER only, and
that would select CONFIG_CLOCK_CONTROL (on which the RTC timer
depends) but there is a circular Kconfig dependency that prevents
us from doing so.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-15 10:44:59 +02:00
Carles Cufi
201fdf0aec kernel: Fix usage of CONFIG_SYS_CLOCK_EXISTS
When compiling the kernel with CONFIG_SYS_CLOCK_TICKS_PER_SEC=0,
the CONFIG_SYS_CLOCK_EXISTS internal variable is unset.
This completely disables timer handling in the kernel, but a couple of
spots missed the required conditional compilation.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2019-05-15 10:44:59 +02:00
Krzysztof Chruscinski
6d4a5200bc drivers: counter: Move nRF TIMER and RTC configuration to device tree
Reduced Kconfig for counter with nRF TIMER and RTC. Added overlays
for TIMER and RTC configuration in the counter test.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-15 10:11:02 +02:00
Krzysztof Chruscinski
a5f36427d2 dts: bindings: Document missing property boolean type
Boolean type was not mentioned in the documentation.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2019-05-15 10:11:02 +02:00
Joakim Andersson
172dcec236 Bluetooth: controller: Fix unknown rsp received during enc procedure
Port fix for #14044 from legacy LL to split LL.

The master is using unknown rsp to terminate slave side initiated
procedures that has collided with the encryption procedure initiated by
the master.
We need to handle an unknown response that is sent in unencrypted during
the encryption procedure, even though we have already set up to receive
encrypted packets.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-05-15 10:10:42 +02:00
Joakim Andersson
289eab6ad5 Bluetooth: controller: Remove incorrect comment
Remove comment stating that UNKNOWN_RSP during encryption procedure
is a workaround.
The core spec mandates that connections should not be dropped if
receiving this control packet during encryption procedure.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2019-05-15 10:10:42 +02:00
Jakob Olesen
c8708d9bf3 misc: Replace uses of __builtin_*_overflow() with <misc/math_extras.h>.
Use the new math_extras functions instead of calling builtins directly.

Change a few local variables to size_t after checking that all uses of
the variable actually expects a size_t.

Signed-off-by: Jakob Olesen <jolesen@fb.com>
2019-05-14 19:53:30 -05:00
Jakob Olesen
0e65aab703 misc: Always test the portable version of the math_extras.h functions.
The implementation of the <misc/math_extras.h> functions will use the
portable C code when PORTABLE_MISC_MATH_EXTRAS is defined before
including the header.

Use this feature macro to make sure that the unit test always tests the
portable functions in addition to the ones using builtins for the
current compiler.

Signed-off-by: Jakob Olesen <jolesen@fb.com>
2019-05-14 19:53:30 -05:00
Jakob Olesen
b2945d304c misc: Implement math_extras.h function with GCC builtins.
When available, use the GCC / Clang builtins to implement the
math_extras functions. Otherwise, use the portable versions.

Signed-off-by: Jakob Olesen <jolesen@fb.com>
2019-05-14 19:53:30 -05:00
Jakob Olesen
f4f09dd7cd toolchain: Define a HAS_BUILTIN(x) macro in toolchain.h.
Compilers based on Clang provide a __has_builtin(x) macro which can be
used to detect in the preprocessor if a given builtin function is
supported by the compiler.

For other compilers (notably GCC), we provide an alternative definition
of HAS_BUILTIN(x) that depends on the toolchain-specific header file to
declare which builtin functions are supported based on the current
compiler version.

Signed-off-by: Jakob Olesen <jolesen@fb.com>
2019-05-14 19:53:30 -05:00