Commit graph

41120 commits

Author SHA1 Message Date
Stanislav Poboril
7c08fdac6e doc: fix wrong board name in NXP LPCXpresso54114 doc
The LPCXpresso54114 command line example was using a wrong board
name which has been renamed after adding the support for the
Cortex-M0+ core.

Fixes #9649

Signed-off-by: Stanislav Poboril <stanislav.poboril@nxp.com>
2018-08-30 09:23:15 -04:00
Ulf Magnusson
9f8d429048 menuconfig: Fix a case of visible symbols not being shown
Update menuconfig (and Kconfiglib, just to sync) to upstream revision
78682a8e3c4fe to get the following fix in, which could cause certain
visible symbols to not show up in the menuconfig interface:

    menuconfig: Always show implicit submenus with visible nodes

    Currently, the symbol BAR below (which ends up indented in an
    implicit submenu) is shown only if DEP is non-n (or if show-all mode
    is enabled):

      config FOO
            bool "foo" if DEP
            default y

      config BAR
            bool "bar" if FOO

    This is bad, because it hides visible symbols from the interface.
    The assumption was that an implicit submenu (which is only created
    if the parent has a prompt) would never have visible items when the
    parent item is invisible, but prompt-specific conditions and
    select/imply can break that assumption.

    Fix it by always showing implicit submenus with visible nodes, along
    with the parent node. If the parent node is invisible, show it in
    red, like in show-all mode (which happens automatically). That's
    probably better than having mysteriously indented nodes when the
    parent is invisible.

(Some other tweaks were made later to avoid showing red outside show-all
mode, because it might look confusing/broken.)

A new color scheme for the menuconfig has been added as well,
contributed by Mitja Horvat (pinkfluid). It can be enabled by setting
the environment variable MENUCONFIG_THEME to 'aquatic'.

The default theme has been tweaked to use bold text for the selected
item too.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-30 14:26:05 +02:00
Johan Hedberg
643c8abea3 Bluetooth: Fix using correct IRK when generating RPA
The code in le_set_private_addr() was hardcoding identity 0, even
though it is given a specific identity as an input parameter.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2018-08-30 13:49:59 +03:00
Niranjhana N
a08794091f lib: cmsis_rtos_v1: remove unhit return case
k_msg_get returns only three possible values, and
osErrorValue is not in osMessageGet spec, hence
removing this unhit else case.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-08-30 01:11:08 -04:00
Niranjhana N
30d478a5fd tests: cmsis_rtos_v1: add and enhance msgq tests
Added few more tests to cover all the message
send and receive scenarios. Added negative tests
to increase code coverage.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
2018-08-30 01:11:08 -04:00
Maureen Helm
3e41864e25 tests: gen_isr_table: Add barriers after triggering the irq
Fixes the gen_isr_table kernel test on mimxrt1050_evk by using data and
instruction synchronization barriers instead of disabling compiler
optimization on arm platforms. According to [1] section 4.5, "if a
pended interrupt request needs to be recognized immediately after being
enabled in the NVIC, add a DSB instruction and then an ISB instruction"

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHJDAAE.html

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-29 18:48:42 -04:00
Daniel Leung
9945e7fda0 doc: add ability to generate PDF
This adds new targets to generate build documentation through
LaTEX to PDF.

There are a few notes:

1. pdflatex complains about the tex file generated by doxygen
   so it needs to be fixed with a Python script before feeding
   in through pdflatex.

2. SVG files are not recognized by pdflatex so they are converted
   to known good format on the fly, only for producing PDF. This
   uses the libRSVG's rsvg-convert tool.

Relates to #6782.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-08-29 18:16:56 -04:00
Daniel Leung
4a2ba0dd04 tests/kernel: pipes: add tests for smaller pipe buffers
This adds some test cases where the pipe buffer is smaller than
the size of data being pushed through the pipe.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-08-29 15:57:28 -04:00
Daniel Leung
1c6d202ee8 kernel: pipes: fix k_pipe_block_put() when not enough space
If k_pipe_block_put() is called and the pipe does not have enough
space to accomodate all the data in the memory pool, the subsequent
get operation will cause a CPU fault. The CPU fault is caused by
the timeout struct in the dummy thread not being initialized and
thus the scheduler will read bad memory. After fixing this,
another issue came up where the get operation would stall with
k_pipe_block_put() in same situation. This is due to the async
descriptor not being setup correctly. So fix this too.

