Commit graph

41176 commits

Author SHA1 Message Date
9c173088de boards: arm: enable the 2 MiB of NOR flash on the adafruit_itsybitsy_m4_express
This enables the QSPI NOR driver and binds in the flash.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
9c9ca0df3b drivers: flash: report if the read returns an error
This matches the other commands that log on error.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
f92ee630f8 boards: arm: add OpenOCD flash and debug support for the itsybitsy_m4
...and document.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
9b3f6daa4b boards: arm: enable the QSPI controller and attached flash on the adafruit_itsybitsy_m4_express
Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
de33e36614 drivers: spi: add a driver for the SAM0 QSPI peripheral
Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
709d69a816 boards: arm: enable the adafruit_itsybitsy_m4_express SPI port
Tested by running tests/drivers/spi/spi_loopback

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
c5bb25bc4a drivers: spi: ensure the first byte has been loaded in the TX fast path
The SAM0 has a data register and a shift register.  Data that is
written to the data register is transferred to the shift register by
the peripheral.

On the SAMD51, the CPU is fast enough that the first data write hasn't
been transferred to the shift register by the time the next data write
occurs, causing the second write to be dropped, causing the receiver
to wait forever.

Fix by spinning until the data register is empty.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
1c773df34f boards: arm: enable the adafruit_itsybitsy_m4_express watchdog
Tested by running samples/drivers/watchdog/

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
2083dfe707 boards: arm: document the adafruit_itsybitsy_m4_express RTC support
Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
2e638a8b60 drivers: timer: fix the use of K_FOREVER and add support for the SAMD51
Change K_FOREVER for K_TICKS_FOREVER.

The COUNT register on the SAMD51 RTC can only be read if the read
synchronisation mode is enabled.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
73fad96d04 boards: arm: document the HWINFO support for adafruit_itsybitsy_m4_express
Tested by updating the hello world sample to dump the hwinfo:

hwinfo len()=16 eb 4 79 52 53 37 43 31 39 20 20 20 ff 11 27 13

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
07a9a346d1 boards: arm: enable the adafruit_itsybitsy_m4_express entropy driver
Tested using:

$ west build -b adafruit_itsybitsy_m4_express samples/drivers/entropy

Giving:

entropy device is 0x20000070, name is ENTROPY_0
  0x9a  0x13  0x28  0xbf  0x3d  0x1b  0xf7  0xc9  0x94
  0xcd  0x9f  0x66  0x3c  0x9d  0xaf  0x25  0x9a  0x84
  0xfc  0x5f  0x85  0x69  0x4e  0x93  0xbd  0xb9  0x01
  0x43  0xb1  0x45  0x3c  0x5a  0x1b  0x50  0x64  0x17
  0xfb  0x7e  0x9d  0x5c  0x46  0x57  0x72  0xfa  0xa6
  0x6f  0x48  0x63  0x30  0x05  0xbe  0xe1  0x45  0x80

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 17:01:46 +02:00
ef9c2e091b boards: arm: document the adafruit_itsybitsy_m4_express
Add documentation on the board, current features, and a picture.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 16:58:58 +02:00
392c9cab4c boards: arm: add the Adafruit ItsyBitsy M4 Express
The Adafruit ItsyBitsy M4 express is a small (36 mm x 18 mm) ARM
development board with an onboard RGB LED, USB port, 2 MiB of SPI
flash, and range of I/O broken out onto 23 GPIO pins.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 16:58:58 +02:00
fd53ff0e97 dts: arm: add a name to cpu0
This allows referencing the CPU in the board-specific DTS file.

Also fix warnings by making the addresses lower case.

Signed-off-by: Michael Hope <mlhx@google.com>
2020-05-31 16:58:58 +02:00
Martí Bolívar
3852e08126 drivers: spi_ll_stm32: fix COND_CODE_1 usage
The consequent and alternate expressions for COND_CODE_1 must be
enclosed in parentheses, like this:

COND_CODE_1(PREDICATE, (consequent), (alternate))

The parens are missing in exactly one place in the tree. Fix it.

Reported-by: Peter Bigot <peter.bigot@nordicsemi.no>
Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-29 23:07:19 +02:00
Andy Ross
a343cf9480 kernel/timer: Handle K_FOREVER in k_timer_start()
The possibility of passing K_FOREVER as the initial duration argument
to k_timer_start() wasn't being handled, with the result that the
computed value became an zero timeout (effecitvely treating it as
K_NO_WAIT and firing at the next tick).

This is obviously pathlogical, but it should still do what the code
says it should and wait forever.

Make k_timer_start(..., K_FOREVER, ...) a noop.

Fixes #25820

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-05-29 19:59:14 +02:00
Carles Cufi
d29a06f8a8 doc: dev process: Add a note about deprecation mechanisms
Describe how an API can be deprecated, which is via the __deprecated
keyword or by introducing a legacy Kconfig option.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2020-05-29 18:06:52 +02:00
Jim Luther
ffd15131d2 bluetooth: host: fix unpacked l2cap struct
The bt_l2cap_le_conn_rsp struct in l2cap_internal.h has not been
declared __packed. This can cause alignment problems on some
platforms if the struct is placed on an unaligned address.

