Follow the pattern we have for other peripherals in that if the driver
class (CAN) is enabled than enable the driver for that class
(CAN_STM32). Also have the STM32 CAN driver depend on being on a STM32
SoC.
Remove setting of CONFIG_CAN_STM32 in any .conf files as it will get set
of CONFIG_CAN is set/enabled.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
RTC_Alarm IRQ is mentioned as an exti interrupt in documentation,
so it was available in exti handler.
Though, in Zephyr it is used driectly in RTC driver.
Having it in exti generates and issue when activating RTC driver,
so remove its handling from exti driver.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
IRQ lines definition in function __stm32_exti_connect_irqs ifdefery
does not match __stm32_exti_isr_x_y functions definitions.
Fix this.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The name of the CAN message and filter was changed so this
needs to be changed too here.
Fixes#13716
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
- newlib needs c standard includes (so no -nostdinc)
- xcc needs toolchain headers (so no -nostdinc)
- with host gcc:
- x86_64 should not build with standard includes (-nostdinc needed)
- native_posix should build with standard include (no -nostdinc)
..
..
To simplify, abstract this and move it to compilers/toolchains and still
depend on what the application wants.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Also, for now x86_64 does not support newlib, so do not enable newlib
for this arch until we have a solution.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
XCC is based on xcc, but is nothing like gcc and his many differences.
Instead of ifdeffing the gcc code with Xcc specifics, maintain it
standalone.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add missing CONFIG_GPIO required by the nRF52 board-specific Bluetooth
Mesh On/Off application sample.
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
This test is breaking CI, we need a fix first before we go and enable
tests.
This reverts commit dc39a9adcf.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Some older variants of newlib (like what we have on xtensa or riscv in
SDK 0.9.5) define timespec and itimerspec in sys/types.h. The timespec
can be handled by a check of __timespec_defined. However itimerspec
doesn't have anything similar so we have to do it by newlib version
info.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
With newer newlib we get a build error with mqueue.h realted to mode_t.
Let's just let newlib define mode_t and have minimal libc also define
it in sys/types.h. So we remove the duplicated definition in
posix/unistd.h.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add a build variant of the posix tests with newlib enabled. Since the
interation of posix is greatly related to the libc we should have these
tests build with and without newlib support.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Some mcux gpio instances do not have dedicated interrupt vectors and
therefore conditionalize out the IRQ_CONNECT() and irq_enable() calls
during driver initialization. The driver initialization incorrectly
returned an error in this case, when really it just has nothing to do.
The driver can still be used without interrupts, and the gpio configure
function returns an error if an application tries otherwise.
Commit a68120de6d introduced a check on
the init return value to prevent applications from using drivers that
fail to initialize. This in turn caused zephyr/samples/basic/threads to
assert on the frdm_kl25z board. Fix this by modifying the mcux gpio
driver to return success when there is no interrupt to connect.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
- differentiating actual "fragment" to buffer element from a net_pkt
- instead of copying data (and thus allocating buffer) let's just take
the fragment buffer and put it into result packet.
- fixing compilation issue in relevant test
It's more efficient that way, as we use already allocated fragment
buffer instead of reallocating/deallocating after each fragment
reception.
A possible optimization would be to calculate the actual size + header
difference if only the actual size is close to the target size.
It would avoid to get a dry run of the header decompression for each
fragment received. The difficulty being in finding the sweet spot when
it is relevant to calculate the header difference.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Since we don't want to redo the complex calculation, let's reuse the
uncompress functions, adding a dry_run possibility to those.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This is an integral part of userspace and cannot be used
on its own. Fold into the main userspace configuration.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
When DTLS client was added to `poll` before/during the handshake, it
could throw errors and in some circumstances (when polling thread was
cooperative and had higher or equal priority to the handshake thread)
could lead to a deadlock in the application.
Prevent that, by blocking on handshake semaphore instead of fifo. Poll
will start using fifo for data poll only after handshake is complete.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Instead of simple bool value, use a semaphore to notify that TLS
handshake is complete. This way, we can monitor this value with k_poll.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
System workqueue stack was not large enough to handle DTLS handshake,
which lead to system crash.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Errno value is only significant when `recvfrom` function indicated an
error (by returning -1). We should not depend on it's value if no error
is notified.
As the return value of `recvfrom` is already checked, misused errno
verification can simply be removed.
Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
Introduce toolchain_cc_asm macro to capture toolchain specific flags
related to assembly.
-D_ASMLANGUAGE is kept common for all, assuming -D as define flag is
supported by all compilers (which is almost the case).
No functional change expected.
Clang's flags are compatible with gcc, and are thus inherited.
This is motivated by the wish to abstract Zephyr's usage of toolchains,
permitting easier porting to other (commercial) toolchains.
Signed-off-by: Mark Ruvald Pedersen <mped@oticon.com>
The macro RB_FOR_EACH_CONTAINER could run infinitely when the function
_rb_foreach_next returns NULL.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Functions which have to be located in RAM are placed by SiLabs library
code in section '.ram'. Corresponding section used by Zephyr is called
'.ramfunc'. This patch renames SiLabs naming to match Zephyr's.
This solution was chosen over adding '.ram' function to Zephyr linker
scripts not to pollute them. However, this patch needs to be reapplied
every time SiLabs library version is updated.
Fixes#13192
Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This is an application facing define, specific to this
driver, for the public uart_drv_cmd() API. Put it with
public headers.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Test was failing on nios2 with:
../app/libapp.a(test_stack_contexts.c.obj): in function `tstack_pop':
/home/galak/git/zephyr/tests/kernel/stack/stack_api/src/test_stack_contexts.c:31:
warning: unable to reach (null) (at 0x004002f4) from the global pointer
(at 0x004082fc) because the offset (-32776) is out of the allowed range,
-32678 to 32767
Fixes#13595
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
User mode needs to be able to read this value in
compiler generated function prologues/epilogues.
Special handling in init.c for arches that use
_data_copy. This happens before _Cstart() gets
called. We need to make sure that the compiler
stack canary checks in _data_copy itself do not
fail.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We need a generic name for the partition containing
essential C library globals. We're going to need to
add the stack canary guard to this area so user mode
can read it.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
We'd like these macros to simply do nothing if the
feature isn't enabled rather than erroring out.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Instead of having to enable ramfunc support manually, just make it
transparently available to users, keeping the MPU region disabled if not
used to not waste a MPU region. This however wastes 24 bytes of code
area when the MPU is disabled and 48 bytes when it is enabled, and
probably a dozen of CPU cycles during boot. I believe it is something
acceptable.
Note that when XIP is used, code is already in RAM, so the __ramfunc
keyword does nothing, but does not generate an error.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
The linker file defines the __ramfunc_ram_size symbols to get the size
of the __ramfunc_ram section. Use that instead of computing the value at
runtime from the start and end symbols. This saves 16 bytes of code with
CONFIG_RAM_FUNCTION=y.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Using __ramfunc to places a function in RAM instead of Flash.
Code that for example reprograms flash at runtime can't execute
from flash, in that case must placing code into RAM.
This commit create a new section named '.ramfunc' in link scripts,
all functions has __ramfunc keyword saved in thats sections and
will load from flash to sram after the system booted.
Fixes: #10253
Signed-off-by: qianfan Zhao <qianfanguijin@163.com>
No functionality changes, just doxygen additions and some
things are hidden from document generation.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add some short doc comments at the beginning so that people can quickly
get an idea of what they're about.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
It's confusing that "address" is often used within the same function to
refer to both node paths and e.g. address cells.
Make things easier to understand by calling /foo/bar a path instead.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
extract_property() is meant to generate #defines for a single property,
like 'foo = <1 2 3>'. Currently, it also generates node-level #defines
related to parent buses.
That makes the intent of the code hard to understand, and also means
that identical node-level #defines get redundantly added multiple times
(once per property).
Generate the node-level bus #defines before processing properties, in
generate_node_defines(). Use a new generate_bus_defines() helper.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Due to the way the code was structured,
flash.extract_partition(node_path) was called multiple times for the
same 'node_path'.
That must've been a mistake to begin with (but was hard to spot before
the code was cleaned up). Move the generation of per-node #defines out
of the property loop.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit fixes a test in kernel/mem_protect/userspace,
which was attempting to read from an address that was not
necessarily within the image memory range, causing faults
in ARM TrustZone-enabled builds.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Group the networking chapters for reference document so that the
layout is more logical and easier to read.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>