Commit Graph

47747 Commits

Author SHA1 Message Date
Daniel Leung ff720cd9b3 x86: enable soft float support for Zephyr SDK
This adds the correct compiler and linker flags to
support software floating point operations. The flags
need to be added to TOOLCHAIN_*_FLAGS for GCC to find
the correct library (when calling GCC with
--print-libgcc-file-name).

Note that software floating point needs to be turned
on for Newlib. This is due to Newlib having floating
point numbers in its various printf() functions which
results in floating point instructions being emitted
from toolchain. These instructions are placed very
early in the functions which results in them being
executed even though the format string contains
no floating point conversions. Without using CONFIG_FPU
to enable hardware floating point support, any calls to
printf() like functions will result in exceptions
complaining FPU is not available. Although forcing
CONFIG_FPU=y with newlib is an option, and because
the OS doesn't know which threads would call these
printf() functions, Zephyr has to assume all threads
are using FPU and thus incurring performance penalty as
every context switching now needs to save FPU registers.
A compromise here is to use soft float instead. Newlib
with soft float enabled does not have floating point
instructions and yet can still support its printf()
like functions.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-01-20 16:45:31 -05:00
Anas Nashif d0dd2ac5d3 samples: cmsis_rtos_v2: increase stack
Need more stack for some platforms and architectures.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-20 16:45:31 -05:00
Anas Nashif 8b3d9e7285 sparc: do not set cmsis api Kconfigs
Those should be set by applications, not architectures.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-20 16:45:31 -05:00
Anas Nashif 13fdb9e73d doc: update docs with 0.12.1 SDK
Update documentation with new SDK version.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-20 16:45:31 -05:00
Anas Nashif be00feb6eb ci: switch to 0.12.1 SDK
Move to new SDK.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-20 16:45:31 -05:00
Peter Bigot 08f4ce4efb samples: boards: nrf: add clock_skew
Provide a demonstration of using the timeutil skew infrastructure to
measure the relative error of the two clock sources on Nordic boards.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-20 16:38:56 -05:00
Peter Bigot 7b3dc4856a doc: add a section for timeutil APIs
Describe the role of these APIs, key concepts that they depend on, and
expose the low-level API.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-20 16:38:56 -05:00
Peter A. Bigot f6d7595d4e lib/timeutil: add utilities to manage local/reference clock alignment
Provide data structures to capture a timestamp in two different
clocks, monitor the drift between those clocks, and using a base
instant with estimated drift convert between the clocks.

This provides the core technology to convert between system uptime and
an external continuous time scale like TAI (UTC without applying leap
seconds).

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2021-01-20 16:38:56 -05:00
Spoorthy Priya Yerabolu 513b9f598f zefi.py: Use cross compiler while building zephyr
Currently, zefi.py takes host GCC OBJCOPY as
default. Fixing the script to use CMAKE_C_COMPILER
and CMAKE_OBJCOPY.

Fixes: #27047

Signed-off-by: Spoorthy Priya Yerabolu <spoorthy.priya.yerabolu@intel.com>
2021-01-20 16:38:12 -05:00
Klaus H. Sorensen 8216e320b6 canbus: canopen: program: read flash in 32 byte chunks
Add routine to calculate crc of flash region. Read 32 bytes at a time
from flash instead of 4 bytes, for a significant speed up of the flash
image crc calculation.

Signed-off-by: Klaus H. Sorensen <khso@vestas.com>
2021-01-20 14:18:03 -06:00
Klaus H. Sorensen cb24e3c22e canbus: canopen: program: unlock can od during flash access
The callback function canopen_odf_1f56 is called with the can od lock
held. Release the lock while performing time consuming flash reading and
crc calculations, and reacquire the lock before returning from the
function.

Signed-off-by: Klaus H. Sorensen <khso@vestas.com>
2021-01-20 14:18:03 -06:00
Rajavardhan Gundi 945dc6ea72 drivers: i2c_mchp_xec: Set Default Configuration
The default configuration is made to be "master" at
"standard speed". This makes it possible to use the
driver without having to configure it.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2021-01-20 14:16:27 -05:00
Rajavardhan Gundi ff4e84ba45 tests: i2c_slave_api: Add test for mec1501modular_assy6885 board
This commit adds a DTS overlay file for mec1501modular_assy6885.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2021-01-20 14:16:27 -05:00
Rajavardhan Gundi 8751816745 drivers: i2c_mchp_xec: Enable slave mode support
Enable slave support for I2C device instances. Slave mode is
interrupt based, wheras master mode is still based on polling.