This was discovered when debugging #9273.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2018-08-29 15:57:28 -04:00
Subramanian Meenakshi Sundaram
591985140b subsys: logging: Fix possible null dereference
Fixing a possible null dereferencing in log_msg_create_n

Signed-off-by: Subramanian Meenakshi Sundaram <subbu147@gmail.com>
2018-08-29 15:21:19 -04:00
Flavio Ceolin
9624593a0c subsys: logging: Fix possible out-of-bounds read
Coverity issue #187069

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2018-08-29 15:15:50 -04:00
Rajavardhan Gundi
ac787e0e97 lib/posix: Use static allocation for posix_thread objects
The memory occupied by posix_thread objects are not significant.
Hence, no point in using dynamic allocation.

Addresses #8717.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2018-08-29 15:14:05 -04:00
Punit Vara
108b5398e4 tests: adc_api: Remove sample width test scenario
Remove unnecessary sample width scenario.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
ea4305a469 boards: quark_d2000_crb: Remove adc support
Remove ADC support from d2000 as it is not migrated to
new ADC apis.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
094531bf9f samples: grove_temperature: Use device name from Kconfig
Use Kconfig to get device name. Make LIBC conditional to get
output.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
52339f4b1d samples: grove_light: Provide device name from Kconfig
check return value for sample fetch. Conditional printk
added to print adc value.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
1bfa34f4fb tests: adc_api: Add ARC related parameters for ADC
Add ARC related parameters and modified test case to work
this test case on arc sensor subsystem.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
003f0176a0 drivers: grove: Update temperature driver
Replace old ADC driver APIs with new ones.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
a490a8468e drivers: grove: Modify light sensor
Replace old ADC apis with new ones.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
b98aeab505 drivers: Kconfig.dw: Remove unnecessary Kconfig
Remove Kconfig which are replaced by dts and unnecessary macros which is
not useful anymore.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
353a69cbfd drivers: adc: Update new ADC APIs
Replace new ADC apis for designware driver

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
c83769f859 boards: quark_se_c1000_ss_devboard: Enable ADC node
Enable ADC node in dts.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
c995c4b42b dts: arc: Use dts tree for designware driver
Get required data from dts tree.

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Punit Vara
ef83943387 drivers: Use Designware driver for sensor subsystem
Remove adc_qmsi_ss to use designware driver for sensor subsystem

Signed-off-by: Punit Vara <punit.vara@intel.com>
2018-08-29 13:46:57 -04:00
Justin Watson
4e551aabb6 sam: adc: Updated SAM ADC driver.
Updated to work with new ADC API.

Signed-off-by: Justin Watson <jwatson5@gmail.com>
2018-08-29 13:46:57 -04:00
Maureen Helm
c68e41dffe tests: adc_api: Add support for kinetis boards
Adds board-specific macros to enable the adc_api test to run on kinetis
boards. This restores the test to support all the nxp boards that were
supported before the new adc api was introduced.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-29 13:46:57 -04:00
Maureen Helm
c0ce7d02d5 adc: Convert mcux adc16 driver to the new adc api
Major rework of the mcux adc16 driver to convert it to the new adc api.
Currently supports a subset of the api features including synchronous
and asynchronous reads, and consecutive reads triggered by the kernel
timer.

Does not yet support some of the channel configuration options such as
gain and reference voltage because the hardware only allows these
options to be configured by peripheral instance rather than by channel.
The values are currently hardcoded in the driver, but in the future we
could introduce some flexibility per instance via device tree
attributes.

Does not yet support consecutive reads triggered by a hardware timer.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2018-08-29 13:46:57 -04:00
Andrzej Głąbek
62fcfb72d2 drivers: adc: Select HAS_DTS_ADC for all ADC drivers
To require relevant DTS entries on all platforms providing the ADC
driver.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-08-29 13:46:57 -04:00
Andrzej Głąbek
9e161a5a01 tests: adc_api: Add configurations for nRF5 boards
This adds to the adc_api test board-specific configurations
for the following boards:
- nrf51_pca10028
- nrf52_pca10040
- nrf52840_pca10056