A __packed declaration solves this issue by forcing the compiler to
use store instructions that do not required alignment.

Signed-off-by: Jim Luther <jilu@oticon.com>
2020-05-29 17:43:32 +02:00
Vincent Wan
95ac55327b boards: arm: minor update to docs for CC13x2/CC26x2
Add a bit more of an intro to power management support.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-05-29 15:05:18 +02:00
Vincent Wan
6084957fb8 doc: release-notes-2.3: add power management for CC13x2/CC26x2
Add support of power management for CC13x2/CC26x2 in release notes.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-05-29 15:05:18 +02:00
Vincent Wan
99a9aa4f7d samples: cc13x2_cc26x2: system_off: fix documentation formatting
Fix minor formatting issue in README to fully display console output.

Signed-off-by: Vincent Wan <vincent.wan@linaro.org>
2020-05-29 15:05:18 +02:00
Henrik Brix Andersen
8b5b7fcf8d test: lib: devicetree: add tests for DT_ macros for retrieving PWM period
Add tests for DT_ macros for retrieving the 'period' cell value.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-05-29 14:48:12 +02:00
Henrik Brix Andersen
3046e228e7 devicetree.h: pwms: Add DT_ macros for retrieving pwm period
Add DT_ macros for retrieving the value of the 'period' cell for PWM
controllers supporting this cell type.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2020-05-29 14:48:12 +02:00
Francois Ramu
a089e3617d boards: arm: stm32l4r5 unset the LPTIM clock source if enabled
For nucleo_l4r5zi board, the LPTIM clock source is defined
as LSE as default.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-29 14:13:05 +02:00
Francois Ramu
f30f5fff72 drivers: timer: lptim is [EXPERIMENTAL] for stm32 soc series only
Activation of the LPTIMER is valid for SLEEP MODE only
The choice of the lptim clock source is STM32_LPTIM_CLOCK
set the LSE in first position to have as default value

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-29 14:13:05 +02:00
Francois Ramu
7545b7888a dts: stm32: timer define a new DT binding for LPTIM
Adds a new LPTIM binding for stm32 soc,
based on the timer binding. This will makes a specific filter
on dt_compat_enabled("stm32,lptim")

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-29 14:13:05 +02:00
Francois Ramu
992c005ab9 soc: arm: stm32 TICKS value with LPTIM config
This is defining the SYS_CLOCK_TICKS_PER_SEC default value
depending on the LPTIM CLOCK frequency in case of LPTIMER,
to get a TICK value as a divider of the LPTIM clock source.
It gives a better result in formulas when converting
ticks to count unit.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-29 14:13:05 +02:00
Francois Ramu
7be27b5169 drivers: timer: stm32_lptim fix TICKLESS=n processing
based on PR#25412
Some kernel tests use `CONFIG_TICKLESS_KERNEL=n` with
`CONFIG_SYS_CLOCK_TICKS_PER_SEC=1` to detect when a test runs longer
than 1 second.  These tests break if a tick is announced every time a
timeout occurs.  Only announce if the measured duration since the last
tick is at least the duration of a tick.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-29 14:13:05 +02:00
Francois Ramu
29ea09ee52 driver: timer: stm32_lptim control the timer duration
This change makes the lptimer running with lower tick periods
and small tick values

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-29 14:13:05 +02:00
Francois Ramu
fcfcc1d6ea driver: timer: stm32_lptim set_timeout limit values
set the min and max values of the given ticks from 0
to LPTIM_TIMEBASE which is the full register value
In case the timeout is FOREVER, then lptimer is stopped

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-29 14:13:05 +02:00
Julien D'Ascenzio
3894c6ee50 driver: timer: fix accumulated counter increment
The current value of the counter must not be added to the accumulator.
It will be added when calling z_timer_cycle_get_32.

Signed-off-by: Julien D'Ascenzio <julien.dascenzio@paratronic.fr>
2020-05-29 14:13:05 +02:00
Francois Ramu
b0081d1f38 driver: timer: stm32_lptim: tickless mode without a compilation flag
In the timeout function, remove the compilation flag
and use the macro instead.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
2020-05-29 14:13:05 +02:00
Julien D'Ascenzio
b976e76866 driver: timer: stm32_lptim: fix hang when no tickless
When the tickless kernel isn't used, we don't want to wait for ARROK.
This wait can be endless.

Signed-off-by: Julien D'Ascenzio <julien.dascenzio@paratronic.fr>
2020-05-29 14:13:05 +02:00
Julien D'Ascenzio
e20d7890ef driver: timer: stm32_lptim: fix autoreload value
Autoreload value must be decrement by one

Signed-off-by: Julien D'Ascenzio <julien.dascenzio@paratronic.fr>
2020-05-29 14:13:05 +02:00
Vinayak Kariappa Chettimada
ba487feb0f Bluetooth: controller: split: Workaround nRF52832 CCM overrun
Implemented an intermediate decrypt buffer to cover the CCM
overrun under CRC error conditions. The workaround is
applicable to nRF52832 SoC only, which is missing the
MAXPACKETSIZE register in the NRF_CCM peripheral.

