Commit graph

56177 commits

Author SHA1 Message Date
Alexandre Bourdiol
dc986291bd soc: stl32l0: Enable DMA clock instead of DBGMCU clock
During review of #38681, switching from HAL to LL,
involuntarily enable DBGMCU clock instead of DMA clock.

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-09-21 10:45:57 -04:00
Robert Lubos
2160e0fc36 net: lwm2m: Fix Registration failue reporting
In case LwM2M server or bootstrap server rejected
Registration/Registration Update/Deregsitration attempt, there were no
reasonable notification to the application. Fix this by reporting
LWM2M_RD_CLIENT_EVENT_*_FAILURE in such case.

Addtitionaly, remove pointless ENGINE_DEREGISTER_FAILED event, which
have no use in the state machine.

Finally, simplify the response code logging to prevent code duplication.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-21 09:32:31 -05:00
Andrzej Głąbek
5601805695 drivers: i2c_nrfx_twim: Add handling of buffers located in flash
TWIM peripherals cannot perform write transactions from buffers
located in flash. The content of such buffers needs to be copied
to RAM before the actual transfer can be requested.
This commits adds a new property (zephyr,flash-buf-max-size) that
informs the driver how much space in RAM needs to be reserved for
such copying and adds proper handling of buffers located in flash.
This fixes an issue that caused that e.g. the DPS310 sensor driver
did not work on nRF SoCs that only have TWIM, not TWI peripherals.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-09-21 13:44:06 +02:00
Andrzej Głąbek
99ce264df7 drivers: i2c_nrfx_twim: Use concatenation buffer by default
Issue an error logging message when the i2c_nrfx_twim driver lacks
a concatenation buffer big enough to properly handle a call to
i2c_burst_write() function, to give the user a hint what is wrong.

Also use by default a 16-bytes long concatenation buffer for every
instance of the i2c_nrfx_twim driver. Such value should cover most
of the simple uses of the i2c_burst_write() function, like those
in the stmemsc sensor drivers, and when a longer buffer is needed,
the user will be provided with the above message pointing to the
property that should be adjusted.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-09-21 13:44:06 +02:00
Carles Cufi
4801cbd921 Bluetooth: controller: Replace {m_,s_} with {c_,p_}
Replace the old master and slave prefixes with the new central and
peripehral ones from the Bluetooth spec v5.3.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-21 13:01:29 +02:00
Carles Cufi
947b38ac0a Bluetooth: controller: Replace slave with peripheral
Replace the old slave term with the new peripheral
one from the Bluetooth spec v5.3.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-21 13:01:29 +02:00
Carles Cufi
ba2d2ee936 Bluetooth: controller: Replace master with central
Replace the old master term with the new central one
from the Bluetooth spec v5.3.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-21 13:01:29 +02:00
Carles Cufi
40e7f5cd73 Bluetooth: controller: Fix coding guidelines violation
Avoid using "free" since it's a reserved identifier, switch to
"free_idx".

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-21 13:01:29 +02:00
Carles Cufi
76bf881e42 Bluetooth: controller: Replace whitelist with FAL
Replace the old whitelist-related terms with the new filter accept list
one from the Bluetooth spec v5.3.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-21 13:01:29 +02:00
Aymeric Aillet
456c28eb20 board: doc: Update H3ULCB doc for v2.7
Update the documentation for the Renesas H3ULCB board.

It document features that have been merged
during v2.7 windows and before.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2021-09-21 06:29:09 -04:00
Alexandre Bourdiol
436ba56059 soc: stm32: SEGGER RTT requires some extra configuration
On some STM32 boards, for unclear reason,
RTT feature is working with realtime update only when
  * one of the DMA is clocked
and sometimes also
  * one of the DBGMCU bit STOP/STANDBY/SLEEP is set
Fixes #34324

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-09-21 06:24:09 -04:00
Alexandre Bourdiol
5674eaca2c soc: arm: stm32h7: rework STM32H7 dual core boot
It happens that CM7 wakeups CM4, before CM4 goes to sleep.
Thus when CM4 goes to sleep,
there no more wakeup from CM7. And CM4 hangs.
For a simple synchronisation implementation,
CM4 doesn't go to sleep any more,
instead it waits (active wait) for CM7 to take HSEM
(meaning that clock configuration is finished).

