Commit graph

99049 commits

Author SHA1 Message Date
Andy Ross
7fb8eb57e8 kernel/sched: SWAP_NONATOMIC workaround for timeslicing
Timeslicing works by removing the _current thread from the run queue
and re-adding it at the end of its priority.  On systems with a
_Swap() that can be preempted by a timer interrupt, that means it's
possible for the timeslice to try to slice out a thread that had
already pended itself!

This behavior used to be benign (or at least undetectable) as the
duplicated list operations were idempotent.  But now the dlist code is
stricter about correctness and has exposed the bug -- it will blow up
if you try to remove an already-removed list node.

Fix (on affected platforms) by stashing the _current pointer in
_pend_current_thread() that is checked and cleared in the timer
interrupt.  If we discover we're trying to interrupt a thread that's
already interrupted itself, we can safely exit z_time_slice() as a
noop.  The timeslicing bookeeping was already done for us underneath
the pend code.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-15 13:06:35 +01:00
Andy Ross
23c5a63aa8 kernel/sched: Predicate SWAP_NONATOMIC workaround properly
This is a refactoring of the fix in commit 6c95dafd82 to limit its
application to affected platforms now that the root cause is
understood.

Note that the bug that fix was addressing was rare and seen only on
after multi-hour sessions on Michael Scott's test rig.  So if
something regresses, this is where to look!

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-15 13:06:35 +01:00
Andy Ross
7f42dbaf48 kernel: Add CONFIG_SWAP_NONATOMIC flag
On ARM, _Swap() isn't atomic and a hardware interrupt can land after
the (irq_locked) caller has entered _Swap() but before the context
switch actually happens.  This will require some platform-specific
workarounds in a few places in the scheduler.

This commit is just the Kconfig and selection on ARM.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-01-15 13:06:35 +01:00
Vincent Wan
3fd89baca4 net: Fix inet_pton when offloading is enabled
When offloading is enabled, a call to inet_pton() results in a call to
zsock_inet_pton() based on its implementation in include/net/socket.h.
This eventually leads to a call to _impl_zsock_inet_pton(), which is
not defined when offloading is enabled.

In this commit, we have chosen to directly call net_addr_pton() in
inet_pton() in the offload case to be efficient, and keep the
implementation as it is when offload is not enabled.

Fixes #12441

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2019-01-15 10:39:52 +02:00
Johan Hedberg
eba16555ce Bluetooth: Increase default TX stack size
The current stack consumption with the H4 driver on qemu_x86 is as
follows with a change from 256 to 512:

	usage 396 / 512 (77 %)

Increase the default for this configuration, as well as other similar
configurations. Set the fallback default to a higher value as well.

Fixes #12429

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-01-15 10:31:55 +02:00
Anas Nashif
3ba7097e73 linker: add orphan sections to linker script
Add missing sections being reported as orphan with latest compiler
version for x86 and discard them. Do the same on ARM.

