Test that k_usleep() allows sleep durations near the limit of what
the platform's tick rate will allow.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
Add k_usleep() API, analogous to k_sleep(), excepting that the argument
is in microseconds rather than milliseconds.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
Current z_impl_k_sleep() does double duty, converting between units
specified by the API and ticks, as well as implementing the sleeping
mechanism itself. This patch separates the API from the mechanism,
so that sleeps need not be tied to millisecond timescales.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
Move to a new guide which will expand on how to submit modules and how
to maintain them.
Also move topology documentation to repository management section where
it fits better.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
A conditional block to save a directed advertising report flag was
present three times. Remove two of the blocks.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
These definitions were left incorrect after a gpio-map change was
added to the PR introducing the boron support for the SARA-R4 modem.
Correct the gpio defintions here so that the boron build doesn't
break.
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/16289
Signed-off-by: Michael Scott <mike@foundries.io>
builds@lists.zephyrproject.org archives the CI build results for every
and nightly build. Add references to this in the contribution
guidelines and introduction (pulled from README).
Also added a reference to the "Asking for Help" doc (there was a note to
add this once that doc was merged).
Fixes: #15652
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
GATT long messages require buffers to store multiple packets. The actual
configuration for the bluetooth peripheral sample defines only two
buffers to store these messages. As the default ATT payload size is
18 bytes, the maximum payload size for a long ATT message is 36 bytes.
As the variable `vnd_long_value[]` has a defined size of 74 bytes, it
cannot be fully modified due to the 36 bytes limitation.
Set CONFIG_BT_ATT_PREPARE_COUNT=5 so all the maximum payload size goes
to 90 bytes and all the 74 bytes can be written to `vnd_long_value[]`.
Signed-off-by: Joao Cordeiro <jvcc@cesar.org.br>
There was a missing break at the end of the high speed setup case,
so it would always return -ENOTSUP even when the high speed baud
was available.
Signed-off-by: Derek Hageman <hageman@inthat.cloud>
Add option for enabling the Code Cache present on the NXP Kinetis
KE1xF SoC series and enable it by default.
Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
When in Sharing Floating Point Services mode we want to
dynamically save and restore the FP registers in thread
context switch, depending on whether the swapped-in and
swapped-out threads are currently using the FP registers.
This commit adds this functionality to the ARM context
switch mechanism. The logic consists of inspecting the
corresponding status flag (present in thread.arch.mode)
to decide whether to save or restore the FP registers.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Only a single bit of the 4-byte internal (thread.arch) status
variable 'mode' is currently used, when we build with User mode
support (CONFIG_USERSPACE=y). In this commit we extend the usage
of 'mode' variable, adding an additional bit-flag to track the
status of the floating point context in a particular thread,
i.e. to track whether FP context is active or not. The status
bit is meant to be used in context-switch, to restore the FP
register context when required.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
The initial carved stack frame only needs to contain the basic
stack frame (state context), because:
- under No/Unshared FP Services mode no FP context is stacked.
- under FP Sharing mode FP context is cleared upon thread
creation.
This commit removes the unnecessary stacking of the FP context
during thread initialization. This results in reduced stack
usage under the Shared FP Services mode (CONFIG_FP_SHARING=y).
Also, we do not need to initialize the FPSCR, because there is
no FP stack frame carved.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
In FP Sharing mode we enable both automatic and lazy state
preservation of the FP context. This configuration improves
interrupt latency. Under this configuration the FP registers
will only be stacked when the thread is swapped out during
context-switch. Before jumping to main() we clear the FPCA
flag of the CONTROL register, so the FP context can be used
by the main thread.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
on non-XIP system, SRAM is the default region, and relocated .data
section and .bss section of SRAM shouldn't be inserted between
_image_rom_start and _image_rom_end, because the memory region between
_image_rom_start and _image_rom_end will construct the mpu ro region.
Also for the newly added memory region on non-XIP system, the
relocated .text secition and .rodata section should also be mpu aligned.
Fixes: #16090.
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
This commit consolidates the temperature conversion into a single
location and subtracts the bias from the measurement using values from
the datasheet. Also magic numbers have been replaced with more
descriptive macros.
Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
This driver uses magic numbers which are incorrect. A correct conversion
is done using the LSB/g scale factors given by Table 1 in the
specifications section of the ADXL362 (Rev. F) datasheet. The entire
conversion has also been consolidated into a signal function.
The sensitivity and offset of the accelerometer values actually vary
with the supply voltage and temperature. Using datasheet provided values
for 25 C and 2.0 V is the best we can do. Users will need to apply
sensitivity and offset corrections for their application.
Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
The return code check and error return on the interrupt register
configuration function call should be included in the #if defined
region.
Fixes#16159
Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
The 'Graphical user interface' menu currently contains just the
'LittlevGL Support' symbol and its indented children.
To remove one menu level, remove the 'Graphical user interface' menu,
rename the symbol to 'LittlevGL GUI library' (consistent with e.g.
'Logging' and 'Bluetooth'), and turn it into a 'menuconfig' symbol.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Drop packet if it has broadcast destination MAC address but the IPv4
destination address is not multicast or broadcast address.
See RFC 1122 ch 3.3.6 for details.
Fixes#16276
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
We generated some alias defines for children of a bus in which we had a
path alias for the bus node. We never used these defines, we don't
recommend they get used (child of busses should use instance defines)
and they were only generated in small handful of cases (for dts that had
path aliases to the bus node - i2c or spi).
Remove this as effectively dead code.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
On STM32 series currently available in Zephyr,
LPUART and U(S)ART IPs are similar and share most of their
registers. As a consequence LL API defined for U(S)ART also
applies to LPUART.
This allows to remove specific LPUART code.
Restrict use of LL LPUART API when it diverges from UART one.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The net_if_ipv4_select_src_addr() should return global address
in the interface if nothing else is being found.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Let's filter out on a state parameter.
There is no impact as this function is not used anywhere yet.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If we receive a multicast ICMPv4 packet, then send the reply back
with correct source address and not with multicast address.
Fixes#16257
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
In all architectures, except x86, __start_swap_time is directly
updated by function read_timer_start_of_swap(), and it shall not
be registered via __temp_start_swap_time.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
When Zephyr crashes immediately QEMU reports an error immediately. This
is immediately reported by "make run". Then sanitycheck points the user
at the output of "make run". However the error message(s) are in QEMU's
output which is in a different .log file.
To address this situation point the error message at handler.log
instead of run.log if and only if handler.log is not empty.
To reproduce here's an artificial but very simple crash:
sanitycheck --extra-args=CONFIG_TEST_USERSPACE=n \
-p qemu_x86 -T tests/kernel/mem_protect/stackprot/
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Move includes to outside of the extern "C" statements to fix C linkage
issue.
| /include/misc/util.h:53:1: error: template with C linkage
| template < class T, size_t N >
| ^~~~~~~~
Signed-off-by: Greg S. Woods <gwoods@lexmark.com>
Enable pull-up on UART TX pin to reduce power consumption.
If the board is powered by battery the SoC consumes more
power than expected.
The consumption increases because TX pin is floating
(High-Impedance state of pin B from Dual-Supply Bus Transceiver).
Similar to commit b5b728495b
("boards: reel_board: enable pull-up on UART RX pin")
Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Previous version calculated rt_clock_base incorrectly by subtracting
clock_gettime from the specified time. Effectively the following
formula was used.
rt_clock_base := new_time - clock_gettime()
This is clearly incorrect when we consider what should happen if we
call clock_settime with the result of clock_gettime. It ought to be
approximately a no-op, but instead we end up zeroing the clock.
rt_clock_base := clock_gettime() - clock_gettime() = 0
This patch fixes clock_settime by instead using k_uptime_get to
calculate rt_clock_base, like so:
rt_clock_base := new_time - k_uptime_get()
Trying the earlier thought experiment we get:
rt_clock_base := clock_gettime() - k_uptime_get()
Using the definition of clock_gettime this expands to:
rt_clock_base := (rt_clock_base + k_uptime_get()) - k_uptime_get()
The two k_uptime_get() terms cancel out, leaving:
rt_clock_base := rt_clock_base
I.e. the no-op that we expect when calling clock_settime with
the result of clock_gettime.
Note: The bug is only observable when rt_clock_base is non-zero.
So when clock_settime is called for the first time, it will appear
to work correctly since rt_clock_base is initialized to 0.
Signed-off-by: Alexander Mihajlovic <alexander.mihajlovic@endian.se>
I2C support has been added back into the up_squared, leveraging the
new PCIe support in the DesignWare I2C driver.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
The Apollo Lake devicetree is augmented with its 8 I2C interfaces.
The default number of dynamic IRQ stubs is increased to deal with
these new interfaces having IRQ vector detection at runtime.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
The legacy PCI support in the DesignWare I2C driver is replaced with
the new PCIe support. The Intel Quark X1000 SoC and the galileo board
configurations are updated accordingly.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>
The 50-odd lines of boilerplate per I2C port is moved into a template
which is generated by CMake as needed at build-time.
Signed-off-by: Charles E. Youse <charles.youse@intel.com>