Document the changes implemented in #60368:
* Placement of the .bss and .noinit sections at the end of the binary
so that large zero-/uninitialized data structures such as heaps,
arrays etc. don't have to be padded in the resulting binary.
* Location of the z_mapped_start marker: prevents the assignment
of the single 4k-page wide .vectors section right at the RAM
base address as dynamic memory by the MMU at run-time. Instead
of pointing to the start of the subsequent .text section, the
z_mapped_start marker now covers all the data contained within
the binary that ends up in RAM.
Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
Move the z_mapped_start marker for non-XIP builds to the base RAM address.
This has already been the marker's location when building for XIP.
Prior to this change, z_mapped_start was located at the start of the
text section for non-XIP builds. However, at least for the Cortex-A
family of CPUs, the first section located at the RAM base address
isn't the text section, but the single 4k page containing the exception
vectors which are copied to either address 0 or the HIVECS address upon
early boot.
This resulted in this first 4k page at the bottom of RAM to be considered
available for memory mappings via the MMU at run-time, followed by all
the permanently mapped stuff, with available mappable memory only
continuing behind z_mapped_end. A call at run-time requesting memory to
be mapped via the MMU therefore always assigned the single 4k page
containing the vectors data first, before continuing mapping physical
memory behind z_mapped_end. For any map call requesting more than 4k,
this resulted in a contiguous virtual memory address range mapped to
non-contiguous physical memory. This behaviour has already been
documented in #51024.
This behaviour would also cause further problems in case of support
for the Cortex-A's VBAR register, which has been proposed before, but
eventually wasn't merged. Letting VBAR point to the RAM base where
the 4k vectors page is located within the Zephyr image instead of
copying the vectors to either 0 or the HIVECS address means that this
page may under no circumstance be re-assigned for use as regular RAM
mapped via the MMU.
Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
This is a follow up to #53262, which still lacked the adjustment of the
.noinit section's position within the binary by the time the PR went
stale.
Adjust the linker command file so that the .bss and .noinit sections
are placed at the end of the resulting binary. Until now, those sections
have been located somewhere in the middle of the binary, so that the
inclusion of structures like statically defined heaps or large zero-
initialized arrays reflected 1:1 in the resulting binary's size. Even
for a stripped binary, such data was included in full as the linker
couldn't omit it due to subsequent sections within the binary.
This fix has been tested with a 32 MB statically allocated heap and
a 32 MB uint8 zero-initialized array. Both structures are clearly
identifyable in the memory consumption statistics, however, the final
binary's size is unaffected by their inclusion.
Signed-off-by: Immo Birnbaum <mail@birnbaum.immo>
The OP_AGG_SRV is dependent that the OP_AGG_CLI is add
for the OP_AGG_SRV to work. Moved the define of OP_AGG_CLI
so it will call op_agg_send without the OP_AGG_CLI.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
The call to metadata-encode call in code and documentation
does does not match. Because the shell call in the documentation
looks correct the shell call in the code has been changed by
removeing the double metadata request.
Signed-off-by: Ingar Kulbrandstad <ingar.kulbrandstad@nordicsemi.no>
If size is given then twister prnits the size information for the ELF
but returns one which if used in automation fails the command.
Return zero as the command is successful. Also, fix the unit test case.
Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Disabled uart0 and uart1 by default in alder_lake.dtsi and enable only
for intel_adl_crb board.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add initial Alder Lake board definition. Initially copied from ELkhart
Lake which is predecessor of the board.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Add an optional compare buffer to check each byte. If the byte differ
the read value will be printed as an error.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Add an optional compare buffer to check if bytes read
match a provided buffer and print an error if they differ.
Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
Flaky tests give innacurate test summary indicating a misleading
passing test suite. Add new status for flaky tests.
Signed-off-by: Al Semjonovs <asemjonovs@google.com>
This commit adds overlay and conf for the qemu_x86_64 board
to the RTC API test suite, and adds support for the RTC
subsystem to the qemu_x86_64's yaml file.
The commit also specifies integration platforms for the
RTC API test suite, since the qemu_x86_64 board runs in
real-time, causing it to time out if the test suite runs
for it.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
The update callback test had a bug which prevented it from
running on 64-bit architectures. This patch makes the test
agnostic to 64-bit and 32-bit architectures.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
This commit updates the qemu_x86 board's yaml file to
indicate its support for the RTC subsystem. Board overlay
and conf for the qemu_x86 has been added to the RTC test
suite to enable the MC146818 and its dependencies.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
This commit adds input clock selection to the RTC driver. This
is required to allow for the real hardware to operate. The
QEMU emulated hardware ignores the input clock settings.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
The MC146818 driver was not properly initialized
by the driver, interrupts where not handled correctly,
and the alarm feature was not implemented properly.
This commit fixes these issues, while removing some
code which became redundant as the MC146818 driver
was patched.
Signed-off-by: Bjarki Arge Andreasen <bjarkix123@gmail.com>
After an interrupt, do not attempt to swap
if the kernel is not yet initialized.
Otherwise, if an interrupt is raised with interrupts
unlocked while the kernel is not yet fully initialized,
a swap would lead to a crash.
(This could happen if a PREKERNEK1/2 driver enables interrupts
and an interrupt fires before the kernel has swapped to
main)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
After an interrupt, do not attempt to swap
if the kernel is not yet initialized.
Otherwise, if an interrupt is raised with interrupts
unlocked while the kernel is not yet fully initialized,
a swap would lead to a crash.
(This could happen if a PREKERNEK1/2 driver enables interrupts
and an interrupt fires before the kernel has swapped to
main)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
After an interrupt, do not attempt to swap
if the kernel is not yet initialized.
Otherwise, if an interrupt is raised with interrupts
unlocked while the kernel is not yet fully initialized,
a swap would lead to a crash.
(This could happen if a PREKERNEK1/2 driver enables interrupts
and an interrupt fires before the kernel has swapped to
main)
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
In the mutex and semaphore tests, main thread will sleep for 10 ticks
to wait for test thread to finish its work. And test thread will wait
5 ticks for timeout test. This means that test thread has 5 ticks to
finish its job.
On platform where idle thread has low power mode enabled
(e.g. it8xxx2_evb), latency in waking up from low power mode will cause
main thread to wake up early before test thread has finished its work.
This symptom will break next test (osThreadGetCount() not equal to 2).
This change makes the test threads have a full 10 ticks to finish its job.
fixes: #57557
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
First implementation had a math error where the offset would be the
remainder from division (modulo). It should have been an ISO interval
minus the remainder. Refactored to not use modulo.
Signed-off-by: Morten Priess <mtpr@oticon.com>
This on-by-default option takes the majority of "link" time.
If people need the disassembly, they can turn it on.
Incremental builds of the bluetooth tester app:
```bash
west build -b nrf52840dk_nrf52840 zephyr/tests/bluetooth/shell
touch zephyr/subsys/bluetooth/shell/bt.c
time west build -b nrf52840dk_nrf52840
```
Before:
real 0m6,621s
user 0m6,430s
sys 0m0,175s
After:
real 0m1,011s
user 0m0,840s
sys 0m0,170s
```bash
rm -rf build
time west build -p -b nrf52840dk_nrf52840 zephyr/tests/bluetooth/shell
```
Before:
real 0m9,726s
user 0m11,735s
sys 0m2,665s
After:
real 0m4,545s
user 0m8,006s
sys 0m2,723s
Signed-off-by: Jonathan Rico <jonathan.rico@nordicsemi.no>
when ap mode is enable,
we don't enable iface by `net_eth_carrier_on` before,
this will cause wifi tx error.
this patch fix this issues.
Signed-off-by: YuLong Yao <feilongphone@gmail.com>
Accidentally statements to enable logging in the TCP socket test
where pushed. This broke some tests running on real devices due
to the additional code size.
Signed-off-by: Sjors Hettinga <s.a.hettinga@gmail.com>
Fixes a coverity-reported issue by explicitly ignoring the return value
of the cas-operation. The return value is the old value, but we are not
interested in it in the situation when we just want to initialize a
value if it is in the uninitialized state.
Fixes: https://github.com/zephyrproject-rtos/zephyr/issues/60474
Signed-off-by: Aleksander Wasaznik <aleksander.wasaznik@nordicsemi.no>
In certain scenarios, the semaphore sem_ticker_api_cb may be taken
during attempt to complete a synchronous ticker operation such as start
or stop, but is never released via ull_ticker_status_give. This could
happen if ticker temporarily runs out of ticker operation slots for any
ticker client.
The consequence of ULL stuck waiting in semaphore is anything from
allocation assertions to watchdog timeouts.
This commit also sets a timeout on ull_disable calls, which relies on
the disable callback being invoked from 'done'. Invocation of 'done' is
mandatory, and code shall not allow that not to happen, but to avoid
hiding the real cause, the semaphore now has a timeout which causes
assertion in the location the issue occurred.
Signed-off-by: Morten Priess <mtpr@oticon.com>
Check mayfly_is_running() to determine use of blocking- or non-blocking
version of lll_csrand, instead of k_is_in_isr().
As mayflies run in ISR context for Nordic platform, change will have no
impact on Nordic configuration.
For vendors using META_IRQ mayflies, implementation will now prevent
blocking and reduce latencies and jitter in soft-realtime code.
Signed-off-by: Morten Priess <mtpr@oticon.com>
When channel set to WIFI_CHANNEL_ANY, ap will not work.
This patch choose channel 0 when channel is WIFI_CHANNEL_ANY.
Signed-off-by: YuLong Yao <feilongphone@gmail.com>
INPUT_REL_WHEEL is the code that normally refer to scroller wheel, which
probably makes a bit more sense in this context, use that instead of
INPUT_REL_Y.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The DTC_OVERLAY_FILE variable is specified on the command line.
It's not preferable to set it in CMakeLists.txt.
The app.overlay file is used as the default overlay file, so use it.
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
The default decoder would take the micro-unit value of the old sensor
value and multiply it by INT32_MAX. This would, at times, cause an
overflow for the int64_t which is the cause of some bugs like when
-7952 was used (-7952000000 * INT32_MAX < INT64_MIN). Instead the new
math converts:
- `value_u * INT32_MAX / ((1 << header->shift) * 1000000)`
to a bitmap:
- `sample.val1` consumes the upper `N` bits
- `sample.val2 * BIT(32 - N) / 1000000` consumes the lower `32-N`
bits
This both improves the accuracy, and avoids the overflow since
`shift` is guaranteed to be between 0 and 31.
Signed-off-by: Yuval Peress <peress@google.com>
Implement the backend emul API for the ICM42688 motion sensor so it can
be automatically tested by the generic sensor test (see #60394).
Supports all channels (temp, accel XYZ, and gyro XYZ) at each of the
programmable full-scale accel and gyro ranges.
Also fixes an arithmetic bug in the driver that was causing a minor
error in the returned readings.
Signed-off-by: Tristan Honscheid <honscheid@google.com>
Add support for fetching individual channels rather than forcing the
application to always fetch them all. Potentially saves few i2c
transactions.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
Convert a few floating point operation to fixed point. May save some
stack and some flash as well on soft-fp systems.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
The register space for the device is on 8 bit, use uint8_t for register
address to the low level read and write functions.
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>