Those sections are used for dynamic linking which we do not support in
Zephyr.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-14 17:10:27 -05:00
Jakub Rzeszutko
ef672165a7 shell: documentation update according to new meta-keys
Updated shell.rst accoring to newly added meta-keys.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-01-14 16:01:48 -05:00
Jakub Rzeszutko
63696968eb shell: add meta-keys
Added following meta-keys:
Ctrl-B - moves the cursor backward one character
Ctrl-D - deletes the character under the cursor
Ctrl-F - moves the cursor forward one character
Ctrl-K - deletes from the cursor to the end of the line
Alt-F  - moves the cursor forward one word
Alt-B  - moves the cursor backward one word

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2019-01-14 16:01:48 -05:00
Erwan Gouriou
21d287650d boards: nucleo_l476rg: Update to default configuration guidelines
Update nucleo_l476rg to fit with default configuration guidelines:
- update yaml

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
106a74031b boards: nucleo_l073rz: Update to default configuration guidelines
Update nucleo_l073rz to fit with default configuration guidelines:
- configure I2C1 as arduino i2c and spi1 as arduino spi
- update doc
- update yaml

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
b85794bc03 boards: nucleo_l053r8: Update to default configuration guidelines
Update nucleo_l053r8 to fit with default configuration guidelines:
- configure I2C1 as arduino i2c and spi1 as arduino spi
- update doc

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
a38bb31df5 boards: nucleo_f446re: Update to default configuration guidelines
Update nucleo_f446re to fit with default configuration guidelines:
- add spi support
- configure I2C1 as arduino i2c and spi1 as arduino spi
- update yaml
- disable I2C by default
- update doc

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
c060012705 boards: nucleo_f411re: Update to default configuration guidelines
Update nucleo_f411re to fit with default configuration guidelines:
- add spi support
- configure I2C1 as arduino i2c and spi1 as arduino spi
- update yaml
- update doc

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
a92863e1fc boards: nucleo_f401re: Update to default configuration guidelines
Update nucleo_f401re to fit with default configuration guidelines:
- configure I2C1 as arduino i2c and spi1 as arduino spi
- disable I2C and PWM by default
- update yaml
- update doc

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
f3a42185e0 boards: nucleo_f334r8: Update to default configuration guidelines
Update nucleo_f334r8 to fit with default configuration guidelines:
- configure I2C1 as arduino i2c and spi1 as arduino spi
- reorder pinmux defintion entries to ease reading
- update yaml
- update doc

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
dcdda1cf34 boards: nucleo_f302r8: Update to default configuration guidelines
Update nucleo_f302r8 to fit with default configuration guidelines:
- remove reference to arduino_serial as Ardiuno D1/D0 are actually
mapped on PA2/PA3 which are already used for ST_Link com port,
hence not available by default for arduino serial

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
0bc9473614 boards: nucleo_f103rb: Update to default configuration guidelines
Update nucleo_f103rb to fit with default configuration guidelines:
-configure arduino spi
-update doc
-update yaml

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
7a353e31fa boards: nucleo_f091rc: Update to default configuration guidelines
Update nucleo_f091rc to fit with default configuration guidelines:
-configure arduino spi and i2c
-fix SPI1 pinmux to enable arduino spi
-update doc
-update yaml

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
37b1e19548 boards: nucleo_f070rb: Update to default configuration guidelines
Update nucleo_f070rb to fit with default configuration guidelines:
-configure arduino spi and i2c
-update doc

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Erwan Gouriou
dd580e6fca boards: nucleo_f030r8: Update to default configuration guidelines
Update nucleo_f030r8 to fit with default configuration guidelines:
-configure arduino spi and i2c
-update yaml
-update doc

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2019-01-14 13:35:44 -06:00
Anas Nashif
937e45de74 drivers: spi_sam: initialize tx and rx
initialize both tx and rx in the spi_sam0 driver. Make the spi_sam
driver look the same by splitting the declaration into 2 lines.

Discovered with gcc 8.2

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-14 14:07:52 -05:00
Andrei Laperie
f072a83391 doc: Updated CAN part of stm32f072b_disco documentation
Added CAN pins and provided link for a working CAN transceiver.

Signed-off-by: Andrei Laperie <andrei.laperie@intel.com>
2019-01-14 10:09:44 -05:00
Håkon Øye Amundsen
120aaae268 cmake: Remove kconfig-usage target
This target uses a file which no longer exists.
Invoking it results in an error.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2019-01-14 10:01:19 -05:00
Dawid Wojciechowski
fdd89c60f3 sanitycheck: Enable Renode tests on m2gl025_miv
The test suite will use the m2gl025_miv.resc Renode script to load the
platform.

Signed-off-by: Dawid Wojciechowski <dwojciechowski@internships.antmicro.com>
Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
2019-01-14 09:12:07 -05:00
Jan Kowalewski
265895b293 sanitycheck: Add Renode support
The change adds an optional capability to kill process by PID in the
BinaryHandler. At the moment proc.terminate only closed the make
process, also closing the stdin/stdout, but this is impossible to detect
in .NET.

Signed-off-by: Dawid Wojciechowski <dwojciechowski@internships.antmicro.com>
Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
2019-01-14 09:12:07 -05:00
Dawid Wojciechowski
92156642d2 sanitycheck: Add Renode cmake configuration
By default Renode is searched for in the system PATH.
The PID is stored in renode.pid - the application must be killed with a
signal after a test.

With the XWT gui layer disabled all UART output is directed to the
stdout.

Signed-off-by: Dawid Wojciechowski <dwojciechowski@internships.antmicro.com>
Signed-off-by: Jan Kowalewski <jkowalewski@antmicro.com>
Signed-off-by: Piotr Zierhoffer <pzierhoffer@antmicro.com>
2019-01-14 09:12:07 -05:00
Sathish Kuttan
39570b5bae soc: intel_s1000: Add SoC routine for GNA power-up
Add an SoC level routine to turn power and clock on for
Intel GNA block in Intel S1000 SoC.

