Defines device tree aliases for on-chip peripherals at the soc level
instead of the board level for all kinetis socs. The eliminates some
duplicate code in the board level device trees, and will allow drivers
to use device-tree generated macros directly instead of through dts
fixups.
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
Adds a way to register listeners for incoming scanner packets, in
addition to the callback passed in bt_le_scan_enable.
This allows application modules to add multiple scan packet listeners
without owning the scanner life cycle API, enabling use cases like
beacon scanning alongside Bluetooth Mesh.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Update menuconfig (and kconfiglib and guiconfig, just to sync) to
upstream revision 424d0d38e7, to get this commit in, which works around
a crash on some macOS Python installations.
menuconfig: Work around crash on resize on some macOS systems
get_wch() has started raising curses.error when resizing the
terminal on some macOS Python installations. Work around for now by
falling back on getch(), which still works.
See https://github.com/ulfalizer/Kconfiglib/issues/84. Needs more
investigation, but I don't have a Mac handy.
Based on https://github.com/ulfalizer/Kconfiglib/pull/85, but with
some more comments.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Use option ASSERT_NO_FILE_INFO to control panic or oops location print.
The cause of the exception can be backtraced using the stackframe
instead, which would give the user a way to reduce the footprint of the
panic implementation.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Completely remove the file info and condition expression from the
the print statement if they are not enabled. This saves a little code
space which adds up when there are many assert calls.
In bluetooth shell test this saves around 4.5k bytes.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Remove net bufs own assertion mechanism and use the system assert
instead. This changes the assertion messaged printed from printing
expression to printing the line and file name. This provides more
context as the same expression could be asserted upon multiple times and
would then not provide enough clarity in the message.
This removes the option to enable only net buf assertions.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Change assertion messaged printed from printing expression to printing
the line and file name. This provides more context as the same
expression could be asserted upon multiple times and would then not
provide enough clarity in the message.
Also using a formatted string would save code space as we can use the
same string for all messages instead of creating a unique one for each
condition.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Disable printing the line number in assertions when file name has been
disabled. Knowing the line number is not very useful when the name of
the file is unknown.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add option to disable the assertion message, this makes all __ASSERT
behave as __ASSERT_NO_MSG instead.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add verbose option which would control if the assertion mechanism prints
any information at all. With this disabled they application will have to
use the stack-frame to locate the assertion location.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Move __ASSERT_LOC macro so that it can be used by other modules even
when CONFIG_ASSERT are disabled.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Add Kconfig option to disable the conditional expression in the assert
that failed. This would save code space, and file and line provides
better information than the conditional expression in case where
the same expression would be asserted upon.
For example __ASSERT_NO_MSG(buf) wouldn't make much sense in
configuration where CONFIG_ASSERT_NO_FILE_INFO was enabled.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix ASSERTs that appears when enabling asserts in net buf.
Asserts are:
- Pulling from net buf before any data has been added.
- Pulling more data than has been allocated for the buf.
Fix warning:
W: You have 1 IPv4 net_if addresses but 2 network interfaces
W: Consider increasing CONFIG_NET_IF_MAX_IPV4_COUNT value.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix byteorder test writing past the data pointer. This would otherwise
have been caught by the assert, but net buf asserts were not enabled in
the test. Reset the buffer between different tests to re-use the same
16-byte buffer.
Turning on asserts gives:
starting test - net_buf_test_byte_order
ASSERTION FAIL [net_buf_simple_tailroom(buf) >= len] @
ZEPHYR_BASE/subsys/net/buf.c:775
E: r0/a1: 0x00000004 r1/a2: 0x00000307 r2/a3: 0x00000000
E: r3/a4: 0x00006d79 r12/ip: 0x00000000 r14/lr: 0x000028ad
E: xpsr: 0x61000000
E: Faulting instruction address (r15/pc): 0x000050b0
E: >>> ZEPHYR FATAL ERROR 4: Kernel panic on CPU 0
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Fix ASSERTs that appears when enabling asserts in net buf when adding
more data than has been allocated for the buf.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Assignments have no effect on promptless symbols. Flagged by
https://github.com/zephyrproject-rtos/zephyr/pull/20742.
Also remove the assignments to the other NET_GPTP_CLOCK_ACCURACY_*
symbols. They are all in the same choice (in
subsys/net/l2/ethernet/gptp/Kconfig), meaning only one of them can be
enabled, and the choice already defaults to
NET_GPTP_CLOCK_ACCURACY_UNKNOWN, which is the symbol assigned last.
The symbol assigned last becomes the choice selection when multiple
symbols in a choice are assigned to. The other choice symbols still
become n. Dependencies override assignments.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
The
"{" + ", ".join(...) + "}"
pattern is in a bunch of places now. Add an out_dev_init() helper for
it, with the same parameters as out_dev().
Also makes "{" vs. "{ " consistent, picking the first one.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Add a helper function verify_error() to testedtlib.py that takes a DTS
source and verifies that it generates a particular EDTError.
Use it to test the hints that the previous commit added to errors
generated by _slice().
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Show how the element size was calculated in the error message when a
'reg', 'ranges', or 'interrupts' property has the wrong size. This
should help with debugging. Also mention that #*-cells properties come
from the parent node, which can be subtle.
Came up in https://github.com/zephyrproject-rtos/zephyr/issues/21607
(though it seems the comment disappeared).
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
dt_chosen_reg() and dt_node_reg() take between 1 and 3 arguments, not
between 1 and 4 arguments. The implicit name argument isn't included in
the count.
These functions implement $(dt_chosen_reg_*) and $(dt_node_reg_*).
Giving the right max argument count makes Kconfiglib generate error
messages that give the location of the call, instead of getting a
cryptic generic Python error.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
Add SPI CS GPIO line to reel_board device tree. This is needed to make
the board work with Arduino SPI compatible shields.
Tested on reel_board (1507.1) and reel_board_v2 (1507.2).
Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
We move the SRAM partition that is used as shared memory with
the Network MCU to the upper part of the Application MCU
memory. In this case we can allocate all lower SRAM to the
application, if we are building a Zephyr image without
support for Trusted Execution.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
With this commit we introduce SRAM partitioning for nRF5340
Application MCU. We define fixed partitions for the Secure
and the Non-Secure images, when building with trusted
execution environment enabled (Secure and Non-Secure images).
For (Secure image) builds without trusted execution environment
enabled we now allocate all available Application MCU SRAM into
the single image, except for the SRAM being used as shared memory
with the Network MCU.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
Add device_type DTS property in sram0 and sram1 nodes,
for nRF5340 Application and Network CPU, respectively.
Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
When no scratch parition was defined in the DTS file, just assume that
MCUBoot was built to use swap with move strategy, and never touch
scratch.
Signed-off-by: Fabio Utzig <utzig@apache.org>
The virtual COM port of the STlink in the Nucleo board is connected to
LPUART1, but the board was configured to use UART1 instead. For this
reason, hello world sample did not work.
In addition to that, PA2 was assigned to both LPUART1 and UART2. UART2
TX is now muxed to PA14.
Signed-off-by: Martin Jaeger <17674105+martinjaeger@users.noreply.github.com>
On nucleo_g071rb, flashing using pyocd requested to hold reset button
during flashing operation.
Using newly available pyocd arguments this is no more needed and
nucleo_g071rb can now be flashed in a fully automated way.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
pyocd 0.24.0 provides support for more user options.
This enables flashing of additional boards using pyocd.
Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
The function bt_mesh_ctl_send() used to support maximum length of
11 bytes. The segmentation complies with the BLE Mesh Standard.
The ack is disabled in case of non unicast address.
Signed-off-by: Ahmed Hussein <ahmed_hussein_@hotmail.com>
Replaces the Mesh model settings_commit callback with a start callback,
indicating that the mesh model behavior is ready to start. Everything
that was previously done in the settings_commit callback may be moved to
this callback, which gets called just after mesh settings are committed,
instead of in the middle of the process.
This resolves an issue where models had no context in which to start
their behavior, as the previous settings_commit call fired before the
mesh was declared valid, making access APIs inaccessible.
Signed-off-by: Trond Einar Snekvik <Trond.Einar.Snekvik@nordicsemi.no>
Current implementation of application's cfg_write callback only has the
possibility of returning boolean status, which in case of failure only
allows for one error code; BT_ATT_ERR_WRITE_NOT_PERMITTED.
This change makes the application able to add own security check on
characteristic subscription in the cfg_write callback and report a more
relevant error code (e.g. BT_ATT_ERR_AUTHORIZATION).
Signed-off-by: Kim Sekkelund <ksek@oticon.com>
Remove toggling the advertise enable state when the advertiser name has
been updated. Advertise and scan response data should be used by the
controller on subsequent advertising events.
Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Prior to this you would get compilation error when building
samples for the nrf5340_dk_nrf5340_cpuappns board.
Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
Gets these commits in:
check_compliance.py: Detect refs to undef. symbols in samples and
tests
Extend the check for references to undefined Kconfig symbols to also
detect undefined symbols in samples and tests.
Samples and tests were skipped due to using separate Kconfig trees,
which hid the symbols defined in them. Work around it by grepping
for Kconfig symbol definitions in them instead.
Keep properly parsing the main Kconfig tree, as it's needed to see
symbol names that are stitched together with the Kconfig
preprocessor.
------------------------------------------------------------------
check_compliance.py: Detect bad header comments and other nits
Add a generic kitchen-sink Nits test for various minor nits that
aren't already covered by tools like checkpatch.pl and pylint. So
far checks this:
- Header comments in Kconfig files
- Missing newlines at the end of various source files (probably a
bad editor setting)
- Leading/trailing blank lines in files
------------------------------------------------------------------
check_compliance.py: Kconfig: Flag redundant $ZEPHYR_BASE in
'source'
'source's like
source "$(ZEPHYR_BASE)/Kconfig.zephyr"
can be simplified to
source "Kconfig.zephyr"
since $srctree already points to the Zephyr root.
Flag it in the Nits test.
This also avoids absolute paths showing up in some places.
------------------------------------------------------------------
check_compliance.py: Improve error reporting for Git commands
Similar improvements to
https://github.com/zephyrproject-rtos/zephyr/pull/21577. No custom
potentially-missing working directory is used here, but always
including the exception message still feels more robust.
Use err() instead of sys.exit() in git(), and have it include the
command name, which is helpful in logs.
Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit adds support for the on-board flash MX25R8035F that is
directly connected to the efr32fg soc.
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
This commit adds support for the on-board flash MX25R8035F that is
directly connected to the efr32mg soc.
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
This commit adds SPI driver and its bindings using the USART peripheral
for Silicon Labs EFM32 and EFR32 MCUs.
Signed-off-by: Christian Taedcke <hacking@taedcke.com>
calling UARTE power management with DEVICE_PM_SUSPEND_STATE
then DEVICE_PM_OFF_STATE causes a deadlock in while loop.
It waits for an event witch never comes
Signed-off-by: Ismael Fillonneau <ismael.fillonneau@stimio.fr>
This commit relocates the exception vector table address range
configuration routine that was previously implemented as part of
Cortex-R architecture reset function to SoC platform-specific
initialisation routine.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
This commit addresses the following issues:
1. Add a new Kconfig configuration for specifying Dual-redundant Core
Lock-step (DCLS) processor topology.
2. Register initialisation is only required when Dual-redundant Core
Lock-step (DCLS) is implemented in hardware. This initialisation is
required on DCLS only because the architectural registers are in an
indeterminate state after reset and therefore the initial register
state of the two parallel executing cores are not guaranteed to be
identical, which can lead to DCCM detecting it as a hardware fault.
A conditional compilation check for this hardware configuration
using the newly added CONFIG_CPU_HAS_DCLS flag has been added.
3. The existing CPU register initialisation code did not take into
account the banked registers for every execution mode. The new
implementation ensures that all architectural registers of every
mode are initialised.
4. Add VFP register initialisation for when floating-point support is
enabled and the core is configured in DCLS topology. This
initialisation sequence is required for the same reason given in
the first issue.
5. Add provision for platform-specific initialisation on Cortex-R
using PLATFORM_SPECIFIC_INIT config and z_platform_init function.
6. Remove seemingly pointless and inadequately defined STACK_MARGIN.
Not only does it violate the 8-byte stack alignment rule, it does
not provide any form of real stack protection.
Signed-off-by: Stephanos Ioannidis <root@stephanos.io>