Remove ENI bit in master configuration since it is not needed for
master mode.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2021-01-20 14:16:27 -05:00
Francisco Munoz 7c3504b1c9 dts: bindings: microchip,xec-i2c: Add GIRQ fields
Add the girq and girq-bit fields to the binding. This allows
encoding GIRQ related information inside device tree.

Signed-off-by: Francisco Munoz <francisco.munoz.ruiz@intel.com>
Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
2021-01-20 14:16:27 -05:00
Nicolas Pitre f436315e02 lib/os/heap: guard against arithmetic overflows
Let's do it upfront only once for each entry point and dispense
with overflow checks later to keep the code simple.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2021-01-20 14:15:44 -05:00
Anas Nashif c92ad609b3 MAINTAINERS: update guidelines
Update guidelines regarding updates to maintainers in the MAINTAINER
file.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-20 12:21:42 -05:00
Anas Nashif ccb236f177 MAINTAINERS: replace CODEOWNERS
The Maintairs file will be used to replace the code owners file and will
be used to add reviewers (collaborators + maintainers of affected
areas).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-20 12:21:42 -05:00
Anas Nashif 3de9adb0bb MAINTAINERS: MAINTAINERS.yml updates
The changes here are the result of running all open pull-requests
through a script to identify the assignee and findi ng many gaps or old
data. Some of the changes here are coming from pending PRs that were
waiting for some TSC confirm ation, others are done based on pending
maintainer and collaborator changes that were not submitting yet.

Two noteable changes:

- CMake/Build system: This is now limited to just the infrastructure and
not every single Cmake file in the tree.  - Documentation: ditto, this
is just for the doc infrastructure and not for every RST file in the
tree.

The reason for the above two changes is the fact that most PRs would
have some cmake or doc changes and assignees in this case should not be
the owners of the build system or the doc infra, instead we should
assign to the subsystem being changed. (Otherwise majority of PRs would
be assigned to the doc and build system maintainers).

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-01-20 12:21:42 -05:00
JuHyun Kim a8722a9e65 samples: sensor: sample app of ICM42605 motion sensor
Sample appication of TDK Invensense ICM42605
motion sensor.

Signed-off-by: JuHyun Kim <jkim@invensense.com>
2021-01-20 10:41:04 -06:00
JuHyun Kim cc56fb5247 drivers: sensor: Initial driver of Invensense ICM42605
Initial driver and sample application of
TDK Invensense ICM42605 6-axis motion sensor.
This driver provide DTS for nRF52 DK board DTS setting.

Providing features are below.

Sensor data streaming - Accel, gyro
Tap, Double tap triggering.
Set/Get FSR, ODR by set attr API
Support multi instance feature.

Signed-off-by: JuHyun Kim <jkim@invensense.com>
2021-01-20 10:41:04 -06:00
Kumar Gala 1badf77961 arch: arm: aarch32: Fix syscall inline asm
The inline asm code was not conveying in all cases that registers r1-r3
would get clobbered by the SVC handler code.  In the cases that we can't
list r1-r3 in the clobber list the registers need to show up as outputs
to know that they values are not preserved by the callee.

Fixes #30393

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-01-20 17:02:14 +01:00
Kumar Gala d382868216 i2s: cavs: Fix build issues with driver
Move i2s_cavs_irq_connect_##n up so its available later when used.  This
fixes compile issues with the driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-01-20 09:13:29 -06:00
peng1 chen 35133c8452 spi/qspi: add a testcase to test spi api for microchip board.
test write and read data with flash device using
spi single, dual, quad and octal mode.

Signed-off-by: peng1 chen <peng1.chen@intel.com>
2021-01-20 09:29:48 -05:00
Torsten Rasmussen da3726006b cmake: newlib linking flags -lc and -lgcc circular dependency
Fixes: #28650

