CMake's custom_command support is not great. It is technically
supported, but it is not easy to get it right.
As explained in "5. File-level dependencies of custom targets are not
propagated" from http://bit.ly/2GvwwEy. When a custom_command uses a
custom_target as input, the custom_command must DEPEND on both the
custom_target and the underlying file.
Longterm we need to do something more sofisticated to prevent these
issues from popping up. Like add some static analysis to detect badly
written CMake code or introduce an abstraction for custom commands
that is not affect by this issue.
This fixes#5881
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
During the CoAP API change, slight changes were made the ref / unref
packet pending process. Let's re-align with the coap-client sample
in how we apply the packet refs in retransmit_request() and also
replace the lwm2m_send_message() call with a direct call of
net_app_send_pkt(). This avoids a second processing of the pending
packets and keeps the ref/unref flow cleaner.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
During the CoAP API change, the way packets were ref'd and then
unref'd in order to stop the packet sending functions from releasing
the net_pkts was changed and never updated in the LwM2M library.
Let's use coap_pending_cycle() and coap_pending_clear() to do the
ref/unref the same way as the coap-client samples in order to
match the pending process with the current CoAP APIs.
Signed-off-by: Michael Scott <michael@opensourcefoundries.com>
Fix controller implementation to only restrict HCI LE Set
Random Address command when advertising and/or active
scanning is enable.
Continues to pass the following LL.TS.5.0.2 conformance
test:
LL/SEC/SCN/BV-01-C [Random Address Scanning]
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
We should enable CONFIG_POLL on application level when
we want to use SPI transceive_async() function.
This patch removes it from disco_l475_iot1 default
configuration.
Signed-off-by: Yannis Damigos <giannis.damigos@gmail.com>
The existing docs immediately dive into the details without providing
the user with any kind of high level overview or description of the
threat model.
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
When adding support for the 'flash' command to the jlink runner, it was
not clear if the jlink commander would erase flash before programming,
therefore an explicit mass erase was implemented in the jlink runner as
a precaution and enabled by default.
The Segger folks later confirmed that the jlink commander does an
implicit erase of relevant flash sectors with the loadbin command,
therefore the explicit mass erase is not required.
Keep the mass erase option available in the jlink runner, but change the
default to false.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
When building the testcase path, replace symlinks in path
with the realpath both in the testcase root and in ZEPHYR_BASE
For more info see issue #5772Fixes: #5772
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
Kbuild supported CONFIG_MBEDTLS_LIBRARY and
CONFIG_MBEDTLS_INSTALL_PATH to allow users to link in an externally
built mbedtls. This was not ported over to CMake, causing build
failures when it was kconfig-enabled.
This patch implements this support. This support has been tested
as well as MBEDTLS_LIBRARY was tested in CI.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Ding Tao <miyatsu@qq.com>
CONFIG_MBEDTLS means you are using MBEDTLS
CONFIG_MBEDTLS_BUILTIN means you are using a built-in MDEDTLS
CONFIG_MBEDTLS_LIBRARY means you are using an external MBEDTLS
This patch ensures that you must select one or the other
implementation when MBEDTLS is enabled.
Tested by opening xconfig and observing that when MBEDTLS was enabled,
BUILTIN was automatically enabled, and a radio-button interface
existed to change the implementation.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Signed-off-by: Ding Tao <miyatsu@qq.com>
Current buffers might be configured to skip data, thus only len will be
set, buf will be NULL. Buffer should be used if only len is > 0 and
buffer is valid as well.
tx/rx are "on" if len is > 0
tx/rx buf should be touched if only len is > 0 _and_ buf != NULL.
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fraction could be stored with negative value.
The implementation was only considering the positive value case.
Therefore, we have to modify the code to take care of the case.
To test it
======================================================================
1. launch eclipse/wakaama lwm2m server
2. launch zephyr lwm2m client and wait for registration completed
3. Issue commands from server
* attr 0 /1/0/1 -0.1 0.1
* disc 0 /1/0
Current output
----------------------------------------------------------------------
Client #0 /1/0 : 2.05 (COAP_205_CONTENT)
105 bytes received of type application/link-format:
</1/0>,</1/0/0>,</1/0/1>;gt=0.1;lt=0/00000,</1/0/2>,</1/0/3>,</1/0/4>,
</1/0/5>,</1/0/6>,</1/0/7>,</1/0/8>
Expected output
----------------------------------------------------------------------
Client #0 /1/0 : 2.05 (COAP_205_CONTENT)
102 bytes received of type application/link-format:
</1/0>,</1/0/0>,</1/0/1>;gt=0.1;lt=-0.1,</1/0/2>,</1/0/3>,</1/0/4>,
</1/0/5>,</1/0/6>,</1/0/7>,</1/0/8>
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
rename main_clean_up() to posix_exit() for consistency
with all other global functions of this architecture
Signed-off-by: Alberto Escolar Piedras <alpi@oticon.com>
This change proposes to handle the case where the handle_timeouts
function is called after a number of ticks greater than the first
timeout delta of the _timeout_q list. In the current implementation if
the case occurs, after subtracting the number of ticks the
delta_ticks_from_prev field becomes negative and the first timeout is
never processed. It is therefore necessary to treat this case and to
prevent delta_ticks_from_prev from becoming negative. Moreover, the lag
produced by the initial delay must also be applied to following timeouts
by browsing the list until it was entirely consumed.
Fixes#5401
Signed-off-by: Holman Greenhand <greenhandholman@gmail.com>
The jlink commander failed to program flash with auto speed on the
usb_kw24d512 board, so set the speed explicitly on this board.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Now that the jlink runner supports the flash command, set
BOARD_FLASH_RUNNER when the OpenSDA or LPCLink debug adapter is
programmed with jlink firmware.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Adds support for the 'flash' command to the jlink runner so we can flash
via 'make flash'. This works by generating a temporary jlink commander
script file and passing the script to the jlink commander executable.
Previously, the only way to flash with jlink was via 'make debug'.
Includes support for DT based flash address, and an optional mass erase
before loading the flash.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Currently in zephyr the support for the arm userspace has not be
merged. But the Kconfig always sets the userspace flag and causes a
build failure. This is blocking the test cases for userspace.
Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
Previously, POSIX function names were aliased to zsock_ function
names using, for example:
#define connect zsock_connect
This caused the C preprocessor to replace any symbol named 'connect',
whether a function or not, in all source code which included socket.h,
with 'zsock_connect'. This generated unintended code where the symbol
'connect' was used as the name of a structure field (as in mqtt.h).
This new inline definition is applied to all the POSIX function symbols,
with the exception of fcntl, a redefinition of which would conflict
with the definiton in the toolchain's fcntl.h.
Fixes#5817
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
Add samples config for nRF52840 with OpenThread
for echo_client and echo_server.
Add OpenThread to CI for echo_client and echo_server on nRF52840
Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
Add OpenThread to Zephyrs net stack as data link layer.
OpenThread requires to call process function when an event occurs.
This process function is called from cooperative thread.
Packet conversion and dispaching is implemented in openthread.c
as well as addresses forwarding.
Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
OpenThread requires platform definition with standarized API
so we have to add wrappers to make it compatible with Zephyr.
OpenThread is based on autoconf, this requires
more specific CMakeLists.txt which allows to clone specific
commit or point to local copy of openthread.
Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
Use CONFIG_IEEE802154 instead of CONFIG_NET_L2_IEEE802154
and CONFIG_IEEE802154_RAW_MODE when adding RSSI and LQI
members to net_pkt. CONFIG_IEEE802154 is selected when
at least one 15.4 device is selected (L2 or RAW).
Signed-off-by: Kamil Sroka <kamil.sroka@nordicsemi.no>
Move to new Kconfig pattern in which we use an if !HAS_DTS_I2C_DEVICE
block for the Kconfig symbols that can now come from DT generation.
This pattern is useful to allow us to define default values for the
generated symbols for build-all testing.
Fixes: #5877
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Add a new Kconfig option, BOOTLOADER_MCUBOOT, that automatically sets
the required options necessary to make the resulting image bootable by
the MCUboot open source bootloader. This includes the text section
offset and the vector relay table for Cortex-M0, and in the future it
might also add the DTS overlay required to link at slot0 offset in
flash.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Add device tree support for the "nxp,kinetis-ftfa" flash controller used
on the NXP KL2X and KW4xZ SoCs.
Fixes: #5788
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
Convert NXP k6x and kw2xd flash driver to use device tree to get the
flash controller name from device tree. We introduce yaml bindings for
the "nxp,kinetis-ftfe" and "nxp,kinetis-ftfl" devices.
Fixes: #5788
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
On the various NXP Kinetis SoCs add the write-block-size property and
set it to match FSL_FEATURE_FLASH_PFLASH_BLOCK_WRITE_UNIT_SIZE for the
given SoC.
Fixes: #5788
Signed-off-by: Kumar Gala <kumar.gala@linaro.org>