We are using the CMake command 'file(STRINGS' (which defaults to only
decoding ASCII) to read Kconfig configurations. When UTF-8 characters
are detected they are treated as newlines.
This behaviour has caused issues when users have input UTF-8
characters into Kconfig values. E.g. USB device descriptor strings.
This commit adds the flag 'ENCODING "UTF-8"' to the 'file(STRINGS'
command so that UTF-8 characters are correctly passed through the
build system.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Bootlin is kindly providing an instance of their Elixir source code
cross-referencer tool with an index of the Zephyr kernel and samples
code.
This fixes#1420
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
Previous implementation was buggy, destroying
resources with pending thread and race conditions.
New version tests basic functionality with 2
threads and basic synchronization.
Signed-off-by: Juan Manuel Torres Palma <j.m.torrespalma@gmail.com>
Modifies several functions that are causing wrong
behaviour.
* semaphore.h: add missing restrict keyword.
* sem_destroy(): check that nobody is waiting
before destroying the object.
* sem_timedwait(): simpify function logic and
fix a bug when abstime > currtime, that passed
ticks instead of ms to k_sem_take().
* sem_wait(): avoid unnecessary checks.
* sem_init(): add pshared value assertion.
Signed-off-by: Juan Manuel Torres Palma <j.m.torrespalma@gmail.com>
Replace specific STM32F1 references with generic STM32 ones.
Use generic names like U(S)ARTx for instances which have different
naming across STM32 families.
Signed-off-by: Ilya Tagunov <tagunil@gmail.com>
Add testcases for following scenario
Test to check alert_recv(timeout) against the following cases
1. The current task times out while waiting for the event.
2. There is already an event waiting (signalled from a task).
3. The current task must wait on the event until it is signalled
from either another task or an ISR
Test to check alert_recv(K_FOREVER) against the following cases:
1. There is already an event waiting (signalled from a task and ISR).
2. The current task must wait on the event until it is signalled
from either another task or an ISR
Test to checks that the event handler is set up properly when
alert_event_handler_set() is called. It shows that event handlers
are tied to the specified event and that the return value from the
handler affects whether the event wakes a task waiting upon that
event
Signed-off-by: Savinay Dharmappa <savinay.dharmappa@intel.com>
Remove unnecessary header inclusion in nordic's nrf5 random
driver which added a dependency to ext/hal/nordic.
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Single backslashes outside of a code-block are treated as escape
characters, so need to double up to get a single backslash rendered in
the generated HTML.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
This was originally added as a work-around to avoid the heavy stack
consumption of the TinyCrypt PRNG when generating NRPAs. This is
no-longer an issue, and there are in fact no (in-tree) users of this.
Remove it before it gains any wider users, since it was in many ways a
hack/work-around to begin with.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
In some cases the app may want to force using the identity address
regardless of privacy support or what type of advertising is done.
Provide such an option in bt_le_adv_param.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Make the service parameter optional in getaddrinfo().
The application should be able to use NULL as service when only
interested in the host lookup.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Add freeaddrinfo() to complement getaddrinfo().
Existing applications using getaddrinfo() will usually free
allocated memory using freeaddrinfo(). Even if nothing is allocated
the function should exist to avoid having to change the application
when porting.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Add support for MSG_DONTWAIT flag in send() and sendto(). This
aligns with the same flag used in recv() and recvfrom().
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
With upcoming ICs that are not in the nRF5x family, rename the flash
driver and all its dependencies from nrf5 to nrf.
Should also fix the issue introduced by f49150cab6 which broke the
assignment of the flash device due to a partial rename.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Avoid listing internal function in the public API documentation. After
enabling those doxygen configs, we go lots of errors and bad refs that
were fixed.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add k_fifo kernel object timeout scenario tests like basic
k_fifo API tests with timeouts and tests which involve other
threads to get/put items from/into k_fifo with timeouts.
This test is inspired from test_stack legacy test from
Zephyr v1.7.0 release.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Add k_fifo kernel object usage scenario tests between thread
to thread and thread to ISR.
This test is inspired from test_fifo legacy test from
Zephyr v1.7.0 release.
Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
The k_mem_partition structs need to be placed in the kernel memory.
This patch ensures that these structs are placed correctly.
Also when a struct k_mem_domain is declared it is advised to add
__kernel.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
There was not enough space for \0 at the end of the string.
Coverity-CID: 183057
Coverity-CID: 183050
Fixes#6675Fixes#6682
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Network packet cannot be NULL so no need to check its value.
Coverity-CID: 183063
Fixes#6669
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Decode Kconfig sources as UTF-8 instead of decoding them according to
the system locale (which might be ascii-only).
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Decode Kconfig sources as UTF-8 instead of decoding them according to
the system locale (which might be ascii-only).
This resolves an issue that can be reproduced like this:
$ export LANG=C
$ echo '# Sebastian Bøe' >> ~/zephyr/Kconfig
$ build_any_zephyr_app
See the Python comment for details.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
No need to verify that the configuration is proper if we are
compiling the driver for unit test and not going to ever run
the test.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
As the board has ethernet chip it makes sense to enable the
ethernet support by default.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If CONFIG_NET_DEBUG_NET_PKT was enabled, then a call to
net_pkt_get_reserve_data() was calling wrong debug function
which caused compile error.
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add support for MSG_PEEK flag in recv and recvfrom.
This flag is needed when using non-zephyr embedded applications with
Zephyr's socket API.
Signed-off-by: Stig Bjørlykke <stig.bjorlykke@nordicsemi.no>
Memory leak occurs if neighbor table is full and echo request from an
unknown neighbor is received. Hence, on an attempt to send NS unref of
pending is not done, causing the memory leak.
Signed-off-by: Ruslan Mstoi <ruslan.mstoi@intel.com>
Define IRQ number for SecureFault Handler when building Secure
Firmware for non-CMSIS-compliant ARM Cortex-M MCUs.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This was reported by valgrind
Source and destination overlap in memcpy(0x80c18c0, 0x80c18c0, 6)
at 0x4035C3E: memcpy (vg_replace_strmem.c:1023)
by 0x80978CA: ethernet_send (ethernet.c:319)
by 0x8061B9B: net_if_send_data (net_if.c:281)
by 0x805F215: net_send_data (net_core.c:399)
by 0x8080998: send_mldv2_raw (ipv6.c:2858)
by 0x8080BA6: send_mldv2 (ipv6.c:2889)
by 0x8080D6C: net_ipv6_mld_join (ipv6.c:2915)
by 0x8061EF0: join_mcast_allnodes (net_if.c:438)
by 0x8062CA4: net_if_ipv6_addr_add (net_if.c:826)
by 0x8062296: net_if_start_dad (net_if.c:557)
by 0x8066667: net_if_up (net_if.c:2107)
by 0x8066AF0: net_if_post_init (net_if.c:2341)
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
A previous commit had mistakenly overwritten the copyright years instead
of extending the range. Fix this mistake so that the proper range is
recorded.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The existing nrf5_common.h now applies to other Nordic ICs that are not
part of the "5" family. Instead rename this to nrf_common.h to cover the
upcoming ICs that belong to other families.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Upcoming Nordic ICs that share many of the peripherals and architecture
with the currently supported nRF5x ones are no longer part of the nRF5
family. In order to accomodate that, rename the SoC family from nrf5 to
nrf, so that it can contain all of the members of the wider Nordic
family.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
If the thread that sends the configuration messages has low priority
and is sending to the local node (a common use case currently) it's
possible that the response arrives before the cli->op_* state
variables are set, resulting in the message never getting properly
processed and the client API call timing out.
Split the initialization into a separete cli_prepare() call and add a
cli_reset() to clean up the variables in case of premature completion
of the client operation (e.g. due to message sending failure).
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
It's not always guaranteed that param->status will be non-NULL,
especially not after a subsequent patch to fix a race condition with
the response waiting.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Previously qemu_x86 was the only device to run this test in
userspace. With this patch, the pipe testcases can now
run on any device which has userspace enabed.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>