"adc" is indicated as supported in the yaml files for these boards
so that they are included in sanitycheck.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-08-29 13:46:57 -04:00
Andrzej Głąbek
aad21ecb31 drivers: adc: Add shims for nrfx ADC and SAADC drivers
This commit adds translation layers to make nrfx drivers for the nRF
ADC (nRF51 series) and SAADC (nRF52 series) peripherals accessible via
the Zephyr's API. The SAADC peripheral is accessed using nrfx HAL only
as it turns out that usage of the nrfx driver in this case would be
inconvenient and would unnecessarily complicate the shim.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-08-29 13:46:57 -04:00
Andrzej Głąbek
f1891e9473 drivers: adc: Introduce reworked API
This commit replaces the API for ADC drivers with a reworked one.
As requested in the issue #3980, the adc_enable/adc_disable functions
are removed. Additionaly, some new features are introduced, like:
- asynchronous calls
- configuration of channels
- multi-channel sampling

Common parts of code that are supposed to appear in each implementation
of the driver (like locking, synchronization, triggering of consecutive
samplings) are provided in the "adc_context.h" file to keep consistency
with the SPI driver. Syscalls are no longer present in the API because
the functions starting read requests cannot use them, since they can be
provided with a callback that is executed in the ISR context, and there
is no point in supporting syscalls only for the channels configuration.

"adc_api" test is updated and extended with additional test cases,
with intention to show how the API is supposed to be used.
"adc_simple" test is removed as it does not seem to add much value.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-08-29 13:46:57 -04:00
Andrzej Głąbek
5a1ef7b18b boards: nrf: Enable ADC nodes in DTS for nRF boards
ADC nodes are enabled in DTS for the following nRF development kits:
- nrf51_pca10028
- nrf52_pca10040
- nrf52_pca20020
- nrf52810_pca10040
- nrf52840_pca10056

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-08-29 13:46:57 -04:00
Andrzej Głąbek
0a97b5bf35 dts: nrf: Add ADC nodes and bindings for nRF SoCs
This commit adds ADC nodes to DTS files for nRF SoCs and introduces
corresponding  bindings for these nodes.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2018-08-29 13:46:57 -04:00
Paul Sokolovsky
b0c3b35735 net: tcp: Add comment of func prototype for NET_CONN_CB macro usages
NET_CONN_CB() functional macro hides the parameters a function takes
and its return type. In #8723, it's proposed to remove that macro
altogether. Until that proposal is reviewed, at least provide real
protype in code comments to help people who read/analyze the code.

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2018-08-29 11:55:07 -04:00
Jukka Rissanen
44498e6c8a tests: net: websocket: Fix crash when tearing down tests
No need to have setup and teardown functions. Teardown will
even cause crash when tearing down last IPv4 test.

Fixes #9617

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-29 10:57:56 -04:00
Jukka Rissanen
a81aad9756 tests: net: Run networking tests only for selected platforms
Run networking tests for native_posix, qemu_x86 and qemu_cortex_m3
platforms only as the tests are generic enough so no need to run
them in real physical device.

Fixes #9623 #9614 #9622 #9621 #9618

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2018-08-29 10:57:56 -04:00
Andy Ross
9ecc4ead68 sched: Properly account for timeslicing in tickless mode
When adding a new runnable thread in tickless mode, we need to detect
whether it will timeslice with the running thread and reset the timer,
otherwise it won't get any CPU time until the next interrupt fires at
some indeterminate time in the future.

This fixes the specific bug discussed in #7193, but the broader
problem of tickless and timeslicing interacting badly remains.  The
code as it exists needs some rework to avoid all the #ifdef mess.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2018-08-29 10:01:41 -04:00
Ruslan Mstoi
6dae106d79 net: ipv6: Drop packet with multiple HBHO
If a malformed packet with multiple HBHO is received by the Zephyr IP
stack it replies with ICMPv6 type 4 code 1: "Parameter problem
unrecognized Next Header type encountered". This ICMPv6 message has
wrong IPv6 payload length and ICMPv6 checksum.

RFC 8200 in chapter 4.1 states:

   Each extension header should occur at most once, except for the
   Destination Options header, which should occur at most twice (once
   before a Routing header and once before the upper-layer header).

