The net_shell only uses iface_flags2str when CONFIG_NET_NATIVE is
enabled. Disabling this produces an "unused function" warning for this
function. Wrap the function in an #ifdef to silence the warning for this
configuration.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
em_starterkit has ICCM at 0x0 address, access to 0x0
address doesn't generate any exception, so we access
to 0xFFFFFFFF address instead to trigger exception.
Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
This option was only able to collect statistics of transmitted
data. The same functionality is available if one sets the
CONFIG_NET_PKT_RXTIME_STATS and/or CONFIG_NET_PKT_TXTIME_STATS
options.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The RX statistics might not get updated properly because the used
ifdef was referring the TX options.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add a note in the board documentation regarding the
correct size of the available flash and sram memory.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
In Cortex-M, SVC exceptions are used by the kernel
for system calls, run-time exceptions and IRQ
offloading. Correct the respective information in the
boards documentation.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Inline some minor clarifications regarding the
Lazy Stacking feature in the cortex-m pendSV
handler, for ease of understanding. Also, fix
some minor style issues in comments.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The conn_raw_input() in connection.c will clone the incoming
packet so that it is possible to receive socket data in
multiple packet sockets. This is all fine except that if the
socket is never calling recv(), then the cloned net_pkt is never
processed and we will have a memory leak.
What this all means in practice, is that we should call recv()
for every packet socket in order to flush the socket for any
incoming data even if the socket is just sending data.
Fixes#34462
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Query timeout handler is rescheduled if DNS context mutex is locked. So
far there was no timeout used, which means that work is simply put at
the end of system workqueue. This solves cases when mutex is locked by
any higher priority cooperative threads.
If however mutex was locked in application code within lower priority
thread (which is very likely) and query timeout has expired in the
meantime, then system workqueue is busy looping by calling query timeout
handler and trying to acquire DNS context lock.
Reschedule query timeout handler with 10ms delay, so that all
threads, including those with lower priorities, have a chance to move
forward and release DNS context lock.
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
TWDT0 is loaded with a new value and the counter restarts counting with
it by written RST bit in Timer Control register (T0CSR) to 1. Then, the
RST bit in T0CSR register is cleared automatically on the 2nd rising
edge of T0IN clock. Since TWCP is set to 1:32, the maximum time that RST
bit is unset is 32 * (1 / 32768) ~= 980us.
Polling this bit within a critical section in current npcx watchdog
driver isn't a good approach since it might block the other interrupts
need to service them in time. This CL introduces a timeout mechanism and
removes the critical section to improve this disadvantage. Consider the
clock tolerance, 2 ms is a suitable timeout value for RST bit. We also
remove polling for WD_RUN bit in T0CSR. Npcx watchdog needs serval LFCLK
(32k Hz) clocks to stop watchdog. 1 ms is long enough for the timeout
mechanism.
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Add additional API to stream_flash that can be used to make
stream write progress persistent using the settings subsystem.
This functionality makes it possible to resume a write operation
after it was interrupted, e.g. by power loss.
Signed-off-by: Jonathan Nilsen <Jonathan.Nilsen@nordicsemi.no>
This commit increases the shell stack sizes when used with
OpenThread shell and the joiner to compensate for enlarged
MPU stack guard.
Signed-off-by: Piotr Szkotak <piotr.szkotak@nordicsemi.no>
Adds documentation specifically for empty notification in the
bt_gatt_notify_func_t callback, as that works a bit different
from e.g. reading an empty characteristic.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Add the BT_GAP_PER_ADV_MIN_INTERVAL and BT_GAP_PER_ADV_MAX_INTERVAL
macros in gap.h that are also reference in bluetooth.h and
used for parameter validation in adv.c.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
Moved sdu_interval struct members from llcp_cis to cis group,
to match spec and enable access by ULL
Signed-off-by: Asger Munk Nielsen <asmk@oticon.com>
Uninitialization of uart transport was missing disabling of TX
interrupt. It had to be done by the user before using uart.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This patch adds flash clock settings in device tree for stm32wb
series so that the stm32 flash driver can get the clock settings
from this dtsi file.
Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
This patch adds flash clock settings in device tree for stm32l4
series so that the stm32 flash driver can get the clock settings
from this dtsi file.
Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
This patch adds flash clock settings in device tree for stm32l1
series so that the stm32 flash driver can get the clock settings
from this dtsi file.
Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
This patch adds flash clock settings in device tree for stm32g4
series so that the stm32 flash driver can get the clock settings
from this dtsi file.
Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
This patch adds flash clock settings in device tree for stm32g0
series so that the stm32 flash driver can get the clock settings
from this dtsi file.
Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
When selecting a random count for blink, beep or vibrate, the Bluetooth
Mesh Profile Specification v1.0.1, section 5.4.2.4 states: "the device
shall select a random integer between 0 and 10 to the power of the
Authentication Size exclusive".
This means that if size is 1, the integer should be in the range 1-9,
while the implementation chose an integer in the range 0-9. Reduce the
range and add 1 to the num to correct this for these actions.
Fixes#34209.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Fix undefined referenc to bt_le_adv_lookup_legacy in bt_le_oob_get_local
when bt_le_oob_get_local is used in a central only application.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add register address including external timer and watchdog(ETWD),
general control(GCTRL), serial peripheral interface(SPI).
Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
The ARM64 port is currently using SP_EL0 for everything: kernel threads,
user threads and exceptions. In addition when taking an exception the
exception code is still using the thread SP without relying on any
interrupt stack.
If from one hand this makes the context switch really quick because the
thread context is already on the thread stack so we have only to save
one register (SP) for the whole context, on the other hand the major
limitation introduced by this choice is that if for some reason the
thread SP is corrupted or pointing to some unaccessible location (for
example in case of stack overflow), the exception code is unable to
recover or even deal with it.
The usual way of dealing with this kind of problems is to use a
dedicated interrupt stack on SP_EL1 when servicing the exceptions. The
real drawback of this is that, in case of context switch, all the
context must be copied from the shared interrupt stack into a
thread-specific stack or structure, so it is really slow.
We use here an hybrid approach, sacrificing a bit of stack space for a
quicker context switch. While nothing really changes for kernel threads,
for user threads we now use the privileged stack (already present to
service syscalls) as interrupt stack.
When an exception arrives the code now switches to use SP_EL1 that for
user threads is always pointing inside the privileged portion of the
stack of the current running thread. This achieves two things: (1)
isolate exceptions and syscall code to use a stack that is isolated,
privileged and not accessible to user threads and (2) the thread SP is
not touched at all during exceptions, so it can be invalid or corrupted
without any direct consequence.
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This change enables A, C, D, E, G, H, I, J, K, and L groups,
and fix gpio interrupt function.
This change also pull (and rename) dt-bindings/irq.h to
dt-bindings/interrupt-controller/ite-intc.h, because it is
chip-specific.
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Change-Id: Ifee039981c2cc4cf5980e663702a9921e629fc1e
With balancing in twister fixed, reduce matrix size for now, since we
are running tests only for native_posix.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Do calculation based on what is actually going to be run and evaluated
at runtime, ignore the cases we already know going to be skipped.
This fixes an issue where some sets would get majority of skips and
basically run nothing beside filtering.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
NPCX PWM supports output buffet select to push-pull or open-drain. Add
output buffer select option 'drive-open-drain' in devicetree for NPCX
PWM. If set, the PWM output will be configured as open-drain. If not
set, defaults to push-pull.
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
During polling ITEN bit to make sure ITIM timer is enabled, we might
have the chance that npcx_itim_evt_enable() return fake error when
timeout expired but ITEN bit is set already if CONFIG_ZERO_LATENCY_IRQS
is enabled. (Since SVCall's interrupt priority is not the highest, the
other interrupts with IRQ_ZERO_LATENCY flag could preempt CPU resource
at this moment.)
In order to prevent return fake error code, this CL adjusts the check
conditions for ITEN bit and timeout.
Signed-off-by: Mulin Chao <mlchao@nuvoton.com>
NPCX host access IRQ enables before entering deep sleep. The pending
bit lets chip wake up from sleep immediately. Clear host access IRQ
pending bit before enabling.
Signed-off-by: Wealian Liao <WHLIAO@nuvoton.com>
When compiler results are piped through a non-terminal (e.g. ninja)
the compiler disables colour diagnostics. Using `-fdiagnostics-color`
forces the compiler to enable colour output. This flag is always
enabled for clang and gcc.
Setting `CONFIG_COMPILER_COLOR_DIAGNOSTICS=n` disables this
feature and reverts to plain diagnostic messages with no formatting.
Signed-off-by: Arvin Farahmand <arvinf@ip-logix.com>
With some additional macro-magic we can remove the CMake-based header
file template feature, and instead take advantage of the usual
DT_INST_FOREACH_STATUS_OKAY() macro.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
There are no boards that need hard-coded interrupts so just remove this
build-time conditional branch. The way going forward is that all PCIe
devices should always use PCIE_IRQ_DETECT.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Logging attempts to do most of the work at compile time instead
of preprocessor by using conditions which can be resolved at
compile time (e.g. if (IS_ENABLED(...))). Apparently, such extensive
use significantly loads the compiler since all paths are compiled
even though cut from final binary. Patch reduces it by replacing
some compile time switch with preprocessor.
Handling of function name prefix has been moved to preprocessor.
Immediate logging v2 has also been moved to preprocessor.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
All skips for platforms listed in the .yaml's integration_platforms
will be treated as errors in the integration mode ('-G/--integration').
This feature serves to guarantee a proper testing scope in CI as no
integration platform will be skipped silently.
Fixes#33874
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
Move ec_host_cmd.h out of the top level include/ dir into
include/mgmt/ec_host_cmd.h and deprecated the old location.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move emul.h out of the top level include/ dir into
include/drivers/emul.h and deprecated the old location.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>