Signed-off-by: Sathish Kuttan <sathish.k.kuttan@intel.com>
2019-01-14 08:43:51 -05:00
Andrei Laperie
f8275da755 dts: Reduced CAN bitrate for stm32f072b_disco
For normal (over-the-wire) mode of CAN sample lowering bitrate to
125000 to ensure reliable transfer on stm32f072b_disco boards

Signed-off-by: Andrei Laperie <andrei.laperie@intel.com>
2019-01-14 07:03:15 -06:00
Kumar Gala
35ecc78cdf scripts/dts/extract: Generate unique defines based on compat & instance
Add support to generate defines of the form
DT_<COMPAT>_<INSTANCE>_<PROP>.  The idea is that we can utilize this in
drivers to remove the need for dts_fixup.h.  The <INSTANCE> value is
determined by the script and starts at 0 and counts up for each instance
of a given <COMPAT>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-14 06:33:29 -06:00
Kumar Gala
3b9147df3f scripts/dts/extract: Fliter duplicates values inserted into defs
If an aliases already exists in the defs we should filter it out.  Also
if an alias exists in the new_def we should filter the alias out.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-14 06:33:29 -06:00
Kumar Gala
94240aebb2 scripts/dts/extract: Add an instance ID for each compatiable
Add a unique instance starting at 0 for each compatiable in the dts.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-14 06:33:29 -06:00
Sebastian Bøe
b72fb4e9e8 cmake: Remove dead code 'FindRegex.cmake'
When Zephyr was building the C implementation of KConfig it used the
build script 'FindRegex.cmake' to satisfy a regex dependency.

Now that we no longer use the C implementation of Kconfig we no longer
use this build script, and it is safe to remove it.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2019-01-14 13:02:03 +01:00
Paweł Zadrożniak
480b728d52 drivers: usb: nordic: Fix IN transfer fragmentation
Currently, when usb_dc_ep_write is called, data is copied to the
internal buffer, hence the requirement for fragmentation, regardless
of low-level nrfx_usbd driver. This commit forces the fragmentation
and prevents potential internal buffer overflow. Adittional
fragmentation flag was added to prevent triggering status stage
(it is handled by hardware completely on nRF chips).

Fixes #12339

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
2019-01-14 11:02:47 +01:00
Johan Hedberg
61ff1bda2f Bluetooth: Mesh: Remove redundant stack variable
The msg->prev_addr is already stored in frnd->clear.frnd, so there's
no need to have an extra stack variable for this (in the form of
prev_addr).

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
2019-01-14 11:38:51 +02:00
Wolfgang Puffitsch
3159049c39 bluetooth: controller: Update ticker_user_op for predictable layout.
Use fixed-width type instead of enum for field op in struct
ticker_user_op to avoid struct layout differences between
compilers. Also make check whether struct sizes match size definitions
build-time asserts.

Signed-off-by: Wolfgang Puffitsch <wopu@oticon.com>
2019-01-14 10:12:15 +01:00
Emanuele Di Santo
a72f113bae boards: arm: nrf52840_pca10059: update fstab-debugger.dts
Increase the size of the MCUBoot flash partition in the fstab-debugger
partition table, to accommodate for the RTT console and logs.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-01-14 09:56:55 +01:00
Emanuele Di Santo
9661cbf9e5 boards: arm: nrf52840_pca10059: update comment in fstab-stock.dts
The MCUBoot partition in the default partition table (fstab-stock)
is not meant to accommodate an RTT console, since the board does
not have a SEGGER chip.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-01-14 09:56:55 +01:00
Emanuele Di Santo
32d5247aef boards: arm: nrf52840_pca10059: remove RTT_CONSOLE from defaults
The board does not have a SEGGER chip.
Remove RTT_CONSOLE from board defaults.

Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
2019-01-14 09:56:55 +01:00
Jiahao Li
5b9d5a217c Bluetooth: Fixes length limit in bt_hex_real
Since `str` is the output buffer, `bt_hex_real` should limit its output
length according to the `str` size, not the `hex` size.