There are two possible solutions to the problem at hand:

1) Respond with ICMPv6 Parameter problem, in this case IPv6 length and
   ICMPv6 checksum need to be fixed

2) Drop the malformed packet

This patch implements the easy solution - 2. Basically it changes the
code to drop the malformed packet instead of sending ICMPv6 type 4
code 1.

Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
2018-08-29 09:26:19 -04:00
Erwan Gouriou
18b8a633b6 sensors: introduce kconfig named choices
Use Kconfig specific object "named choices".
Aim is to allow to define config choices selection in Kconfig.*
files instead of _defconfig and hence allow to keep flags
activation conditional.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-08-29 09:05:51 -04:00
Yannis Damigos
d2e713f9ef arch: stm32l4: Enable gpio interrupts correctly
Enable gpio interrupts correctly and don't
disable the already enabled interrupts.

Fixes #9630

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-08-29 08:53:09 -04:00
Diego Sueiro
9255bf5f7f gpio: Use GPIO_FLAGS instead of GPIO_INT_CONF
Rename GPIO_INT_CONF to GPIO_FLAGS in order to be able to use
the definition generated by the devicetree, eliminating the need
for definition in the board.h file

Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
2018-08-29 08:49:29 -04:00
Yannis Damigos
32a6fa1c58 arch: st_stm32: Remove I2C and SPI instances from common defconfig
Remove I2C and SPI instances when enabling I2C_STM32 and
SPI_STM32 drivers.

It allows to enable the drivers if ports I2C_4, SPI_4,
SPI_5, SPI_6 are selected.

Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
2018-08-29 07:04:32 -05:00
Erwan Gouriou
68823b503e dts/st: fix stm32l4 gpioh gpioi node addresses
Fix erroneous address headers in stm32l4.dtsi/stm32l496.dtsi files

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2018-08-29 07:02:23 -05:00
Adithya Baglody
24c96a8a47 tests: benchmarks: sys_kernel: Enable benchmark for slower SoCs
Few SoCs whose clock speed is very less will cause multiple ticks
to occur for 1 sec of sleep. For such a platform we cant run
the loops for over 5000 because the tick handler will get executed.
Thus rendering the test useless for such platforms. By reducing
the number of iterations we get the required benchmark results.

Fixes: GH-7906

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2018-08-29 07:58:02 -04:00
Jørgen Kvalvaag
70f85fee34 tests: net: mqtt: Fix rc check in mqtt_publisher test
Actually use the inverted condition.

Signed-off-by: Jørgen Kvalvaag <jorgen.kvalvaag@nordicsemi.no>
2018-08-29 07:56:29 -04:00
Savinay Dharmappa
8c91001ada boards: x86: arduino_101: set DISK_FLASH_MAX_RW_SIZE to 256
set DISK_FLASH_MAX_RW_SIZE to 256, as maximum bytes that can be
programed to SPI FLASH by Page Program Command is 256.

Fixes #8506

Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
2018-08-29 07:54:55 -04:00
Anas Nashif
6a01c69f9b nrf52_pca10040: get the erase block size from dts
Sample expect that to come from DTS, previously it was hardcoded in the
sample.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-28 20:06:58 -04:00
Spoorthi K
baabe64549 tests: cmsis_rtos_v1: Wait for longer duration in k_busy_wait
For boards like nrf52 with low system clock (32768), k_busy_wait
for values less than 1 second (1000000 us) ends up waiting less
than the desired wait time because of decimal truncation while
converting wait time to hw clock cycles. Hence increased the wait
to 1 second.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-08-28 19:19:56 -04:00
Spoorthi K
0b8792c05c lib/cmsis_rtos_v1: Check if osKernelStart() is called from ISR
Check if osKernelStart() is called from ISR and return error code
appropriately.

Signed-off-by: Spoorthi K <spoorthi.k@intel.com>
2018-08-28 19:19:06 -04:00
Kiril Zyapkov
64b130683c arch: arm: stm32l4: add missing I2C_3 to dts.fixup
One can enable I2C_3 in kconfig and set status = "ok" in dts, but
the driver expects to find the config as fixed up with this
addition.

Signed-off-by: Kiril Zyapkov <k.zyapkov@allterco.com>
2018-08-28 13:18:44 -05:00