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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>