Commit graph

41120 commits

Author SHA1 Message Date
Ulf Magnusson
2a4d8b07aa scripts/dts: Remove weird def_label.split('/') code
def_label is the name used for macros and .conf file values. It can
never have a slash in it.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-15 11:09:49 -05:00
Ulf Magnusson
f95a230b82 scripts/dts: Clean up/fix extract/interrupts.py a bit
- Fix broken code that was meant to turn the
   'interrupts'/'interrupts-extended' value into a list if it wasn't.
   list(123) will error out instead of creating [123].

 - Remove weird .split('/') on macro name

 - Rename 'props' to 'vals'. It's the value of a single property.

 - Get rid of a bare 'except:'

 - Rename l_fqn to full_name. Accidentally stumbled upon 'fqn' probably
   standing for "fully qualified name", but it's not obvious.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-15 11:09:49 -05:00
Ulf Magnusson
3b64e71221 scripts/dts: Simplify extract/interrupts.py and add some helpers
- Have get_parent_path() return None for the root ('/'). This is handy
   when looping over path components.

 - Move _find_parent_irq_node() out of the class, call it
   parent_irq_node(), and use get_parent_path() in it.

 - Add a global err() function for reporting errors. Use it if a node
   unexpectedly has no interrupt-parent.

   Previously, this would give a Python error instead.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-15 11:09:49 -05:00
Ulf Magnusson
a3d3aa58b8 scripts/dts: Remove redundant empty constructors
It's not obligatory for Python classes to have an __init__().

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-15 11:09:49 -05:00
Ulf Magnusson
0a3f00ad7c scripts/dts: Rename get_node_label() to node_label()
Just returns a value, with no side effects.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-15 11:09:49 -05:00
Ulf Magnusson
82adc2706d drivers: watchdog: Rename CONFIG_WDT_SAM_DISABLE_AT_BOOT in comments
CONFIG_WDT_SAM_DISABLE_AT_BOOT was removed in commit 2e01e86bdc
("drivers: watchdog: wdt_sam: use the generic disable option"), but some
comments still talked about it. Replace it with
CONFIG_WDT_DISABLE_AT_BOOT.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2019-03-15 10:38:46 -05:00
Jukka Rissanen
622e49394a doc: net: Re-apply the networking release notes for 1.14
This is a revert of 45a4fbf2ae and
this commit removes the offending function references from
Networking chapter in 1.14 release note. After the BSD socket
documentation adds the function references we can revisit the
release note and add back the function references.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-15 10:35:46 -05:00
Benjamin Valentin
896e084d7b boards: arm: atsamd21: enable button in dts
The SAM D21 Xplained Pro has a button connected to PA15, so enable it
in the dts.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
2019-03-15 10:31:09 -05:00
Maureen Helm
0cff42fe9d drivers: sensor: Refactor apds9960 to use const config struct
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>
2019-03-15 10:30:53 -05:00
Maureen Helm
cfab3273aa boards: reel_board: Fix apds9960 i2c address
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>
2019-03-15 10:30:53 -05:00
Ioannis Glaropoulos
6a546d1938 drivers: usb: nrfx: initialize local struct to zero
Initialize a local struct variable to zero, to suppress
un-initialized variable error.

Fixes #14422.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2019-03-15 09:26:43 -05:00
Erwan Gouriou
239e397167 drivers/counter: stm32: Fix time_t usage
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>
2019-03-15 09:26:12 -05:00
Henrik Malvik Halvorsen
627fdd67f3 drivers: sensor: ADXL362 data conversion fix
The ADXL362 sensor data is converted to the expected
output, m/s^2.

Signed-off-by: Henrik Malvik Halvorsen <henrik.halvorsen@nordicsemi.no>
2019-03-15 09:25:58 -05:00
Michael Scott
83aa7cecd4 boards: arm: nrf52840-based: Free up flash room for sample apps
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>
2019-03-15 08:52:06 -05:00
Kumar Gala
2153c014ea arm: asm: Fix inline asm in z_arch_switch_to_main_thread for clang
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>
2019-03-15 08:16:27 -05:00
Johan Hedberg
96a754554e samples: reel_board/mesh_badge: Add protection for fast key presses
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>
2019-03-15 14:05:29 +01:00
Kumar Gala
45a4fbf2ae Revert "doc: Add networking information to 1.14 release note"
This reverts commit fe9f85464c.

Getting the following issues:

