Refactors the apds9960 sensor driver to get the i2c device name, i2c
device address, gpio device name, and gpio pin from a constant device
configuration structure, rather than using hardcoded macros. This will
make it easier to change the names of the macros and to instantiate
multiple instances of the driver.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Fixes the apds9960 i2c address on the reel_board. Found while converting
the apds9960 driver to use the i2c address from device tree rather than
a hardcoded value in apds9960.h.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Initialize a local struct variable to zero, to suppress
un-initialized variable error.
Fixes#14422.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Following upgrade of newlib version in SDK 0.10.0,
time_t changed from 4 to 8 bytes structure.
As a consequence, ts requires a cast to u32_t before conversion
to us to avoid overflow.
Additionally, add a comment on RTC init value and
fix a minor alignment issue.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The current flash configurations for all nRF52840's in Zephyr is
VERY constrained when it comes to allowing samples any space for
storage or custom areas. It only leaves the last 4 pages of flash
for "storage".
The nRF52840 is also capable of using OpenThread which defaults
to using the last 4 pages of flash for storing OpenThread-related
network data.
This means that while using OpenThread under any configuration
designed to use mcuboot partition slots, there is no space left
over for storage of any kind.
Let's adjust the partition table to set storage at 8 pages of
flash (32k). This fixes the conflict with OpenThread and leaves
room for future use cases that may arise.
Signed-off-by: Michael Scott <mike@foundries.io>
The clang ARM assembler is a bit stricter than GNU as. Change mov to
movs for ARMv6 case of z_arch_switch_to_main_thread.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
It was possible to freeze the application by pressing the user button
too frequently. This was likely due to the stack not keeping up with
the send requests and running out of buffers.
Add rate-limiting to the app, so that at most one message per 500ms
can be sent. Also add a user message if the user presses the button
too many times in rapid succession, and inform the other badges of
this misbehaving user.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Updated to add support for CS. DT config names updated
to adhere to the DTS naming convention. Init and SPI
configuration now follows the device datasheet.
Signed-off-by: Henrik Malvik Halvorsen <henrik.halvorsen@nordicsemi.no>
Appears within an 'if UART_MCUMGR'.
'if FOO' is just shorthand for adding 'depends on FOO' to each item
within the 'if'.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This moves BTP specification from Zephyr so that it's accessible for
all projects.
Related auto-pts PR: https://github.com/intel/auto-pts/pull/244
Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
The old defines make the Shippable tests fail. Convert the fixing
ups for fxos8700 to use new defines introduced in #12491.
Signed-off-by: Song Qiang <songqiang1304521@gmail.com>
It is also possible to use 'west' to build the 'hello_world' sample
application for the UP2 (up_squared) board. This patch makes it
explicit in the documentation.
Signed-off-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Zephyr modules' Kconfig entries appear in a seemingly random spot
in menuconfig. This patch moves those entries at the top of the menu,
to improve their visibility and make their location predictable.
Signed-off-by: Emanuele Di Santo <emdi@nordicsemi.no>
To save binary size, currently just returns textual name of error
code, e.g. EAI_FAIL -> "EAI_FAIL". Based on real usecases, can be
replaced with user-friendly message later. (Current usecase is to
allow/help to elaborate sockets API by proof-of-concept porting
existing socket apps).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
USB is already being configured in pinmux.c, but for it to be
availiable it also needs to be enabled in the device tree.
Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Per #13610, recent changes to this driver seem to have introduced
unexpected latency regressions. This patch effectively reverts these
patches which changed the meat of the driver:
ac36886e62 drivers: nrf: timer: add inline qualifier where
inlining is intended
084363a0dc drivers: timer: nrf: refactor for speed and correctness
71882ff8c4 drivers: timer: nrf: drop unnecessary counter mask
4b24e88fa4 drivers: timer: nrf: use irq_lock instead of spinlock
While backporting these seemingly unrelated hygiene patches:
7cbdb6c5c0 drivers/timer: Restore non-tickless tick count behavior
d30c9aeafd drivers: nrf_power_clock: Migrate to DTS.
75f77db432 include: misc: util.h: Rename min/max to MIN/MAX
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
We previously created an improved version of searchtools.js (used by the
Sphinx search) to remove the reST tags shown in the search results.
This has now been fixed in the upstream version of searchtools.js along
with other speed and visual improvements, so we should remove our local
copy.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
The latest release of the Windows toolchain has a critical bug,
Windows users should install the next-to-latest release instead.
To prevent Windows users from being affected we add a note about this
in the documentation.
Bug: https://github.com/zephyrproject-rtos/zephyr/issues/12257
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Normally, this bug wasn't apparent as the value is type-casted
to a float32/64 type. However, once we start persisting these
values they need the correct length.
Signed-off-by: Michael Scott <mike@foundries.io>
Let's avoid future compile issues with this macro when passing
in a type-casted value that isn't surrounded by parenthesis.
Signed-off-by: Michael Scott <mike@foundries.io>
Occasionally we see a stack crash in LwM2M. This may have been
due to the swap from net_app APIs to socket-based APIs.
Let's raise the default stack by 1k.
Signed-off-by: Michael Scott <mike@foundries.io>
When a context is closed to a server, we should clean up any
existing observes along with it. Otherwise these will try to fire
afterward.
Signed-off-by: Michael Scott <mike@foundries.io>
We are already in sm_do_registration(), there's no need to check
!sm_is_registered(). Either we are performing a full registration
or a registration update. In both cases, sm_send_registration()
is called.
Signed-off-by: Michael Scott <mike@foundries.io>
If an error is received during registration update, we need to reset
the status so that a full registration is performed. This was
incorrectly being set to ENGINE_REGISTRATION_SENT.
The correct status should be: ENGINE_DO_REGISTRATION
Signed-off-by: Michael Scott <mike@foundries.io>
send() returns -1 upon error and sets errno appropriately. Let's
not bother saving the return code and instead share errno back
to the user.
Signed-off-by: Michael Scott <mike@foundries.io>
This didn't compile if CONFIG_SHALL_ECHO_STATUS wasn't
enabled.
Based on a fix by Rodrigo Peixoto.
Fixes: #14546
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
Remove magic numbers from Ethernet drivers and tests by defining
NET_ETH_MAX_DATAGRAM_SIZE and NET_ETH_MAX_FRAME_SIZE.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
On STM32L4, flash writes operations are performed 8 bytes at a time.
Though, it is possible that *data in flash_write functions is not
aligned. To avoid issues, use UNALIGNED_GET macro to access *data.
Issue has been detected using settings subsystem on STM32WB, which has
same 8bytes write block size. The patch is extended to STM32L4 series
for same reason.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
On STM32F3 devices, a trick was required for normal use of registers.
This was actually an issue in flash registers defintions which should
be defined as volatile.
Fix this and additionaly, fix definition for STM32F1 which was also
lacking the volatile instruction.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This is a vestiage of how board ports use to work, we have since removed
the need for board.h to exist on all board ports. Remove the file since
its not needed and doesn't do anything useful.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
To ensure the proper flags are specified to the toolchain, we need to
keep system headers and non-system headers seperate and set the SYSTEM
flag to target_include_directories for system headers.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
when building with clang we get the following warning:
log_core.c:358:40: error: use of logical '&&' with constant operand
[-Werror,-Wconstant-logical-operand]
This is because we are mix a constant IS_ENABLED(CONFIG_LOG_IMMEDIATE)
with non-constants.
Split out the check into its own statement to workaround the warning.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
(OPTIONAL) was a vestiage from the initial import of the Zephyr code
base and we dont utilize it with the GNU linker. Additionally, the way
(OPTIONAL) gets defined to nothing creates a linker script that lld
(from llvm) doesn't like.
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
The iMX RT1060 and RT1064 have additional dedicated 512KB on-chip ram.
This OCRAM2 is mapped at 0x20200000, formerly OCRAM1 (flexram) mapping
which is moved to 0x20280000 in order to guarentee global OCRAM memory
continuity regardless OCRAM1 size configuration (256KB by default).
In default configuration, this gives 768KB (512+256) on-chip ram:
0x20200000 to 0x202BFFFF.
OCRAM2: 0x20200000 - 0x2027FFFF
OCRAM1(FlexRam): 0x2028FFFF - 0x202BFFFF
Add this memory region as a single node in the rt1060 device tree.
Note: MPU expects power of two memory region, in case of 768KB, let
the MPU configure 1MB instead.
Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
On stm32f4 series, uart4 is not an usart, so generated with
'st,stm32-usart' compatible and hence generated defined should be
prefixed with DT_ST_STM32_UART_ rather than DT_ST_STM32_USART.
Fixes#14542
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
uart4 is not available on whole stm32f4 series (not on stm32f401
for instance), remove from stm32f4.dtsi
It is actually correctly defined in f405, f413 but missing in f446,
so add it in there.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
Fix implementation to correctly return the configured
default Tx Power Level.
Also, fix the missing use of RADIO_TXP_DEFAULT in the new
ULL/LLL implementation of Advertiser and Observer states.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add implementation in controller to use range delay
alongwith the active clock accuracy jitter.
Range has been hard coded to 1000 meters, suffices
modules out in the market.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Due to regression the option to enable PHY Update Procedure
on proprietary 2M PHY for nRF51 series was disable.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Workaround from asserting when Rx PDU buffers from pool
needing resize is acquired by another connection. By
skipping the connection events to give some headroom for
the host to process the Rx packets and eventually make the
pool available for resize.
Fixes#11841.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>