Commit graph

52324 commits

Author SHA1 Message Date
Andrés Manelli
53d00dc29f logging: Enable SWO pin for STM32 SoCs
Set TRACE_MODE to asynchronous and enable trace output pin.
Add soc_config.c in stm32 soc direcotry.

Fixes #34342

Signed-off-by: Andrés Manelli <am@toroid.io>
2021-05-11 13:02:50 -05:00
Affrin Pinhero
0129884062 drivers/spi: STM32: This solves SPI infinite loop on Tranceive
This commit loops on rx not empty only if rx_buf is enabled.
And if rx_buf is not enabled, it loops on tx empty status.

Signed-off-by: Affrin Pinhero <affrin.pinhero@hcl.com>
2021-05-11 13:01:57 -05:00
Tomasz Chyrowicz
13303c4351 drivers: serial: nrf uarte: Fix for the RX byte counter
In case of the following sequence of UART events:
 - UART_ENDRX
 - UART_RXRDY
 - TIMER_RXTIMEOUT

The application receives one more byte that was received,
due to RX counter alignment upon ENDRX event.

The proposed fix moves the RX byte counter alignment to the
RX timeout event handler.

Signed-off-by: Tomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
2021-05-11 13:01:29 -05:00
Andrzej Głąbek
797aa8b85a soc: nrf9160: Remove incorrect indication of SWO availability
Serial Wire Output functionality is not implemented in nRF9160.

Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
2021-05-11 13:00:20 -05:00
Torsten Rasmussen
2656e6a682 kconfig: TraceRecorder Kconfig file for undefined symbols
Follow-up: #34843

This commit is a followup to PR #34843.
The Zephyr subsys/tracing/Kconfig file has a
`depends on ZEPHYR_TRACERECORDER_MODULE` but that symbol is only
available when the module is part of the manifest.

This commit adds the second part of the comment:
https://
github.com/zephyrproject-rtos/zephyr/pull/34843#discussion_r628154265

To ensure all Kconfig symbols are defined.

Without this commit, users without TraceRecorder will see following
checkpatch error:
```
ERROR   : Test KconfigBasic failed: Undefined Kconfig symbols:

warning: undefined symbol ZEPHYR_TRACERECORDER_MODULE:

- Referenced at subsys/tracing/Kconfig:35:

config PERCEPIO_TRACERECORDER
        bool "Percepio Tracealyzer support"
        select THREAD_NAME
        select INIT_STACKS
        select THREAD_MONITOR
        depends on ZEPHYR_TRACERECORDER_MODULE && <choice>
```

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-05-11 13:00:05 -05:00
Mahesh Mahadevan
053467f69e doc: Update MXRT685 documentation
Add a troubleshooting section in case the platform
does not connect to the debug probe

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-05-11 12:59:44 -05:00
Siddharth Chandrasekaran
491fb7aa32 CODEOWNERS, MAINTAINERS.yml: Update github username
GitHub username @cbsiddharth was changed to @sidcha. Update CODEOWNERS
and MAINTAINERS.yml entries.

Signed-off-by: Siddharth Chandrasekaran <siddharth@embedjournal.com>
2021-05-11 12:59:25 -05:00
Anas Nashif
cc0cb3d0f9 doc: clock: link macros and struct to doxygen
link some function, macros and structs to doxygen docs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-11 12:59:15 -05:00
Anas Nashif
7c582f4b7c tracing: systemview: rework IDs and make them match APIs
New version of Systemview has Zephyr API description that did not match
what we had, align with what the tools provides and expand hooks to
support additional APIs. We now cover most kernel APIs.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-11 12:59:03 -05:00
Anas Nashif
72c830c3ee tracing: test format: print more details
Print timeouts and other details.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-11 12:59:03 -05:00
Anas Nashif
fe14c23852 tracing: move test format into its own directory
Minor cleanup keep format location uniform.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-11 12:59:03 -05:00
Ioannis Glaropoulos
410b895411 mbedtls: minor update, to fix the README file
Minor update to the mbedtls module repo, to
get the fix for the README file.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
2021-05-11 12:58:49 -05:00
Kumar Gala
581069942c samples: sensor: max17262: Fix NULL pointer dereference
If we don't get a dev pointer from device_get_binding() we should
not dereference it.  Just drop the name from the printk message
as in the future this is likely to use DEVICE_DT_GET().