Linking with newlib now defines the following linker flags as:
```
${CMAKE_C_LINKER_WRAPPER_FLAG}${CMAKE_LINK_LIBRARY_FLAG}c
${CMAKE_C_LINKER_WRAPPER_FLAG}${CMAKE_LINK_LIBRARY_FLAG}gcc
c
```

This is needed because when linking with newlib on aarch64, then libgcc
has a link dependency to libc (strchr), but libc also has dependencies
to libgcc.

CMake is capable of handling circular link dependencies for CMake
defined static libraries, which can be further controlled using
`LINK_INTERFACE_MULTIPLICITY`.

However, libc and libgcc are not regular CMake libraries, and is seen as
linker flags by CMake, and thus symbol de-duplications will be
performed.

CMake link options cannot be used, as that will place those libs first
on the linker invocation. -Wl,--start-group is problematic as the
placement of -lc and -lgcc is not guaranteed in case later libraries are
also using -lc / -libbgcc as interface linker flags.

Thus, we resort to use
`${CMAKE_C_LINKER_WRAPPER_FLAG}${CMAKE_LINK_LIBRARY_FLAG}`
as this ensures the uniqueness and thus avoids symbol de-duplication
which means libc will be followed by libgcc, which is finally followed
by libc again.

It would have been possible to use `-lc` directly, but there is a risk
that an externally library is also adding `-lc` and thus de-duplication
and re-arrangement of this flag happens. This risk is in theory also
existing with this fix, but the long nature of this link flag with using
`${CMAKE_C_LINKER_WRAPPER_FLAG}` would likely indicate a similar fix and
thus those libraries will stay in order.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-01-20 09:25:38 -05:00
Artur Lipowski ca61606632 api: add C++ friendly version of Z_TIMEOUT_TICKS.
The designated initializer used in Z_TIMEOUT_TICKS causes problems for
some C++ parsers (at least in Eclipse).
Let's use standard C++ list initialization (C++11 and up) instead.
Designated initializatin is going to C++20,
so it is not neccessary to apply C++ specific code
for that version and up.

Signed-off-by: Artur Lipowski <Artur.Lipowski@hidglobal.com>
2021-01-20 09:23:20 -05:00
Peter Bigot 6ae2374eea samples: drivers: gpio: remove stray board file
Remove UP Squared support for the gpio sample that was merged after
the sample itself was removed.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
2021-01-20 09:15:53 -05:00
Gustavo Romero ba0c205b56 boards: arm: stm32: Adjust maximum speed for STM32F746G disco board
Currently configuration for STM32F746G Discovery board on reset-start
event is inherited from included files (OpenOCD stm32f7x.cfg), but
contrary to the inherited adapter speed on reset-init event, the speed
inherited for the reset-start event is only 2000 kHz, which is not
available, so a lower speed is picked up automatically generating the
following message several times when flashing the board:

Info : Unable to match requested speed 2000 kHz, using 1800 kHz

That commit overrides that suboptimal speed for reset-start event and
sets it to the same speed as used by reset-init event, i.e. the maximum
speed (4000 kHz), so the noisy messages like the above one disappear.

