This makes things slightly cleaner, and we don't need to rely on the
deprecated net_buf_simple_init() API (which was a bit hackish for
these custom-constructed net_buf_simple objects anyway).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
When an __ASSERT() fails compiled for ARCH_POSIX,
instead of spinning forever (probably until sanitycheck times out)
it now terminates immediately and returns 1 to the shell
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This is one way we can support out of tree board definitions. Basically
all this needs is a board definition in the application source directory
that follows the same structure we have in the main Zephyr tree (also
allowing multiple custom boards). An application tree would look like
this for example:
boards/
CMakeLists.txt
prj.conf
README.rst
src/
with boards following the same structure as in Zephyr:
.
├── boards
│ └── x86
│ └── arduino_101
│ ├── doc
│ │ └── img
│ └── support
└── src
To use this, you need to specify the BOARD_ROOT variable on the command
line when building:
cmake -DBOARD=<board name> -DBOARD_ROOT=<path to boards> ..
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
I am the original author of the API and initial drivers, and would
like to maintain this area.
Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
The read/write_kernel_stack tests are confusingly named and incorrectly
implemented for ARM; they are intended to test that user mode threads
cannot read or write their privileged stacks. The privileged stacks
on ARM are not relative to the user stack, and thus their location
cannot be computed from the user stack. To find the privileged stack on
ARM, we have to use _k_priv_stack_find(), which we do during setup
in test_main() rather than from the usermode thread itself. Accessing
thread_stack directly from the test function requires making it
non-static in ztest, so we also give it a ztest_ prefix to avoid
collisions with other test programs. Rename the test functions and
global pointer variable to more accurately reflect their purpose.
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Prior to this commit, `flash_area_layout()` was being passed a pointer
to the incorrect type (`uint32_t *` where `int *` was expected). This
caused the following warning to be reported:
```
[...]/subsys/storage/flash_map/flash_map.c: In
function 'flash_area_get_sectors':
[...]/subsys/storage/flash_map/flash_map.c:191:32:
warning: passing argument 2 of 'flash_area_layout' from incompatible
pointer type [-Wincompatible-pointer-types]
return flash_area_layout(idx, cnt, ret, get_sectors_cb, &data);
^~~
[...]/subsys/storage/flash_map/flash_map.c:136:12:
note: expected 'int *' but argument is of type 'uint32_t * {aka long
unsigned int *}'
static int flash_area_layout(int idx, int *cnt, void *ret,
^~~~~~~~~~~~~~~~~
```
This commit changes the argument type to `u32_t` for both functions.
Signed-off-by: Christopher Collins <ccollins@apache.org>
The contributing instructions were currently centered exclusively around
Linux. Make them generic and cross-plaform while highlighting the tools
that do not currently work on Windows, namely:
* sanitycheck
* checkpatch
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
This fixes the issue when after incomplete timer expiration
host sent ACK.
The host failed in two cases:
1. Sending ACK right after the incomplete timer expiration;
2. Sending ACK from new RX context. Now, seq_auth of cancelled
message is not cleaned on RX reset, so segments of cancelled message
will be discarded when resend.
According to the Mesh Profile v1.0
"When the incomplete timer expires, the lower transport layer
shall consider that the message being received has failed and
cancel the acknowledgment timer. Any segment of a canceled
message shall be ignored."
Fixes#6023
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
Instead of composing expressions with a logical AND, break down it into
multiple assertions. Smaller assertions are easier to read. While at
it, compare pointers against the NULL value, and numbers against 0
instead of relying on implicit conversion to boolean-ish values.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Without the parenthesis, the code was asserting this expression:
start + (size > start)
Where it should be this instead:
(start + size) > start
For a quick sanity check when adding these two unsigned values together.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Commit 247782a7b3 moved the sam0 UART
and SPI configuration into pinmux. Using these drivers without pinmux
causes the kernel to skip the pin configuration.
Tested on arduino_zero.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Static variables that don't strictly need to be initialized at
boottime should be declared with __noinit. This makes a considerable
difference especially for large buffers.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Add a testcase.yaml configuration to spi_loopback test to include
it into sanitycheck.
Fixes#4576
Signed-off-by: Daniel Wagenknecht <wagenknecht.daniel@gmail.com>
This restores the board specific configurations that were present
before moving the test to using KConfig.
<board>.conf files from boards subdirectory get merged with
prj_base.conf file.
Signed-off-by: Daniel Wagenknecht <wagenknecht.daniel@gmail.com>
Convert this test to using KConfig instead of conditional compilation.
Standard configuration is provided by prj_base.conf and KConfig
default values.
Remove prj_<board>.conf files.
Signed-off-by: Daniel Wagenknecht <wagenknecht.daniel@gmail.com>
The old ARMV6_M Kconfig option has been removed, and so to correctly set
the dependencies for SW_VECTOR_RELAY we need to use the new
ARMV6_M_ARMV8_M_BASELINE.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
In the case of an unexpected PDU we need to send the right response.
This was already taken care of for PB-ADV, but not for PB-GATT.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
The Provisioner might have missed our earlier Link Acknowledgement, so
if we receive another one with matching Link ID and link.expect state,
simply send another acknowledgement.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
When sending a segmented message, the state could get stuck if the
advertising bearer fails in transmitting and we don't detect that it
happened. Add a send_start callback for all packets so we can always
know if sending fails.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
When both PB-ADV and PB-GATT are enabled, the PB-ADV code (prov.c)
uses the bt_mesh_proxy_get_buf() API to get a net_buf_simple buffer.
Unfortunately this function also suffers from the same issue that was
fixed by commit 2b273444c1.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In net_app_init_client(), the remote port is set after an initial
set of checks based on the remote_addr's assigned family.
However, if the peer_addr_str is a host name which needs to be
resolved via DNS, the family won't be set yet, and the port is
left as 0.
To fix this behavior let's move the port assignment after the
DNS lookup section to be sure that the remote sa_family is set.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
As discovered in https://github.com/zephyrproject-rtos/zephyr/issues/5952
...a duplicate call to k_delayed_work_submit_to_queue() on a work item
whose timeout had expired but which had not yet executed (i.e. it was
pending in the queue for the active work queue thread) would fail,
because the cancellation step wouldn't clear the PENDING bit, causing
the resubmission to see the object in an invalid state. Trivially
fixed by adding a bit clear.
It also turns out that the behavior of the code doesn't match the
docs, which state that a PENDING work item is not supposed to be
cancelled at all. Fix the docs to remove that.
And on yet further review, it turns out that there's no way to make a
test like the one in the linked bug threadsafe. The work queue does
no synchronization by design, so if the user code does no external
synchronization it might very well clobber the running handler. Added
a sentence to the docs to reflect this gotcha.
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Courtesy of thomsten on IRC, add a link to a handy RTT viewer written in
Python and cross-platform.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Describe how to disable the UART console to avoid unexpected
redirections that will prevent the console output to go through RTT.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Remove unused _k_thread_single_start() as this logic is
now moved to _impl_k_thread_start().
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
This patch fixes a hole in the stack guard configuration. The initial
branch to main is missing the stack guard configuration.
Fixes: Issue #3718
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This patch adds documentation on the design and implementation of stack
objects for architectures which utilize MPU backed stack and memory
protection.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This patch fixes calculations for the top of the interrupt and main
stacks. Due to power of two alignment requirements for certain MPUs,
the guard size must be taken into account due to the guard being
counted against the initial stack size.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This patch adjusts the calculation of the overflow size for the kernel
stack tests which read/write to areas below the current user stack.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This patch adds support for userspace on ARM architectures. Arch
specific calls for transitioning threads to user mode, system calls,
and associated handlers.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
This patch adds a configure_mpu_user_context API and implements
the required function placeholders in the NXP and ARM MPU files.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Add the STM32 ccm_bss, ccm_noinit, abd ccm_data sections
to the list of allowed sections so the sanity check passes.
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
Configure ccm size and address via dts. According to the DT
specification, the unit-address of a node must match the
first address specified in the reg property of the node.
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
The STM32 has special Core Coupled Memory, ccm for short, that can
only be accessed through the CPU and can not be use for DMA.
The following 3 sections have been added.
- ccm_bss for zero initialized data
- ccm_data for initialized data
- ccm_noinit for uninitialized data
Signed-off-by: Erwin Rol <erwin@erwinrol.com>
Allow for any toolchain variants to be useable with sanitycheck without
the need for them to be registered.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Move toolchain definitions into toolchain/ and move compilers to
compilers/
Usage of toolchain- for everything was confusing, there are the actual
compiler related definitions and there is the toolchain/SDK related
configs, so keeping them separate helps understand the different and
prevents confusion.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
We want to support other toolchain not based on GCC, so the variable is
confusing, use ZEPHYR_TOOLCHAIN_VARIANT instead.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
When we added system call support to dma_start/dma_stop we forgot to
include <syscalls/dma.h> to get the full proper magic implemented.
Adding the header in fixes builds when system call support is not
enabled and using dma support.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>