Most APIs have the default synchronous and an asynchronous version
with the sufix _async because that is the most common use.
All devices in tree right now are using the synchronous version, so
just change it to be consistent with the rest of the system.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Since we are using mutex to protect critical sections and mutexes are
reentrant, it is possible to get rid of atomic for the state because
we can lock the mutex in device_pm_callback.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Changing from spinlock to mutex makes the running thread be preempted
and the workqueue ran. This changed the prints order in this sample.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The sample would consequently try to print invalid data
the offset into the data was incorrect calculated to
always be at the end of the data, instead of at the
end of the data minus an offset.
Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
File prj.mcp2515.conf was previously removed from project as it was
made redundant.
Paths containing uppercase CAN were changed to lowercase.
Signed-off-by: Nick Ward <nick.ward@setec.com.au>
When a WIFI driver is slow to get interface up the system not connect
to WIFI access point. This add some tries to let driver be proper
initialize to allow accept connection request.
Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
Similar to commit c6ff61220e, use a
harness config to limit execution of the adafruit_2_8_tft_touch_v2
sample variant to boards that have this shield attached.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The PR fixes the pwm_led sample:
- now test doesn't rely on any specific device name
- Logs which are scanned with regex in the test are printed
only after a command passes (before failures were not
affecting the test verdict)
- If 1 sec cycle is not supported appropriate info is printed
and won't cause the test to failed
- Changed second "Turned off" msg so regex doesn't mix it with the
the first one.
Fixes#35524
Signed-off-by: Maciej Perkowski <Maciej.Perkowski@nordicsemi.no>
The scheduler has historically had an API where an application can
inform the kernel that it will never create a thread that can be
preempted, and the kernel and architecture layer would use that as an
optimization hint to eliminate some code paths.
Those optimizations have dwindled to almost nothing at this point, and
they're now objectively a smaller impact than the special casing that
was required to handle the idle thread (which, obviously, must always
be preemptible).
Fix this by eliminating the idea of "cooperative only" and ensuring
that there will always be at least one preemptible priority with value
>=0. CONFIG_NUM_PREEMPT_PRIORITIES now specifies the number of
user-accessible priorities other than the idle thread.
The only remaining workaround is that some older architectures (and
also SPARC) use the CONFIG_PREEMPT_ENABLED=n state as a hint to skip
thread switching on interrupt exit. So detect exactly those platforms
and implement a minimal workaround in the idle loop (basically "just
call swap()") instead, with a big explanation.
Note that this also fixes a bug in one of the philosophers samples,
where it would ask for 6 cooperative priorities but then use values -7
through -2. It was assuming the kernel would magically create a
cooperative priority for its idle thread, which wasn't correct even
before.
Fixes#34584
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
Removes the requirements.txt from the training directory of the
magic wand sample as it is causing issues in CI. Updates README.md
to explicitly state the Python packages listed in requirements.txt.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
USB audio class samples are generic and can be built for any
board that supports USB device and isochronous endpoints.
Add app.overlay that uses aliases and remove board specific overlays.
Note: USB audio is still experimental and even though the sample can
be built for specific platform, it does not mean that it can be run
on it without issues.
Fixes: #25313
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Enable the option to pause the watchdog if the MCU is halted by a
debugger.
This fixes an issue with some Nordic MCUs (see #33509) where the board
could not be flashed anymore if a short watchdog timeout (<100 ms) was
used.
Signed-off-by: Martin Jäger <martin@libre.solar>
Changes CMakeLists.txt in TensorFlow samples from explicit file
list to a GLOB capturing src/* to make TensorFlow samples consistent
with other samples in tree.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Fixes documentation for samples that incorrectly state that TensorFlow
library requires the -fno-threadsafe-statics flag to compile.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Adds no-threadsafe-statics to compiler flags for gcc and arcmwdt.
The flag is required to compile the samples - the module can compile
without it.
Signed-off-by: Lauren Murphy <lauren.murphy@intel.com>
Converts the display driver and lvgl sample.yaml to select boards for
the adafruit_2_8_tft_touch_v2 shield configuration by depending on the
arduino_{gpio,i2c,spi} features instead of using an explicit
platform_allow list. This will enable twister to automatically select
new boards that add support for Arduino ports.
The reel_board and reel_board_v2 are excluded due to a conflict between
display drivers (onboard display vs. shield display).
The ubx_evkannab1_nrf52832 board is excluded due to a conflict between
the arduino_spi and arduino_i2c ports, which cannot be used
simultaneously.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Rename the NXP LPCXpresso55S16 board definition from
lpcxpresso55s16_ns (non-secure) to lpcxpresso55s16 and remove TF-M
configuration options.
While the LPC55S16 does have Arm TrustZone support, there is no TF-M
support available upstream yet.
Fixes#35100
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
If the label property is missing in a "pwm-leds" compatible DT node
(which is almost always the case), then the device name is now set to
DT_NODE_FULL_NAME instead of "LED_PWM_$inst" previously.
This allows applications to use the DEVICE_DT_NAME macro to retrieve
the device name instead of gessing an arbitrary string.
Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
Fixes sample execution ending early with error, as it attempted
to mount the LittleFS partition second time, after it has already
been mounted by the auto-mount feature.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Add minimum harness and to get the sample passed when run using
twister.
Adding console validates uart init with DEVICE_RUTIME=y.
Additionally, clarify comment about DEBUG activation.
Fixes#35033
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Converts the Bluetooth peripheral_hr sample.yaml to select boards for
the frdm_kw41z shield configuration by depending on the arduino_serial
feature instead of using an explicit platform_allow list. This will
enable twister to automatically select new boards that add support for
an Arduino serial port.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
"child resuming" text is printed when dummy_device_pm_ctrl is
called. The driver is using the async api, this means that this call
will happen only when the worqueue runs what will happen only when
this thread blocks waiting on the conditional variable.
The last thing is, the dummy driver was putting the parent driver
asynchronously consequently the "parent suspending" message would just
print after "Device PM sample app complete". Just use the sync API to
get these messages printed in the expected order.
Fixes#35336
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Converts the bmg160 sample application to check the sensor device at
build time instead of runtime. This fixes a Coverity issue for logically
dead code introduced in commit 5832e588e3.
Fixes#35118
Coverity-CID: 235919
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Converts the adxl372 sample application to check the sensor device at
build time instead of runtime. This fixes a Coverity issue for logically
dead code introduced in commit 72795c3e6c.
Fixes#35119
Coverity-CID: 235932
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
The sockaddr address length was not initialized properly
when receiving packets.
Coverity-CID: 232698
Fixes#35159
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If we don't get a dev pointer from device_get_binding() we should
not dereference it. Just drop the name from the printk message
as in the future this is likely to use DEVICE_DT_GET().
Fixes#35112
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The required configuration is already selected by the Kconfig file for
all nrf devices that support TEMP peripheral.
Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
The TEMP sensor is not present in configurations like
nrf5340dk_nrf5340_cpuappns.
Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
Introducing MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE settings.
The MBEDTLS_PROMPTLESS can be set to true whenever configuration of
mbedTLS is done from a subsystem or module.
Such an example is OpenThread, which selects mbedTLS for some predefined
crypto settings using OPENTHREAD_MBEDTLS=y.
Unfortunately, extensive use of select can easily cause stuck symbol
syndrome making it harder than neccesarry for users to later reconfigure
as they easily get stuck in incompatible configurations.
Providing a MBEDTLS_PROMPTLESS allows such configurations to disable the
MBEDTLS prompt itself when selected but avoid stuck symbol if user
select another security configuration.
Similar with CUSTOM_MBEDTLS_CFG_FILE which ensures that user must
explicitly select this symbol before providing a custom mbedTLS config
file.
Today, other parts the Kconfig tree may set a default value for
MBEDTLS_CFG_FILE but that value is stuck and thus changed Kconfig
selections elsewhere in the tree will not adjust the value.
Introducing CUSTOM_MBEDTLS_CFG_FILE ensures it is known when the user
has provided the value.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Instead of exposing publicly the TF-M NS interface include
directories, we include them when we build relevant projects.
This is required, as the TF-M include directories contains
psa crypto sources that are also provided by the mbedtls
crypto module. The downside of this solution is that the
TF-M includes need to be added explicitly in each application
that uses TF-M APIs.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
In Mbed TLS:
commit eccd88871767e2fba5f3a079cfdfcb77c376cf20
Author: Gilles Peskine <Gilles.Peskine@arm.com>
Date: Tue Mar 10 12:19:08 2020 +0100
Rename identifiers containing double-underscore
changes the name of a symbol we use. As part of upgrading to newer
versions of Mbed TLS, change the name of the symbol we use.
A better fix would be to not use this symbol at all, and perhaps define
our own symbol the same way this internal symbol is defined within the
library.
Signed-off-by: David Brown <david.brown@linaro.org>
Introducing MBEDTLS_PROMPTLESS and CUSTOM_MBEDTLS_CFG_FILE settings.
The MBEDTLS_PROMPTLESS can be set to true whenever configuration of
mbedTLS is done from a subsystem or module.
Such an example is OpenThread, which selects mbedTLS for some predefined
crypto settings using OPENTHREAD_MBEDTLS=y.
Unfortunately, extensive use of select can easily cause stuck symbol
syndrome making it harder than neccesarry for users to later reconfigure
as they easily get stuck in incompatible configurations.
Providing a MBEDTLS_PROMPTLESS allows such configurations to disable the
MBEDTLS prompt itself when selected but avoid stuck symbol if user
select another security configuration.
Similar with CUSTOM_MBEDTLS_CFG_FILE which ensures that user must
explicitly select this symbol before providing a custom mbedTLS config
file.
Today, other parts the Kconfig tree may set a default value for
MBEDTLS_CFG_FILE but that value is stuck and thus changed Kconfig
selections elsewhere in the tree will not adjust the value.
Introducing CUSTOM_MBEDTLS_CFG_FILE ensures it is known when the user
has provided the value.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
Remove this intrusive tracing feature in favor of the new object tracing
using the main tracing feature in zephyr. See #33603 for the new tracing
coverage for all objects.
This will allow for support in more tools and less reliance on GDB for
tracing objects.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
If thread names are enabled, set them up so we can get nice tracing
output and know which thread is which.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Add support for new tracing macros in test backend. Move header from
sample into the subsystem and make it available for general testing with
any application.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This sample turn on/off the LED every two seconds and then sleeps. When
the LED is on we don't want the system putting it down when goes to
sleep. So, just setting this device as busy.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The sync API was using k_poll_signal and in certain conditions is
possible multiple threads waiting on a signal leading to an undefined
behavior.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
The context parameter used across device power management is
actually the power state. Just use it and avoid a lot of
unnecessary casts.
Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
Add mimxrt685_evk_cm33 board to the platform_allow list
for the littlefs sample application.
Signed-off-by: Saurabh Jagdhane <saurabh.jagdhane@nxp.com>
Restrict sample execution in CI to boards that have
"st,stm32-lptim" enabled so we're sure it is a STM32 target.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>