Fixes #38069

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-09-21 06:23:38 -04:00
Dominik Ermel
6272d303c4 samples/littlefs: Remove FIXME with PRIxPTR usage
With "Incompatible (u)intptr_t type and PRIxPTR definitions",
https://github.com/zephyrproject-rtos/zephyr/issues/37718,
issue resolved the FIXME code is no longer needed.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-09-21 06:21:59 -04:00
Alexandre Bourdiol
ac9bb33ab4 soc: stm32l0: enable DMA clock to fix Hardfault linked to DBGMCU bits
On STM32L0, there are some hardfault when DBGMCU bit Sleep, Stop
or Standby are enabled. See #37119
For unclear reason, enabling DMA clock fixes this issue.
(similarly than #38561, DMA clock comes with DBGMCU bits)

Signed-off-by: Alexandre Bourdiol <alexandre.bourdiol@st.com>
2021-09-21 06:21:40 -04:00
Berend Ozceri
357ec64b36 drivers: timer: Fix RISC-V machine timer count drift due integer math
If CYC_PER_TICK does not divide the (now - last_count) quantity exactly with integer math, the subsequent multiplication before incrementing last_count causes a drift. This commit eliminates the redundant division-followed-by-multiplication and fixes https://github.com/zephyrproject-rtos/zephyr/issues/37852

Signed-off-by: Berend Ozceri <berend@recogni.com>
2021-09-20 19:50:40 -04:00
Erwan Gouriou
123be4f13d samples/posix: eventfd: Prevent run in twister when SRAM below 32K
This test makes use of dynamic RAM allocation done on the leftover
SRAM. Similarly to test/posix/eventfd, limit this test execution on
platforms with at least 32K of RAM available.

Fixes #38601

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-20 19:48:34 -04:00
Ryan McClelland
deef96d70c lib: timeutil: fix implicit conversions from float to double
C implicit promotion rules will want to make floats into doubles very
easily. Zephyr build will generate warnings when this flag,
`-Wdouble-promotion`, is enabled with GCC

Signed-off-by: Ryan McClelland <ryanmcclelland@fb.com>
2021-09-20 19:47:57 -04:00
Daniel Leung
c1e81855bc demand_paging: eviction/nru: fix incorrect dirty bit return val
In k_mem_paging_eviction_select(), the returned dirty bit value
may not be actually associated with the page selected, but
rather the last page examined. So fix this.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-09-20 19:43:02 -04:00
Stephanos Ioannidis
a1a6619056 cmake: Do not include zephyr_stdint.h for native POSIX archs
This commit updates the Zephyr build system such that it does not
include the `zephyr_stdint.h`, which tries to define Zephyr's own type
system, when compiling for the native POSIX architecture.

The native POSIX architecture compiles with the host toolchain and
headers, and there can be conflicts if we arbitrarily define our own
type system (e.g. mismatch between the types and the specifiers defined
in `inttypes.h`).

Note that this is not meant to be a permanent fix; instead, it is meant
to serve as a temporary workaround until we no longer need to define
our own type system.

For more details, refer to the issue #37718.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-09-20 19:34:18 -04:00
Ryan Erickson
ac029cf263 MAINTAINERS: Add modem maintainer
Add myself (rerickson1) as modem maintainer.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2021-09-20 19:29:13 -04:00
Anas Nashif
b38d82382a MAINTAINERS: fix github handle for dleach02
Fix dleach2 -> dleach02.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-09-20 17:55:23 -04:00
Carles Cufi
e2f85b1124 Bluetooth: tests: Align with terms in v5.3 spec
Align with the new inclusive naming terms in the v5.3 spec in the
Bluetooth tests.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-20 20:01:32 +02:00
Carles Cufi
b8770acc28 Bluetooth: host: Align with terms in v5.3 spec
Align with the new inclusive naming terms in the v5.3 spec in the
Bluetooth Host implementation.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-20 20:01:32 +02:00
Carles Cufi
1821d342c2 Bluetooth: shell: Align with terms in v5.3 spec
Align with the new inclusive naming terms in the v5.3 spec in the
Bluetooth shell implementation.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-20 20:01:32 +02:00
Carles Cufi
3b33ba2320 Bluetooth: shell: Avoid reusing the same label
To avoid hitting the following violation:
Violation to rule 5.7 (Tag name should be unique)

Replace the use of "shell" in the shell as an instance of a pointer to
const struct shell.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-20 20:01:32 +02:00
Carles Cufi
f1dff28854 Bluetooth: controller: hci: Align to terms in the v5.3 spec
Align with the new inclusive naming terms in the v5.3 spec in the
controller's HCI implementation.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-09-20 20:01:32 +02:00
Ryan Erickson
42075342a8 modem: hl7800: fix PSM
Fix power-save-mode (PSM) operation.
When in PSM, do not bring the networking interface down
when an out-of-coverage event occurs.
When PSM goes into hibernate, this will cause an
out-of-coverage event to occur, even though the device
still has access to service.
Keeping the networking interface in the up state
allows an app to send data whenever it needs to.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2021-09-20 12:24:40 -04:00
Ryan Erickson
2dcd5b44e1 DTS: modem: HL7800: remove DTR binding
Remove the HL7800 DTR device tree binding because the
DTR IO is not needed for operation of the HL7800
modem.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2021-09-20 12:24:40 -04:00
Ryan Erickson
38c8d4729f modem: hl7800: remove DTR control
Using DTR to control sleep modes is a legacy mode
of operation. Remove control of DTR IO.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2021-09-20 12:24:40 -04:00
Ryan Erickson
982c072221 modem: hl7800: change sleep mode
Sleep mode 0 (driven by DTR) is only recommended for use
as a legacy option.
Sleep mode 1 is recommend by Sierra Wireless.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
2021-09-20 12:24:40 -04:00
Julien D'ascenzio
ca7899afa9 drivers: spi: stm32: Fix forever lock when configure failed
On transceive, if the SPI configure failed, the SPI wasn't release.

Signed-off-by: Julien D'ascenzio <julien.dascenzio@paratronic.fr>
2021-09-20 10:17:56 -04:00
Vinayak Kariappa Chettimada
a9a01d4cb7 Bluetooth: Controller: Fix missing reset of Periodic Sync Create
Fix missing reset of Periodic Sync Create when HCI Reset is
performed.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-20 12:26:51 +02:00
Vinayak Kariappa Chettimada
29ae143a10 Bluetooth: Controller: Refactor out initiator reset
Refactor out the initiator reset implementation into a
function.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-09-20 12:26:51 +02:00
Jamie McCrae
e937dde3ca boards: arm: bl654_usb: Fix name and identifier
Fixes identifier to use Laird Connectivity name

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-09-20 06:17:29 -04:00
Jamie McCrae
73eaf92065 boards: arm: bl654_usb: Fix offset load
Fixes applications not building for offset 0x1000

Signed-off-by: Jamie McCrae <jamie.mccrae@lairdconnect.com>
2021-09-20 06:17:29 -04:00
Gerson Fernando Budke
e5ef9ca7a5 samples: net: echo_server: Decrease buffer for atsamr21_xpro
From 2.4 to 2.7 the net samples pair echo-server/client increase the
SRAM requirements. This adjusts example features to free necessary SRAM
to run example.

Signed-off-by: Gerson Fernando Budke <nandojve@gmail.com>
2021-09-20 06:01:12 -04:00
Robert Lubos
88c06aeb24 net: lwm2m: Fix IPSO Push Button counter incrementation
The Counter resource in the IPSO Push Button object was incremented
silently by the post write handler of the State resource. This prevented
the resource from being marked as updated, effectively preventing
the engine from sending notifications to observers.

Fix this, by setting the new counter value with `lwm2m_engine_set_u64()`
instead. This will update the resource value, and trigger the engine to
send notifications if needed.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-09-20 05:59:28 -04:00
Martí Bolívar
008c384c4b boards: rename thingy53_nrf5340_cpuappns
Change the 'ns' suffix to '_ns' for consistency with other boards.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-20 05:57:24 -04:00
Martí Bolívar
b98c8bf4a5 boards: rename sparkfun_thing_plus_nrf9160ns
Change the 'ns' suffix to '_ns' for consistency with other boards.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-20 05:57:24 -04:00
Martí Bolívar
41e87ae688 boards: rename nrf9160_innblue22ns
Change the 'ns' suffix to '_ns' for consistency with other boards.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-20 05:57:24 -04:00
Martí Bolívar
c6c42d42ea boards: rename nrf9160_innblue21ns
Change the 'ns' suffix to '_ns' for consistency with other boards.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-20 05:57:24 -04:00
Martí Bolívar
5854bc3a48 boards: rename circuitdojo_feather_nrf9160ns
Change the 'ns' suffix to '_ns' for consistency with other boards.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
2021-09-20 05:57:24 -04:00
Christopher Friedt
b57293d6e6 Revert "board: Added board support package for Nucleo_F446ZE"
This reverts commit 0d53844714.

Signed-off-by: Christopher Friedt <chrisfriedt@gmail.com>
2021-09-20 05:50:34 -04:00
Ron Smith
9fa1f6edca tests: uart_async_api: Correct DMA channels on atsamr21_xpro board
This commit corrects the DMA channels for the asynchronous
UART API testing support on the SAM R21 Xplained Pro board.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
2021-09-19 19:31:25 -04:00
Ron Smith
dd3a3318ec dts: atmel: sam0: Add clarification on dma-cells property
Add clarification to the dma-cells property explaining the purpose
of each cell.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
2021-09-19 19:31:25 -04:00
Ron Smith
683dbc4573 drivers: serial: uart_sam0: Fix async tx done event triggering to early.
uart_sam0_dma_tx_done callback triggers when the last byte
is transferred from the tx sram buffer to the sercom DATA register.
However the byte has yet to be transmitted completely which can lead to
incorrect event handling if UART_TX_DONE is expected to signal
the end of transmission.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
2021-09-19 19:31:25 -04:00
Ron Smith
a0d92453d8 drivers: serial: uart_sam0: move err_check methodout of if guard
Fixes a compile error for the err_check function not being found if
if CONFIG_UART_INTERRUPT_DRIVEN is not enabled.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
2021-09-19 19:31:25 -04:00
Ron Smith
4f9ac180b4 drivers: dma: dma_sam0: change sam0 DMA to higher priority init.
fixes peripheral drivers such as async uart that rely on dma being
ready failing because dma is not initialized yet.

Signed-off-by: Ron Smith <rockyowl171@gmail.com>
2021-09-19 19:31:25 -04:00
Tom Owen
0d53844714 board: Added board support package for Nucleo_F446ZE
Includes support for USB, CAN, ADC, DAC, and Arduino GPIO Map.
Future could support: ETM Trace (if Zephyr supports it), QSPI, FMC, DCMI

Initially based on closest BSP for the same SoC: nucleo_f446re
Extra peripherals added based on closest BSP for nucleo-144 board:
 nucleo_f429zi
Checked against nucleo-144 schematic
Documentation updated as best as I could
Arduino compatible pinmux for SPI, UART and I2C via Zio header

Tested:
  USB Device mode (samples/subsys/usb/console)
  Console via ST-link usart3 (samples/hello_world)
  user LEDs (samples/basic/blinky)
  scripts/twister --device-tests -p nucleo_f446ze
Not tested but should work: SPI, I2C, CAN, ADC, DAC
Not working yet: Quad-SPI (missing in dts/arm/st/f4/stm32f4.dtsi)

Co-authored-by: Alexandre Bourdiol
 <50730894+ABOSTM@users.noreply.github.com>
Signed-off-by: Tom Owen <tom.owen@zepler.net>
2021-09-18 09:15:45 -04:00
Katsuhiro Suzuki
981d10f232 dts: riscv: fix irq number of UART and SPI for SiFive FU740
This patch fixes wrong PLIC irq number of UART and SPI for SiFive
FU740 on HiFive Unmatched. Use samples/subsys/console/echo for
testing.

Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
2021-09-18 09:15:15 -04:00