Fixes #35112

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-11 10:47:39 -05:00
Hake Huang
53b8706f05 adc_emul: case can not run on native_posix board
we meet hardfault when run on real board.
as the device is a virtual device

I: adc init done

*** Booting Zephyr OS build zephyr-v2.5.0-3761-g730acbd6ed85  ***

Running test suite adc_basic_test

===================================================================

START - test_adc_emul_single_value

E: ***** BUS FAULT *****

E:   Precise data bus error

E:   BFAR Address: 0x20002d00

E:   NXP MPU error, port 3

E:     Mode: User, Data Address: 0x20002d00

E:     Type: Read, Master: 0, Regions: 0x8100

E: r0/a1:  0x20002cfc  r1/a2:  0x00000000  r2/a3:  0x000005dc

E: r3/a4:  0x00000040 r12/ip:  0x0000c67d r14/lr:  0x00001319

E:  xpsr:  0x41000000

E: Faulting instruction address (r15/pc): 0x000045c6

E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0

E: Current thread: 0x200000e0 (unknown)

E: Halting system

Fixes #35027

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-05-11 09:23:03 -05:00
Erwan Gouriou
77a751ecf9 tests/kernel/common: Fix test test_nop for ARMV7_M_ARMV8_M_MAINLINE
Treat ARMV7_M_ARMV8_M_MAINLINE similarly to ARMV6_M_ARMV8_M_BASELINE
and add arch_nop() calls to test_nop function.
Additionally add one arch_nop() call to fit comment and update
comments when required on other archs.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-05-11 07:15:17 -05:00
Fredrik Gihl
7e385d7d04 fs: logstr_dup causes error in LOG_ERROR messages
Using %s, without logstr_dup causes error when
CONFIG_LOG_DETECT_MISSED_STRDUP is enable.
Removing %s argument. LOG_FUNC_NAME_PREFIX_ERR can be used if prefix
is wanted.

Signed-off-by: Fredrik Gihl <fredrik.gihl@flir.se>
2021-05-11 07:14:24 -05:00
Ievgenii Meshcheriakov
c610a07735 samples: peripheral_ht: remove configurations for nrf5x boards
The required configuration is already selected by the Kconfig file for
all nrf devices that support TEMP peripheral.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2021-05-11 14:44:18 +03:00
Ievgenii Meshcheriakov
49300770f8 samples: peripheral_ht: use HAS_HW_NRF_TEMP to detect TEMP sensor presence
The TEMP sensor is not present in configurations like
nrf5340dk_nrf5340_cpuappns.

Signed-off-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@nordicsemi.no>
2021-05-11 14:44:18 +03:00
Jennifer Williams
6ca36a7813 boards: acrn_ehl_crb_defconfig: remove unused configs
The board moved to using APIC TSC Deadline Timer driver, which
removes the need for these configurations associated with
the older Apic timer driver (CONFIG_APIC_TIMER).

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-05-11 06:36:14 -05:00
Lukasz Maciejonczyk
977aba6d02 net: openthread: Fix multiple Kconfig enablers for Link Metrics
Remove duplicated enabler for Link Metrics feature.

Signed-off-by: Lukasz Maciejonczyk <lukasz.maciejonczyk@nordicsemi.no>
2021-05-11 09:53:29 +03:00
Robert Lubos
eaeac46720 net: openthread: Fix OT shell crash
After the recent OpenThread upmerge, OpenThread changed its behaviour in
terms of CLI handling during commissioning procedure. OpenThread will
now call the registered CLI callback when it recieves the Discovery
message.