The change also improves a bit the throughput when writing to the board.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
2021-01-20 08:08:11 -06:00
Henrik Brix Andersen 3860551196 tests: drivers: pwm: loopback: add support for twr_ke18f board
Add support for testing the NXP Kinetis Pulse Width Timer (PWT) on the
NXP TWR-KE18F development board using PWM loopback.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-20 08:05:57 -06:00
Henrik Brix Andersen ab5b13b603 boards: arm: twr_ke18f: add pinmux configuration for PWT testing
Add pinmux configuration for testing the NXP Kinetis Pulse Width Timer
(PWT) in loopback mode.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-20 08:05:57 -06:00
Henrik Brix Andersen 6b285de7aa dts: arm: nxp: ke1xf: add PWT devicetree node
Add devicetree node for the NXP Kinetis Pulse Width Timer (PWT) to the
NXP Kinetis KE1xF Soc.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-20 08:05:57 -06:00
Henrik Brix Andersen 8167134f05 drivers: pwm: add driver for the NXP Kinetis Pulse Width Timer (PWT)
Add PWM capture driver for the NXP Kinetis Pulse Width Timer (PWT).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-20 08:05:57 -06:00
Henrik Brix Andersen a0c9448658 manifest: update hal_nxp to support the Pulse Width Timer
Update the NXP HAL module revision to support for the NXP Pulse Width
Timer (PWT).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-20 08:05:57 -06:00
Henrik Brix Andersen c9e02cd394 modules: mcux: add support for indicating the presence of PWT
Add Kconfig option for indicating that a given SoC contains the NXP
Kinetis Pulse Width Timer (PWT).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-20 08:05:57 -06:00
Henrik Brix Andersen aecb38bc3d dts: bindings: pwm: add binding for the NXP Kinetis Pulse Width Timer
Add devicetree binding for the NXP Kinetis Pulse Width Timer (PWT).

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2021-01-20 08:05:57 -06:00
Piotr Pryga ff1d8efd38 Bluetooth: controller: Fix error when max ant. pattern len not defined
Fix compilation error if CONFIG_BT_CTLR_DF is not defined.
If DF was not enabled, there was missing CONFIG_BT_CTLR_DF_MAX_-
ANT_SW_PATTERN_LEN and undeclared symbol was found.

Split ll_df.h into two parts:
- ll_df.h that is generally includeable and allows to successfully
  compile sources when DF is not enabled.
- ll_df_internal.h to be used in soucres that are compiled when
  DF is enabled.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-20 14:55:24 +01:00
Piotr Pryga 0b230ae639 Bluetooth: controller: Add DF initialization to controller init sequence
Direction Finding requires initalization of a set of registers
in Radio peripheral. Also it requires information about antenna
matrix unit that are provided by end user in DTS overlay.
Implemented initialization step is responsible for validation of
hardware information delivered by DTS and setting up DF related
registers in Radio.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-20 14:55:24 +01:00
Piotr Pryga f3e04898eb Bluetooth: controller: ll_sw: nordic: Add DF antenna configuration handling
Add support for Direction Finding antenna configuration in
Nordic hal of Bluetooth controller.
Add handling of response for HCI_LE_Read_Antenna_Information
HCI command in controller (upper and lower link layer).
Handling of response to the command requires antenna matrix
configuration.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-20 14:55:24 +01:00
Piotr Pryga 41c4af1ba3 dts: arm: nordic: Add radio peripheral with DFE antenna config
Add radio peripheral to nrf52833 DTS including antenna matrix
congiuration for Direction Finding extennsion.
Add appropriate binding file for nRF radio peripheral.

There is no default antenna matrix configuration. Antennas number
and GPIOS mapping to DFEGPIOS is project specific.
Complete configuration must be provided by end user as overaly.

Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
2021-01-20 14:55:24 +01:00
Andrzej Puzdrowski 2931caac7c doc/release-note: mcuboot bootutil_public library record
Added note on MCUBoot's bootutil_public library
introduction.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-01-20 14:49:44 +01:00
Andrzej Puzdrowski 07dd076e34 manifest: update MCUboot up to ce50334
MCUboot Synchronized up to:
https://github.com/mcu-tools/mcuboot/commit/ce50334

- MCUboot ci: relax signed-off-by checks on forks

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2021-01-20 14:49:44 +01:00
Torsten Rasmussen 3d88083bf1 cmake: zephyr modules: sanitize all module name when used as variable
The introduction of Zephyr module glue code in the Zephyr repository
introduces a Kconfig variable in the form of:
`config ZEPHYR_<MODULE_NAME>_MODULE`.

All Kconfig variables go into `autoconf.h`, therefore it is necessary
to sanitize the Kconfig variable, so that it does not contain special
characters. To ensure consistent variable name, then the module name
will be sanitized in all variable use in both Kconfig and CMake.
The sanitization is done be replacing all special characters with an
underscore, `_`.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-01-20 12:59:19 +01:00
Pawel Sagan 0ce0f63036 drivers: ethernet: Verify returned value from net_if_set_link_addr
This commit verifies if the mac configuration is done correctly
during liteeth setup, and prompts a warning when not.