releases/release-notes-1.14.rst:60: WARNING: 'any' reference target not found: getnameinfo
releases/release-notes-1.14.rst:60: WARNING: 'any' reference target not found: shutdown
releases/release-notes-1.14.rst:60: WARNING: 'any' reference target not found: freeaddrinfo
releases/release-notes-1.14.rst:60: WARNING: 'any' reference target not found: gethostname
releases/release-notes-1.14.rst:60: WARNING: 'any' reference target not found: getsockopt
releases/release-notes-1.14.rst:60: WARNING: 'any' reference target not found: setsockopt
releases/release-notes-1.14.rst:60: WARNING: 'any' reference target not found: select

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2019-03-15 08:02:15 -05:00
Henrik Malvik Halvorsen
64fd822652 drivers: sensor: adxl362: Driver update and CS support
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>
2019-03-15 07:39:05 -05:00
Ulf Magnusson
5cd92276e7 drivers: console: kconfig: Remove redundant 'depends on UART_MCUMGR'
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>
2019-03-15 07:25:10 -05:00
Mariusz Skamra
8b5d73e0f1 Bluetooth: tester: Move BTP specification to auto-pts repository
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>
2019-03-15 07:24:08 -05:00
Song Qiang
5c0f6a3329 sensor: fxos8700: Convert to new DT_<COMPAT>_<INSTANCE> defines
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>
2019-03-15 07:23:27 -05:00
Geoffroy Van Cutsem
209e92ef12 doc: up_squared: add 'west' build option to the UP2 documentation
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>
2019-03-15 07:16:50 -05:00
Emanuele Di Santo
9acb643d23 kconfig: move Zephyr modules Kconfig entries to the top
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>
2019-03-15 07:13:46 -05:00
Paul Sokolovsky
193d6c60df net: sockets: Implement gai_strerror()
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>
2019-03-15 07:13:15 -05:00
Benjamin Valentin
4f42b11c3c boards: arm: atsamd21: enable USB in dts
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>
2019-03-15 07:10:37 -05:00
Andy Ross
222fd8f1ab drivers/timer/nrf_rtc_timer: Revert recent changes
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>
2019-03-15 07:01:27 -05:00
David B. Kinder
aa4531b2d0 doc: remove local version of Sphinx searchtools.js
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>
2019-03-15 07:00:12 -05:00
Sebastian Bøe
f13af1c80e doc: Instruct Windows users to not install the lastest gnuarmemb
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>
2019-03-15 06:58:36 -05:00
Michael Scott
8c615e7ce3 net: lwm2m: handle delay_work error in lwm2m_engine_init()
Let's handle errors during periodic service work submit.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-15 06:57:50 -05:00
Michael Scott
579e586fa1 net: lwm2m: fix write_handler sizes for float32/64
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>
2019-03-15 06:57:50 -05:00
Michael Scott
910506cfc1 net: lwm2m: guard obj_field parameter of LWM2M_HAS_PERM
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>
2019-03-15 06:57:50 -05:00
Michael Scott
fcde4c42cc net: lwm2m: raise stack sizes
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>
2019-03-15 06:57:50 -05:00
Michael Scott
d615ab0dc3 net: lwm2m: change resend packet to an INF message
To avoid missing important messages, let's change the resend
packet message from a DBG to an INF.

Signed-off-by: Michael Scott <mike@foundries.io>
2019-03-15 06:57:50 -05:00
Michael Scott
144ff91670 net: lwm2m: cleanup observes when closing context
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>
2019-03-15 06:57:50 -05:00
Michael Scott
35eb7818a7 net: lwm2m: remove unnecessary check in sm_do_registration()
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>
2019-03-15 06:57:50 -05:00
Michael Scott
a5a83675d4 net: lwm2m: correct status change on send_reg error
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>
2019-03-15 06:57:50 -05:00
Michael Scott
2ab50cb676 net: lwm2m: Follow POSIX send() API
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>
2019-03-15 06:57:50 -05:00
Jukka Rissanen
fe9f85464c doc: Add networking information to 1.14 release note
Contains major networking changes between 1.13 and 1.14 releases.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-15 06:48:41 -05:00
Jukka Rissanen
93f14a1fb6 doc: net: Add anchor to socket offloading chapter
We need to have a link to socket offloading chapter from
release notes.

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2019-03-15 06:48:41 -05:00
Andrew Boie
2518aaffb5 shell: fix build failure
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>
2019-03-15 06:46:06 -05:00
Ramakrishna Pallala
0cd2752eea power: Return error code for Device Idle PM disabled case
Return error code from device_pm_get/set() API's when
Device Idle PM is disabled.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2019-03-15 06:45:03 -05:00
Andrei Emeltchenko
99403c5b13 net: ethernet: Define and use Ethernet frame and datagram size
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>
2019-03-15 06:44:13 -05:00
Erwan Gouriou
652efa530f drivers/flash: stm32l4: Prepare for unaligned accesses in flash writes
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>
2019-03-15 06:43:24 -05:00
Erwan Gouriou
f3832a399e drivers/flash: stm32f3/stm32f1: define flash registers as volatile
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>
2019-03-15 06:43:24 -05:00
Kumar Gala
317d1c9d06 boards: mec2016evb_assy6797: Remove unneeded board.h
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>
2019-03-15 06:42:58 -05:00
Kumar Gala
3713ea4761 cmake: Fix how we set include dirs for userspace
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>
2019-03-15 06:42:41 -05:00
Kumar Gala
cb3fe3cc46 logging: Workaround build warning with clang
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>
2019-03-15 06:42:25 -05:00
Kumar Gala
4da0f8b796 linker: Remove unused (OPTIONAL) from linker scripts
(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>
2019-03-15 06:42:02 -05:00
Loic Poulain
116dd8e527 dts: arm: nxp: rt106x: Unified OCRAM node
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>
2019-03-15 06:40:23 -05:00
Loic Poulain
b8c1a0f29f dts: arm: nxp: rt: Create dedicated rt1064 dtsi
The i.MXRT1064 inheriting from i.MXRT1060, has additional embedded
4-MB QSPI flash (via flexspi1).

Signed-off-by: Loic Poulain <loic.poulain@linaro.org>
2019-03-15 06:40:23 -05:00