Commit graph

41120 commits

Author SHA1 Message Date
Laczen JMS
36edf92ca8 subsys/settings: change processing to const char
The settings module processes the variable name by splitting it up in
a set of variables. This PR removes the splitting up and keeps the
variable name as one string.

It is an alternative to #16609

The possibility is introduced to register handler including a
separator, or to register a handler for each variable.

The ability is introduced to load a subtree from flash or even to load
a single item.

Two ways to operate on variable and settings_handler names are provided:

settings_name_steq(const char *name, const char *key, const char **next)
which checks if name starts with key, returns 1/0 if it does/does not
the remaining part of name is in next.

settings_name_split(const char *name, char *argv, const char **next)
which splits up name in a part before "/"" that is found in argv and
the remaining part that is in next.

A mutex is added to make settings thread-safe

The settings_handlers list is stored in reverse alphabetical order, this
allows registration of e.g. bt and bt/mesh in separate handlers, the bt
handler itself should not contain any handling of bt/mesh.

A settings_deregister() method is added. Settings_handlers can now be
added/removed when required. This saves RAM when settings_handlers are
not needed.

Tests have been updated to reflect changes in the settings api.

Updates after meeting:
1. Removed settings_deregister

2. Changed settings_name_split() in settings_name_next:

int settings_name_next(const char *name, const char **next): returns
the number of characters before the first separator. This can then be
used to read the correct number of characters from name using strncpy
for processing.

3. New functional test added

Update in settings.h: settings_name_next() changed position -> index

Added some comments in settings.h (settings_name_steq())

Updated tests to reflect change to settings_name_next() and pointer
value comparison. The functional test can now also run on qemu_x86.

Corrected some documentation in header.

Changed registration of handlers to be non ordered.

Changed handler lookup to handle non ordered list of handlers, this
improves handler matching in case different length names are compared
and also makes it easier to add rom based handlers as they will not be
ordered.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2019-06-18 17:57:08 +02:00
Kumar Gala
03259dba90 drivers/i2c: Add missing HAS_DTS_I2C to nios
The NIOS I2C driver supported DTS, but missed HAS_DTS_I2C in
Kconfig for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-18 11:22:23 -04:00
Kumar Gala
4f714d3822 drivers/i2c: Add missing HAS_DTS_I2C to sbcon
The ARM SBCON I2C driver supported DTS, but missed HAS_DTS_I2C in
Kconfig for it.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-06-18 11:22:23 -04:00
Jukka Rissanen
404ac51055 samples: net: socket: can: Close the socket periodically
This is done only for testing purposes, in real life the socket
would be closed if it is not used or needed.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Jukka Rissanen
06b500b6bd net: sockets: can: Close the socket cleanly
If the socket is closed, then do CAN detach if that is needed.
This way the CAN interrupts are not received if there are no
CAN sockets listening the data.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Jukka Rissanen
7e37fd7203 net: connection: The connection logic was not init properly
We need to initialize the connection.c for UDP, TCP, PACKET socket
and CANBUS sockets.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Jukka Rissanen
1e98928424 net: shell: Print connection information properly for AF_CAN
CANBUS socket information was just printing unknown information.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Jukka Rissanen
0032f68669 net: context: Set local address properly for AF_CAN connections
At the moment there is no real address for local CANBUS socket,
but we can still set protocol family of local socket to AF_CAN
so that for example net-shell "net conn" command can show
information about it.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Jukka Rissanen
ae89c2239b samples: net: can: Add second RX socket receiver
This is done so that we can test socket CAN dispatcher.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Jukka Rissanen
6621491014 net: sockets: can: Add dispatcher
We need to dispatch the received CAN frame if there are multiple
sockets interested in the same CAN-IDs.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-06-18 17:58:00 +03:00
Henrik Brix Andersen
67f0550a15 drivers: adc: mcux_adc12: fix compilation
Fix compilation of NXP MCUX ADC12 driver shim after commit
d4a0c3a2aa.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2019-06-18 08:45:31 -05:00
Andrew Boie
94b9640a9c tests: poll: expand userspace coverage
The syscall handler for k_poll() returns error values
instead of killing the caller for various bad arguments,
cover these cases.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-18 09:08:01 -04:00
Andrew Boie
db84a76379 lib: os: remove dead code
If multithreading is disabled, thread_entry() never runs
since we cannot create threads; the non-multithreading case
was simply dead code.

Indicate to code coverage that CODE_UNREACHABLE should be
skipped.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-18 09:08:01 -04:00
Andrew Boie
676b1ae93a kernel: idle: exclude no-op funcs from coverage
These get overridden anyway.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-18 09:08:01 -04:00
Andrew Boie
682a53db28 tests: queue: test k_queue_alloc_*pend()
These were never getting called anywhere from user mode,
except for k_queue_alloc_append(), but only by virtue of
some workqueue tests.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-18 09:08:01 -04:00
Andrew Boie
3f974243be kernel: allow k_sleep(K_FOREVER)
Threads that are sleeping forever may be woken up with
k_wakeup(), this shouldn't fail assertions.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-18 09:08:01 -04:00
Andrew Boie
c5164f328b kernel: init: exclude unreachable code
LCOV/gcovr doesn't understand what CODE_UNREACHABLE means.
Adding LCOV_EXCL_LINE to the macro definition unfortunately
doesn't work.