Signed-off-by: Jiahao Li <reg@ljh.me>
2019-01-13 23:19:30 +02:00
Jukka Rissanen
a7afdc3512 net: rpl: Remove the deprecated code
The RPL was deprecated earlier so remove it by this commit.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-01-13 09:40:36 -05:00
Kumar Gala
728ca62d0b boards: arm: Cleanup xtools toolchain support
Add 'xtools' as supported toolchain for new boards and remove duplicate
entry from mps2_an385

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-01-13 09:35:59 -05:00
Paul Sokolovsky
c885cb533e net: buf: linearize: Get rid of useless memset()
net_buf_linearize() used to clear the contents of output buffer,
just to fill it with data as the next step. The only effect that
would have is if less data was written to the output buffer. But
it's not reliable for a caller to rely on net_buf_linearize() for
that, instead callers should take care to handle any conditions
like that themselves. For example, a caller which wants to process
the data as zero-terminated string, must reserve a byte for it
in the output buffer explicitly (and set it to zero).

The only in-tree user which relied on clearing output buffer was
wncm14a2a.c. But either had buffer sizes calculated very precisely
to always accommodate extra trailing zero byte (without providing
code comments about this), or arguably could suffer from buffer
overruns (at least if data received from a modem was invalid and
filled up all destination buffer, leaving no space for trailing
zero).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-12 15:24:29 -06:00
David Leach
afcfa11ce0 scripts: extract_dts_includes: Enhance message information
The information message when processing the yaml files is
cryptic when there is an override. This change adds filenmae
of yaml file being processed and the parent tuple with
the override.

Signed-off-by: David Leach <david.leach@nxp.com>
2019-01-12 15:23:11 -06:00
Jiahao Li
6a5623566e Bluetooth: Mesh: Fixes existing friend lookup in Friend Request handling
Currently, when handling a Friend Request message with `prev_addr` set,
we look up existing friend entry using `prev_addr` as the address.
However, `prev_addr` is the address of the requesting node's previous
friend, NOT the address of the requesting node itself. Therefore, we
should always look up existing friend entry using `rx->ctx.addr` as the
address.

Signed-off-by: Jiahao Li <reg@ljh.me>
2019-01-12 22:07:41 +02:00
Tavish Naruka
19b968a0c7 boards: add new board Electronut-labs Blip
Added config for https://github.com/electronut/ElectronutLabs-blip/

Signed-off-by: Tavish Naruka <tavishnaruka@gmail.com>
2019-01-12 09:15:26 -05:00
Peter A. Bigot
e0e9beee04 boards: arm: particle: refactor for commonalities
Provide a dtsi file that sets up common capabilities for all
Feather-based Particle Mesh devices.  Provide additional dtsi files for
some obvious peripheral options.

Remove the xtensa esp32 image: it didn't build, and there's no
indication of how the ESP32 firmware can be updated on the Argon board.
Use particle_argon as the nRF52840 side of the board.

Add Particle Boron support.

Note that dtsi files must be replicated in each board directory until
tooling supports DTS includes from a shared area.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-01-12 09:10:43 -05:00
Matthias Boesl
a600b138c4 boards: particle: add board support for particle argon
initial support for particle argon nrf52 and esp32

Signed-off-by: Matthias Boesl <matthias.boesl@gmail.com>
2019-01-12 09:10:43 -05:00
Endre Karlson
714ffe623c boards: particle_xenon: Add support Xenon
This patch adds support for the Particle Xenon dev board that
has a nrf52840 mcu.

Signed-off-by: Endre Karlson <endre.karlson@gmail.com>
2019-01-12 09:10:43 -05:00
Maureen Helm
73956a398e scripts: Update pyocd version to 0.14.3
pyocd recently merged its command-line tools into a unified pyocd tool
with subcommands. The separate command-line tools still remain, but are
deprecated. Update the pyocd version required by zephyr in preparation
for updating the pyocd runner to use the new unified tool commands.

Pin pyocd to a specific version rather than allowing any version greater
than or equal to 0.14.0 because there have been a few unstable releases
recently. Version 0.14.3 is what I have been using locally and know to
be stable.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2019-01-11 21:33:28 -06:00
Daniel Leung
c17d0dc2c5 esp32: fix build error regarding multiplt BIT() definitions
This partially reverts commit 5a47c60dbf.
The soc.h is now only included when _soc_irq_*() is being referred.

Fixes #11077.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2019-01-11 15:05:31 -08:00