Signed-off-by: Pawel Sagan <psagan@antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2021-01-20 13:54:32 +02:00
Pawel Sagan 4324356a6e drivers: ethernet: Add timeout when waiting for LITEETH_TX_READY
This commit eliminates an inifite waiting for the TX ready flag
in the eth liteeth driver, exiting with error after a defined
number of attempts.

Signed-off-by: Pawel Sagan <psagan@antmicro.com>
Signed-off-by: Mateusz Holenko <mholenko@antmicro.com>
2021-01-20 13:54:32 +02:00
Vitaliy Gribko 75847b7a5e samples/net/mqtt_publisher: undefined reference to z_impl_sys_rand32_get
Add missing random options to prj.conf file.

Fixes #31414

Signed-off-by: Vitaliy Gribko <vitaliy69@gmail.com>
2021-01-20 13:20:54 +02:00
Torsten Rasmussen 1bd0b29918 cmake: scripts: supporting gen_relocate_app feature in windows
Fixes: #28847

This commit fixes two places that was causing gen_relocate_app to fail
in windows.

gen_relocate_app.py now splits only on first `:` in
`<MEM_REGION>:<file>`.

Windows contains `:` in path, thus only first `:` is valid for splitting
mem region and file path.

Second part of the issue is fixed in CMake where `'` was used for
quoting of command arguments.
This causes a file not found on Windows because the final `'` would be
treated as part of the filename. Similar the first `'` would be treated
as path of the mem region name.

This is fixed by using `"` for quoting, which works correctly on all
platforms.

gen_relocate_app.py:403: UserWarning: File: .../kernel/sem.c' Not found
Note the stray `'`                                         ^^^

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-01-20 11:51:47 +01:00
Torsten Rasmussen 3361b154ff scripts: check_compliance.py: include known Zephyr Kconfig glue code
Fixes: #31436

This fix adds ZEPHYR_<MODULE_NAME>_KCONFIG variable to compliance check.
This ensures that Zephyr Kconfig glue code is included in the
compliance check, and thus remove the issue reported in #31436.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-01-20 11:21:16 +01:00
Pablo Garrido c5955f3c83 net: include: Add missing brace to socket_select.h
Starting brace was missing in the socket_select.h file so adding
it back

#ifdef __cplusplus	
extern "C" {	
#endif

Fixes #31444

Signed-off-by: Pablo Garrido <pablogs9@gmail.com>
2021-01-20 12:01:27 +02:00
Lukasz Majewski 9e5ae8f0a3 dsa: config: sample: Add SHELL support via RTT to DSA sample's prj.conf
Due to the routing, the ip_k66f board can only use RTT to export
console. With this change the SHELL is enabled to get access
to network commands (like ping).

To use it with RTT from Segger:
-------------------------------

On HOST (terminal 1):
./JLink_V664/JLinkRTTLogger -Device MK66FN2M0XXX18 -RTTChannel 1 \
-if SWD -Speed 4000 ~/rtt.log

On HOST (terminal 2):
nc localhost 19021

(19021 is the port number for the Segger RTT server)

Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-01-20 10:03:42 +02:00
Lukasz Majewski 814f5fa717 dts: overlay: Provide local-mac-address nodes as dts overlay
The 'local-mac-address' nodes are helpful for assessing if the LLDP like
example of DSA switch works correctly.

As those are used only for testing (or when user explicitly needs them),
those are added as DTS overlay to DSA example.

The 'local-mac-address' properties will be visible when one assess the
LLDP response from ip_k66f board (each LAN port has different IP
assigned).

Example output from 'tcpdump -v -i eth0':
-----------------------------------------
       Chassis ID TLV (1), length 7
          Subtype MAC address (4): 00:00:12:13:00:37 (oui Unknown)
        Port ID TLV (2), length 7
          Subtype MAC address (3): 00:00:12:13:00:37 (oui Unknown)
        Time to Live TLV (3), length 2: TTL 120s
        System Name TLV (5), length 13: ip_k66f LAN:3
        End TLV (0), length 0


Signed-off-by: Lukasz Majewski <lukma@denx.de>
2021-01-20 10:03:42 +02:00