This resulted in a crash if no CLI command was executed by the user
before, because the `shell_p` pointer was only set in the command
handler. As it was not set to the actual shell backend instance, it
caused a crash (or assert if enabled) in the `shell_vfprintf()`
function.

Fix this by verifying the `shell_p` pointer in the
`otConsoleOutputCallback()` function before use. Additionally, set the
pointer to the most common UART shell backed (if enabled) in the
initialization function so that the initial messages from OpenThread are
not dropped.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-05-11 09:53:12 +03:00
Jukka Rissanen
29e023d4e0 net: shell: Fix crash when invoking dns command in shell
This fixes a crash when typing "net dns" command in net-shell

Fixes #35041

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-05-11 09:52:10 +03:00
Jukka Rissanen
6485e7d07f net: if: Do not check IPv4 multicast addr when selecting src addr
When destination address is a multicast address, select the source
address from non link local address first.

This means that for example if we are responding to mDNS query,
and we have both normal IPv4 and LL (169.254.x.y) address set for
the interface, we are now able to select the normal address instead
of the LL one.

Fixes #34409

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
2021-05-11 09:51:31 +03:00
Daniel Leung
660d1478c6 kernel: init.c: tag source for boot/pinned sections
This adds the tags for functions and variables so they
can be put into boot/pinned sections.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
735fad2d1e boards: qemu_x86_virt: enable using boot and pinned sections
This enables the kconfig options so that the board would be
using boot and pinned linker sections.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
2c2d313cb9 x86: ia32: mark symbols for boot and pinned regions
This marks code and data within x86/ia32 so they are going to
reside in boot and pinned regions. This is a step to enable
demand paging for whole kernel.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
84a6a292c0 timer: hpet: mark functions as boot/pinned/isr
This marks the data and functions into appropriate
linker sections.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
1ad7349d17 intc: ioapic: mark data and functions as boot/pinned
This marks the data and functions into appropriate
linker sections.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
e4987484de intc: loapic: mark data and functions as boot/pinned
This marks the data and functions into appropriate
linker sections.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
08d6386f3c intc: system_apic: mark functions as boot/pinned
This marks the functions into appropriate linker sections.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
fb6a929f97 x86: ia32: put IRQ stubs into pinned linker section if needed
This changes the ARCH_IRQ_CONNECT() to put the IRQ stubs into
pinned linker section if needed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
af20208cd9 devices: mark device MMIO declarations to boot/pinned sections
This adds to the macros for device MMIO declaration so they can
be put into  boot or pinned linker sections as needed.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
0a45691aeb tests: x86/pagetables: update test for boot and pinned sections
This updates the test to account for boot and pinned sections.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
512cb905d1 x86: ia32/linker: add boot and pinned sections
This adds both boot and pinned sections to the linker
script for ia32. This is required for enabling demand
paging for kernel and data.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
45d1fc9cc2 x86: gen_mmu: add support for boot and pinned regions
Both boot and pinned regions need to be mapped and permissions
set correctly.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
7b2861276b linker: add __isr tag
This allows interrupt service routine to be declared with
the __isr tag so they can be placed in the correct linker
section. The first would be putting them into the pinned
section.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
1310ad6b0e linker: add bits for pinned regions
This adds the necessary bits for linker scripts and source code
to specify which symbols need to be pinned in memory. This is
needed for demand paging as some functions and data must reside
in memory all the time and cannot be paged out (e.g. paging,
scheduler, and interrupt routines for functionality).

This is up to the arch/SoC/board to define the sections in
their linker scripts as the pinned section may need special
alignment which cannot be done in common script snippets.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
d812728ec4 linker: add bits for boot regions
This adds the necessary bits for linker scripts and source code
to specify which symbols are needed for boot process so they
can be grouped together.

One use of this is to group boot related code and data so these
won't interval with other kernel and application for better
caching.