Fixes #21107 for nRF52832 SoC.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2020-05-29 13:12:28 +02:00
Stephanos Ioannidis
90f18b2127 doc: Add ARM release notes for v2.3
This commit adds the ARM release notes for the v2.3 release.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2020-05-29 13:12:14 +02:00
Ioannis Glaropoulos
f0a09ac32d doc: release notes: add release notes entries for ARM Cortex-M
Zephyr v2.3 release notes content for ARM Cortex-M architecture.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2020-05-29 13:12:14 +02:00
Jukka Rissanen
bc40177020 net: ipv6: RA prefix option length not checked
The Router Advertisement can have prefix option. It's length
is 4 but the code did not check that which meant that we could
accept malformed packet. See RFC 4861 chapter 4.6.2 for details.

Fixes #25694

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2020-05-29 13:11:48 +02:00
Torsten Rasmussen
8d3e822e79 cmake: resolved list issue when parsing shield list
Fixes: #25656

The commit a8e90cbfb3 improved handling of
shields. Unfortunately it pops items from the SHIELD variable which
works well if SHIELD is a CMake ;-separated list, but if the list is
a space separated list, as may be provided by the user, then this
principle fails as reported in #25656.

This is fixed by keeping improved behaviour, while popping from an
alternative SHIELD-NOTFOUND list instead.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-05-29 13:11:17 +02:00
Marc Herbert
3a04536487 doc,cmake: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Marc Herbert
2cd51a33ce samples: make find_package(Zephyr...) REQUIRED
This provides a better error message when building with CMake and
forgetting ZEPHYR_BASE or not registering Zephyr in the CMake package
registry. See parent commit for more details (split from parent for
better readability).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Marc Herbert
debade9121 tests: make find_package(Zephyr...) REQUIRED
... because it is (required).

This makes a difference when building with CMake and forgetting
ZEPHYR_BASE or not registering Zephyr in the CMake package registry.

In this particular case, REQUIRED turns this harmless looking log
statement:

-- Could NOT find Zephyr (missing: Zephyr_DIR)
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- ...
-- ...
-- ...
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:8 (target_sources):
  Cannot specify sources for target "app" which is not built by
  this project.

... into this louder, clearer, faster and (last but not least) final
error:

CMake Error at CMakeLists.txt:5 (find_package):
  Could not find a package configuration file provided by "Zephyr" with
  any of the following names:

    ZephyrConfig.cmake
    zephyr-config.cmake

  Add the installation prefix of "Zephyr" to CMAKE_PREFIX_PATH or set
  "Zephyr_DIR" to a directory containing one of the above files.  If
  "Zephyr" provides a separate development package or SDK, be sure it
  has been installed.

-- Configuring incomplete, errors occurred!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-29 10:47:25 +02:00
Andrew Boie
32ebe3cd24 x86: 32-bit: allow direct ISRs only with !KPTI
This doesn't work as expected with kernel page table isolation
turned on, and fixing it would likely lose any latency benefits
that direct ISRs are supposed to provide.

For now, just prevent these macros from being defined if KPTI
is turned on, like other arches that do not implement this
feature.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2020-05-29 10:46:00 +02:00
Tomasz Bursztyka
549cfff6c9 device: Rephrase data parameter documentation
This parameter points to the driver instance private data, and not to
its configuration data, which one is set via cfg_info parameter.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-05-29 10:42:07 +02:00
Tomasz Bursztyka
794665e75b gpio: Fix header comments
There is no device config structure anymore, and
s/decleration/declaration

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-05-29 10:42:07 +02:00
Martí Bolívar
af40c99fac doc: release notes update for devicetree
I believe the devicetree documentation for the release is in good
enough shape now. Add a few more links to the release notes to provide
users with more hints for adapting to the new API.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-28 22:12:38 +02:00
Martí Bolívar
e4a761cffe devicetree: add migration guide documentation and tests
Add test cases that verify various bits and pieces of the legacy
devicetree macros match the new APIs.

Writing these test cases without giving rise to deprecated macro
warnings which might break people's CI if they build with -Werror
requires turning off the __WARN() generation in
devicetree_legacy_unfixed.h. The entire file is deprecated at this
point and must be explicitly enabled with an opt-in Kconfig option, so
there isn't any harm in doing this.

Nevertheless, take a minimally invasive approach to avoiding __WARN()
generation in gen_legacy_defines.py, to avoid the possibility of
breakage. This code is basically frozen anyway, so hacks like this
won't cause maintainability problems since it isn't being actively
maintained.

Use the new tests as fodder for a migration guide from the old API in
the documentation.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-28 22:12:38 +02:00
Martí Bolívar
f1808c4a80 tests: move lib/devicetree to lib/devicetree/api
This is preparation for an additional test suite specifically for the
legacy API which will be added next.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-28 22:12:38 +02:00
Martí Bolívar
e5418ff5bf doc: devicetree: update binding-template.yaml
Remove some deprecated or obsolete functionality:

- the 'title:' key is now deprecated
- more than 2 levels of child-binding are now supported

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2020-05-28 22:12:38 +02:00