Exclude a bit of code which spins endlessly when multi-
threading is disabled that runs after the coverage report
is dumped.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-18 09:08:01 -04:00
Andrew Boie
8e053330fe kernel: init: fix coverage gap
We don't get any coverage past when we dump the coverage data,
so exclude the end of the function and move setting the main
thread as nonessential to immediately before the coverage dump.
The comment was also amended.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-18 09:08:01 -04:00
Andrew Boie
fe228a8184 kernel: init: exclude some funcs from coverage
data copying and bss zero are called from arch code
before z_cstart(), and coverage data gathering doesn't
work properly at that point. Not all arches use this
code anyway, some do it in optimized assembly instead.

Weak main() is also excluded; it does nothing and every
test overrides it.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-18 09:08:01 -04:00
Andrew Boie
d87a90e4b9 tests: mutex_api: run in user mode
Addresses coverage gaps. Some changes were made so that exited
threads do not have k_thread_abort() called on them.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2019-06-18 09:08:01 -04:00
Morten Priess
b34db7fb71 bluetooth: controller: Reverted revised ticker pending redesign
Reversed revised ticker implementation pending new design which resolves
the issues described in GH issues #16830.

Signed-off-by: Morten Priess <mtpr@oticon.com>
2019-06-18 14:20:52 +02:00
Erwan Gouriou
d9d6b59e2c boards: nucleo_wb55rg: Enable flash and debug with pyocd
stm32wb is not yet supported on openocd.
But support on pyocd can be enabled thanks to "pack" feature.
Configure board runner with pyocd and provide guidelines
to configure pyocd.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-06-18 08:04:12 -04:00
Erwan Gouriou
e6a4839c61 soc: stm32: STM32F7: Remove useless package digit
Fixes #16733, applied to STM32F7 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-06-18 08:03:40 -04:00
Erwan Gouriou
a54de3176d soc: stm32: STM32F4: Remove useless package digit
Fixes #16733, applied to STM32F4 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-06-18 08:03:40 -04:00
Erwan Gouriou
1a514a453b soc: stm32: STM32F2: Remove useless package digit
Fixes #16733, applied to STM32F2 series.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-06-18 08:03:40 -04:00
Andrzej Puzdrowski
f51e3c2960 dfu/boot: make swap_type optional
Swap_type field implementation is the new mcuboot's trailer field.
This patch makes using of it optional which keeps possibility of being
compatible with older versions of MCUBoot.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-06-18 11:09:16 +02:00
Andrzej Puzdrowski
b1e1774cd4 dfu/boot: double swap on interrupted revert bugfix adaptation
Mcuboot changed TLV in PR: Fix double swap on interrupted revert
(https://github.com/JuulLabs-OSS/mcuboot/pull/485)

Above bugfix changes a little way for upgrade request.

This path introduces re-formatted original mcuboot bootutil_misc.c
code as much as it was reasonable which includes the bugfix
adaptation and support for devices witch have bite erased sate different
than 1 as well.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2019-06-18 11:09:16 +02:00
Marc Herbert
83723109be cmake: silence "WARNING: ASSERTs enabled" when CONFIG_TEST is true
TEST configurations don't need to be warned that they're using test
techniques with some side-effects.

On a typical sanitycheck invocation, this warning is one of the only two
that appears in most test runs. In other words this commit gets rid of
half of the entire grep -ri '[[:blank:]]warn' noise that obscures any
work-in-progress warnings or platform specific warnings in the
logs (typically: device tree warnings).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2019-06-17 22:47:05 -04:00
Ulf Magnusson
09821e545c drivers: pinmux: stm32l4: Fix CONFIG_SOC_STM32L496XX references
CONFIG_SOC_STM32L496XG was renamed to CONFIG_SOC_STM32L496XX by commit
dbad99ec92 ("soc: stm32: STM32L4: Remove useless package digit").

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-06-17 18:17:51 -07:00
Andy Ross
a5137c8100 include/drivers/system_timer.h: Clean up docs
Tighten up some phrasing that had proven confusing.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-06-17 20:32:50 -04:00
Augusto Hack
0296938c9f arch: common: gen_isr_tables table size check
Added simple and fairly conservative sanity check for interrupt table
size

Signed-off-by: Augusto Hack <me@hak.cx>
2019-06-17 17:03:02 -07:00
Manivannan Sadhasivam
49df0b10af boards: arm: Add support for 96Boards Meerkat96 board
Add board suppor for 96Boards Meerkat96 board from Novtech based on
NXP i.MX7 multi core processor. Zephyr is ported to run on the single
core Cortex-M co-processor on this board.

More information about this board can be found in 96Boards website:
https://www.96boards.org/product/imx7-96/

By default Zephyr console output is available via UART1 available at
the 40pin LS connector.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
2019-06-17 16:25:00 -05:00
Ioannis Konstantelias
f84e6517f6 drivers: pinmux: stm32l4: Add extra pin functions
Added pins configuration for:
 - PWM2_CH1
 - PWM3_CH2
 - I2C3_{SCL, SDA}
 - SPI2_{SCK, MOSI}

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-06-17 17:18:52 -04:00
francois ramu
9210605390 boards: stm32f469i_disco: add more leds to board
Fixes "basic disco sample fails" #16687

Signed-off-by: francois ramu <francois.ramu@st.com>
2019-06-17 17:13:12 -04:00
Bernard Lee
b14f4f67a8 samples: display: ili9340: Document 2 Arduino TFT shield configurations.
Update README.rst with Arduino TFT shields setup details for nRF52 DK
and nRF52840 DK.

Signed-off-by: Bernard Lee <bernard.lee@nordicsemi.no>
2019-06-17 17:06:06 -04:00
Tomasz Bursztyka
7245e433a1 drivers/wdt: Fixing tiny style issues in sam0 driver
- Even one-liner statement if () need { }
- you can coalesce assignment and condition if the later tests the
earlier only.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-06-17 16:45:27 -04:00
Tomasz Bursztyka
ef26b7ad76 include: Removing legacy left-overs in wdt.h API header
As title says, struct wdt_config and enum wdt_clock_timeout_cycles are
not used anymore so they can be removed.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2019-06-17 16:45:27 -04:00
Nicolas Pitre
9d11900dc3 usb: enforce byte alignment on USB records
As seen previously, some toolchain are willing to insert padding
at section changes to apply greater alignments by default. This is
especially true with 64-bit builds. USB structures are marked with the
packed attribute and therefore the linker section they land into
must also be byte aligned.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-17 16:41:43 -04:00
Piotr Mienkowski
d41f01d4c7 drivers: Define COUNTER_LOG_LEVEL using template
This commit updates counter Kconfig to use logger template to define
COUNTER_LOG_LEVEL option.

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2019-06-17 16:38:46 -04:00
Ioannis Konstantelias
dfca5ab817 soc: stm32: Add STM32L496XE support
Added support for the STM32L496XE series with 512KB internal flash and
256KB SRAM of contiguous addresses.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-06-17 16:35:12 -04:00
Ioannis Konstantelias
1be3da290f boards: Change to new STM32L496XX symbol
stm32l496zg_disco and nucleo_l496zg were depending on STM32L496XG SOC.
With the recent change to STM32L496XX, the dependency should be updated.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-06-17 16:35:12 -04:00
Ioannis Konstantelias
08b08151b3 soc: stm32: Remove package digit for STM32L496XG
Letter G is no longer needed as described in issue #16733.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
2019-06-17 16:35:12 -04:00
Charles E. Youse
1444ee970e arch/x86: reorganize core source files
Create source directory for IA32-subarch specific files, and move
qualifying files to that subdirectory.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-17 16:31:37 -04:00
Charles E. Youse
8f14b2ed86 arch/x86: split CMakeLists.txt into subarch-specific files
Separate common, ia32-specific, and x64-specific into separate files.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-17 16:31:37 -04:00
Charles E. Youse
d2b33a486b arch/x86: split Kconfig files by sub-architecture
Separate common, ia32 (32-bit) and x64 (64-bit long mode) options.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-06-17 16:31:37 -04:00
Loic Poulain
4fe7f69182 drivers: usb: nxp: Add cache management
Clean/Invalidate cache before/after usb TX/RX transfers.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-06-17 16:25:06 -04:00
Loic Poulain
d79bbc6d4d usb: netusb: cdc_eem: Fix Interface select
Parameter of set_interface_status is no more the interface index
but a pointer to interface descriptor.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-06-17 16:25:06 -04:00
Loic Poulain
7428f9c070 drivers: usb: nxp: Fix board freeze with various USB classes
Prevent to reschedule a transfer if one is already ongoing (occupied).
This happens with USB class drivers scheduling transfer once interface
is enabled (netusb, ACM...) and cause freeze due to infinite loop in
low level driver.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-06-17 16:25:06 -04:00
Loic Poulain
d47df7f73f boards: mimxrt1064_evk: Enable USB device controller 1
Enabled node and add feature to doc.

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-06-17 16:25:06 -04:00
Alexander Svensen
47d7146c7e Drivers: led: lp5562: Add delay when writing to enable register
According to datasheet, there needs to be a minimum of 488µs
between each write to Enable register

Signed-off-by: Alexander Svensen <alsv@nordicsemi.no>
2019-06-17 16:23:16 -04:00