This is a must for demand paging as some functions and data
must be available during the boot process and before the memory
manager is initialized. During this time, paging cannot be used
so symbols linked in virtual memory space are unavailable.

This is up to the arch/SoC/board to define the sections in
their linker scripts as section may need special alignment
which cannot be done in common script snippets.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
af49ec0277 linker: remove TEXT_START macro
There is exactly one function being defined with TEXT_START
macro so the x86-32 __start can appear at the beginning of
text section. Since no one else is using it, better remove
TEXT_START to simplify things.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
8c1179e548 kernel: refactor stack declaration macros
These macros are identical except the specified linker region.
So refactor them.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
e6dc91466c toolchain: gcc: fix extra space when using SECTION_VAR
The generic version of SECTION_VAR() is adding an extra space
during expansion before second argument (e.g.
SECTION_VAR(section, variable) => ".section. variable"
instead of ".section.variable") which would result in build
error. So remove the "##" in macro to fix this, and now it
will also behave the same as SECTION_FUNC().

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Daniel Leung
8297eafc60 toolchain: add Z_GENERIC_DOT_SECTION() macro
This is similar to Z_GENERIC_SECTION() but the resulting
section name has a period as prefix. This eases the need
to create a section name macro for both assembly and C.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2021-05-10 16:00:43 -05:00
Kumar Gala
4ee61309b1 drivers: gpio: Fix when psoc6 gpio driver is built
Add check to see that the GPIO devicetree node is actually enabled
before we build the PSoC6 GPIO driver.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-10 13:47:11 -05:00
Szymon Janc
aeb767ffc6 testsuite: ztest: Add missing syscalls/log_msg2.h stub
This stub is needed when unit testing code that includes log_msg.h or
log_msg2.h.

Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
2021-05-10 13:17:44 -05:00
Kumar Gala
92275cfa60 twister: Add ICCM/DCCM to list of overflow regions
On ARC some platforms utilize ICCM/DCCM for their "flash" and "ram"
storage.  So we might get errors about overflowing one of these regions.
So treat them similar to how we treat FLASH and SRAM.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-10 13:16:05 -05:00
Kumar Gala
706de953ab drivers: serial: uart_miv: Fix build errors
If we try and build the MiV uart driver with interrupt support enabled
we get some errors related to code that hasn't been updated.  Fix the
compile errors and add SERIAL_SUPPORT_INTERRUPT to the Kconfig to
hopefully catch these issues in the future

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-05-10 13:15:50 -05:00
Vinayak Kariappa Chettimada
30f260dfaa Bluetooth: controller: Fix adv/scan context access post release
Fix advertiser and scanning context being accessed on done
event when connection complete node rx that is processed
earlier has release them.

Relates to #30735.
Fixes #35013.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-05-10 18:19:00 +02:00
Laczen JMS
5e9d6d638c nvs: fix possibility of losing data
Fix the possibility of losing data after startup as a result of a badly
erased sector.

Fixes #34722.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2021-05-10 05:31:36 -05:00
Aurelien Jarno
c387a0dd57 net: tcp: select MBEDTLS_MAC_MD5_ENABLED for ISN algorithm
The ISN algorithm from RFC 6528 doesn't need Mbed TLS, but rather the
MD5 algorithm from Mbed TLS. Therefore select MBEDTLS_MD and
MBEDTLS_MAC_MD5_ENABLED in addition to MBEDTLS.

This fixes the following build failure when using TLS version 1.2 is
selected:
  zephyr/subsys/net/ip/tcp2.c:1329: undefined reference to
  `mbedtls_md5_ret'

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2021-05-10 05:30:03 -05:00
Aurelien Jarno
c30339aa16 net: openthread: Select ECDSA when SRP is enabled
SRP client and server require ECDSA to be enabled otherwise the build
fails. Select OPENTHREAD_ECDSA for both OPENTHREAD_SRP_CLIENT and
OPENTHREAD_SRP_SERVER options.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
2021-05-10 05:29:19 -05:00