Some of macros initially created in the logger has been moved
to util.h. This commit replaces custom macros with the one
from util.h
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Added macros for conditional code generation based on a flag.
Additionally, added macros for getting first and second argument
from variable list of arguments and getting all arguments except
the first one.
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
Dropped logs were not counted if logger has no backend
attached (system startup phase).
Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
We now generate CS GPIO defines from the DTS that we can utilize. We
needed to slightly update the #defines in the driver from:
DT_MICROCHIP_ENC28J60_0_CS_GPIOS_{PIN,CONTROLLER} to
DT_MICROCHIP_ENC28J60_0_CS_GPIO_{PIN,CONTROLLER}
Fixes#12640
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Fixes bug below:
subsys/usb/class/cdc_acm.c:554:15: error: ‘dev_data’ undeclared (first
use in this function) k_work_init(&dev_data->cb_work,
cdc_acm_irq_callback_work_handler); ^~~~~~~~
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
The SPI1 controller that is connected to the mcr20a block utilizes the
hardware chipselect and not a GPIO CS. So remove the cs-gpios property.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The SPI0 node had a property called 'cs' which wasn't used or defined as
part of the binding yaml. So let's remove it.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
We get warnings from dtc when building any of the NXP i.MX-RT boards of
the form:
mimxrt1020_evk.dts_compiled: Warning (simple_bus_reg):
/soc/random@400CC000: simple-bus unit address format
error, expected "400cc000"
Simple fix to make everything lowercase to have the unit-address and reg
match.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Share lis2dh driver among few accelerometer sensors that has
same register interface: LIS2DH, LIS3DH, LSM303DLHC, LIS2DH12,
LSM303AGR.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Use auto-generated device tree macros in LIS2DH driver to avoid
usage of dts.fixup files. The triggered interrupt part has been
slightly hacked to automatically understand whether only int1 is
configured or both int1 and int2.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Building tests/kernel/common/kernel.common with the new crosstools
SDK-ng resulted in an orphan short read-only data section. Fix this by
adding the .srodata section to the RISC-V linker script.
Signed-off-by: Nathaniel Graff <nathaniel.graff@sifive.com>
Move to using the generated DT_INVENTEK_ESWIFI_ESWIFI0_CS_GPIO_pin and
DT_INVENTEK_ESWIFI_ESWIFI0_CS_GPIO_CONTROLLER defines and drop the
DT_ESWIFI0_CS_GPIOS_PIN & DT_INVENTEK_ESWIFI_ESWIFI0_CS_GPIO_PIN from
dts_fixup.hl
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add support to generation script to generate defines for GPIO CS
[WIP], need to clarify some issues on how CS's look when we mix GPIO-CS
and HW CS.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add the ability to extract just a single instance from extract_cells and
extract_controller. This lets us pass in a prop_values like:
cs-gpios = < 0x02 0x11 0x00 >, < 0x03 0x05 0x00 >;
and extract just index = 1 if we want < 0x03 0x05 0x00 >.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Move extract_cells and extract_controller functions into globals so they
can be utilized outside of just the main extract_dts_includes script.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Building the documentation for all the Kconfig options significantly
adds to the total doc build time. When making and testing major changes
to the documentation, we provide an option to temporarily stub-out
the auto-generated configuration documentation so the doc build process
runs much faster.
To enable this mode, set the following option when invoking cmake
-DKCONFIG_TURBO_MODE=1
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Previous release had some issues with unicode and was failing to install
in our CI. Those issues were fixed in this release.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Not necessary with gcc, and Zephyr is inconsistent about using the
qualifier, but making the intent explicit is a good thing.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The existing implementation of z_clock_set_timeout() calculates the
compare value based on a complex series of operations including an
unconditional integer division and multiplication intended to ensure the
compare value is aligned to a tick boundary. On the nRF51 this division
requires a call to an outline function with a data-dependent execution
time.
In the common case where the timeout is set less than one tick past the
last observed tick the devision can be elided, as can several extra
operations intended to deal with fractional ticks.
The code also failed to account for a ticks-per-cycle that violated the
minimum delay required to guarantee a compare value would result in a
match without wrapping. The minimum delay was also unreasonably long
(about 1 ms). Reduce it to a more reasonable value to allow for a
higher ticks-per-second, and diagnose attempts to set the tick frequency
above the supported maximum (8192 Hz).
Finally, move the parts of the compare calculation that are not
dependent on the live counter value out of the locked region.
Prior to this change the observed time between the irq_lock() and
irq_unlock() in z_clock_set_timeout() on the nRF51 ranged between 5 us
and 8 us.
With the revised algorithm the observed lock duration is between 2.16 us
(1024 Hz) and 2.88 us (100 Hz) in the common case that the compare is
set within the current tick. If the compare is set late the duration
will be higher, but no greater than the previous implementation.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The RTC COUNTER register doesn't care that it receives a value larger
than it can hold; it'll discard the bits internally. No need to spend
cycles doing it manually.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
spinlock gains us nothing on an architecture that doesn't support SMP.
Use the standard irq_lock() API so when we search for conditions that
may decrease ISR responsiveness we can find them.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Whether a timeout is linked into the timeout queue can be determined
from the corresponding sys_dnode_t linked state. This removes the need
to use a special flag value in dticks to determine that the timeout is
inactive.
Update _abort_timeout to return an error code, rather than the flag
value, when the timeout to be aborted was not active.
Remove the _INACTIVE flag value, and replace its external uses with an
internal API function that checks whether a timeout is inactive.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
k_poll events are registered in a linked list when their signal
condition has been met. The code to clear event registration did not
account for events that were not registered, resulting in double-removes
that produced core dumps on native-posix sanitycheck.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
The original implementation allows a list to be corrupted by list
operations on the removed node. Existing code attempts to avoid this by
using external state to determine whether a node is in a list, but this
is fragile and fails when the state that holds the flag value is changed
after the node is removed, e.g. in preparation for re-using the node.
Follow Linux in invalidating the link pointers in a removed node. Add
API so that detection of particpation in a list is available at the node
abstraction.
This solution relies on the following steady-state invariants:
* A node (as opposed to a list) will never be adjacent to itself in a
list;
* The next and prev pointers of a node are always either both null or
both non-null.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
CONTAINER_OF() on a NULL pointer returns some offset around NULL and not
another NULL pointer. We have to check for that ourselves.
This only worked because the dnode happened to be at the start of the
struct.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Although sys_dnode_t and sys_dlist_t are aliases, their roles are
different and they appear in different positions in dlist API calls.
Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Some of the events from USBD peripheral (i.e. cable disconnect)
were handled in IRQ context and some of them (i.e. ep r/w events) in
system workqueue (inherited from initial driver implementation).
This may lead to race condition in some specific situations.
Currently, all of the events are enqueued in ISR and processed in
workqueue. Driver is reinitialized on queue overflow and queue size
is configurable in KConfig.
Fixes#12016
Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
In Zephyr we have dts in which multiple peripherals can be at the same
MMIO address. So we want to disable the `unique_unit_address` check via
(-Wno-unique_unit_address). However, newer dtc support a check that
makes sure if we have duplicate unit-address devices that only one is
enabled. So if the dtc flag is supported we enable
(-Wunique_unit_address_if_enabled).
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add a function that let's us check if a given dtc flag can be used with
the version of dtc we have. This lets us utilize specific warning flags
that might not exist in older dtc versions and still have things work
properly.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Supported PWM at pins A0, D3, D5 and D6 which are also Arduino
compatible. Also the onboard red LED can be used with PWM.
The basic/{fade_led, blink_led} samples to apply to this board
seemlessly and operate on the onboard red LED.
Also supported RTC.
Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
This commit adds the simplest configuration for this Nucleo-144 board
stripped down to the parts that are currently tested.
Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
fcb instance might use less areas than CONFIG_SETTINGS_FCB_NUM_AREAS.
During compression of completely filled up fcb it was possible to try
compress areas more than once.
What this patch fixes is not a bug - rather fix for inefficient service
of the corner case.
fixes#12657
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
We get warnings like:
foo.yaml('BAH') merge of property 'category': 'required'
overwrites 'optional'
This warning isn't meaningful as its reasonable to change the 'category'
of a property from 'optional' to 'required'. So don't warn in the case
anymore.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Extend generic mbedTLS configuration file with MBEDTLS_HAVE_ASM option,
to allow the use of assembly code. This improves the performances of
asymetric cryptography, however depending on the architecture and the
CPU, this might have an impact on the code size.
Set the default value ot the previous non-configurable value, ie enable
it by default except on ARM.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
In case of TX IRQ pending,
uart_stm32_irq_is_pending() function always return 0,
because "is TXE enabled ?" is checked instead of "is TC enabled ?".
Signed-off-by: Benoit Leforestier <benoit.leforestier@gmail.com>
This commit provides sample application for sensor lsm6dsl.
This sample has been tested on both 96b_argonkey board,
where lsm6dsl is connect to the micro thru SPI bus, and on
disco_l475_iot1 board, where instead it is connected to I2C bus.
Signed-off-by: Armando Visconti <armando.visconti@st.com>
Provide through the dts the gpio on which the lsm6dsl INT1 is
connected. Enable also the lsm6dsl trigger mode.
Signed-off-by: Armando Visconti <armando.visconti@st.com>