Commit Graph

53050 Commits

Author SHA1 Message Date
Jakub Rzeszutko 4a85ecacda shell: fix tab for dynamic commands
The tabulator handler creates a single structure if it is handling
dynamic commands. If the currently processed dynamic command has a
dynamic subcommand they both share the same structure.
As a result tabulation operation may result in undefined behaviour.

As a solution, a new structure was introduced to keep subcommand
information.

Fixes #35926.

Signed-off-by: Jakub Rzeszutko <jakub.rzeszutko@nordicsemi.no>
2021-06-04 12:23:15 -05:00
Anas Nashif 24bd45b287 pm: do not use deprecate Kconfig
CONFIG_DEVICE_POWER_MANAGEMENT is deprecated, use CONFIG_PM_DEVICE
instead.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-06-04 12:19:38 -05:00
Vinayak Kariappa Chettimada adae515d8d Bluetooth: controller: Fix conn setup regression
Fix incorrect and redundant use of ticker user id ULL_LOW
instead of ULL_HIGH when setting up a connection using a
mayfly to disable LLL context. Also, the LLL context pointer
is invalid, where node rx is passed instead of LLL context.

Use the ULL disabled callback when done event has not yet
been processed, or a direct connection setup in ULL_HIGH
context when ULL is already disabled (reference count is
zero) is sufficient.

Regression introduced in commit 30f260dfaa ("Bluetooth:
controller: Fix adv/scan context access post release").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
2021-06-04 12:13:34 -05:00
Øyvind Rønningstad c2efcc308c tfm: interface: Fix bug where FPU registers were not restored correctly
The caller saved registers were restored both as caller saved and
callee saved registers, i.e. register 0-15 were restored into
both register 0-15 and 15-31.

Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
2021-06-04 11:12:49 -05:00
Stancu Florin 8ebb641ef7 drivers: cc13xx_cc26xx: fix pm.h not included
Fixes #35916.

Signed-off-by: Stancu Florin <niflostancu@gmail.com>
2021-06-04 10:24:10 -05:00
Pieter De Gendt ad1a5058bb manifest: segger: zephyr kconfig options
Update segger module version to revision that re-introduces zephyr
Kconfig options

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-06-04 09:35:57 -05:00
Krzysztof Chruscinski f8e7ecfb56 shell: Add missing dependency to shell log backend
Shell log backend depends on logging being enabled. Lack of this
dependency leads to compilation failure when logging is disabled.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-06-04 08:20:21 -05:00
Gerard Marull-Paretas 45a6de6804 drivers: fix pm callback signature
For some reason a few drivers were not converted to the new device PM
callback signature. The reason may be because the device PM part is
compiled only when CONFIG_PM_DEVICE=y, a condition not enabled in CI by
default.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-06-04 08:16:49 -05:00
Christoph Steiger 6ce18c6e6a drivers: can: mcan: Fix DBTP sjw register writes
The data-sjw value was incorrectly written to the NBTP register when it
should be written to the DBTP register.

This fixes a regression introduced by
5e0ca9b41e.

Signed-off-by: Christoph Steiger <c.steiger@lemonage.de>
2021-06-04 08:12:12 -05:00
Joakim Andersson 95e359d658 Bluetooth: controller: Check length field of scan response data
Check the length field of the scan response data.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-06-04 12:51:27 +02:00
Maureen Helm e2068d10bc boards: arm: Clarify J-Link OpenSDA firmware usage for frdm_k64f
Updates the frdm_k64f board documentation to clarify that the J-Link
OpenSDA firmware version depends on the DAPLink bootloader version.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-04 11:30:35 +02:00
Anas Nashif 39354d92bb size_report: give root node a unique identifier
Call the root node 'root', otherwise we end up with two nodes with the
same identifier ':'.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-06-03 20:46:55 -05:00
Andy Ross 45bd3dee08 boards/x86/acrn: Use APIC_TSC_DEADLINE_TIMER
This board got forgotten when we migrated the older APIC_TIMER users.
Now the platform is SMP by default and the older driver refuses to
build.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-06-03 20:07:50 -05:00
Andy Ross 3da652f4cd boards/x86/acrn: Rework board documentation
ACRN build and configuration is non-trivially complicated, and so far
integration documentation has been mostly missing, and users have had
to get by via copying from existing integration efforts with minor
changes, leading to repeated mistakes and persistent confusion.  This
is an attempt to document the process from first principles, with an
eye toward informing integrators (not me!) who might come by later to
better automate things.  Some of the content is going to look remedial
to someone already familiar with e.g. ACRN configuration or EFI boot.

This simply replaces the pre-existing docs, which were for earlier
versions of ACRN where Zephyr was launched from the service OS instead
of the now-standard pre-launch VM mode.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-06-03 20:07:50 -05:00
Andy Ross c6f3887e84 boards/x86/acrn_ehl_crb: Enable SMP by default
SMP is working now, make a 2-cpu configuration default for this
device.

Note that this requires changes to the default ACRN build
configuration!  In hybrid.xml, you need to specify multiple physical
CPUs for the VM to uses, e.g.:

    <vm id="0">
        ...
        <cpu_affinity>
            <pcpu_id>0</pcpu_id>
            <pcpu_id>1</pcpu_id>
        </cpu_affinity>
    </vm>

Failing to build with this change will result in the system hanging at
boot trying to start up a CPU that won't run.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-06-03 20:07:50 -05:00
Andy Ross f479d5c7cc boards/x86/acrn: Add APIC IDs
The ACRN hypervisor uses 0, 2, 4, 6 as its local APIC IDs for
virtualized CPUs and not the 0, 1, 2, 3 defaults we have.

(I hate this feature, having to manually (!) probe and code these
things in C isn't scaling.  Zephyr needs to do the probing on its own
somehow, even if it's an offline tool in Linux or something.)

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-06-03 20:07:50 -05:00
Andy Ross 9cb8dcbf84 arch/x86_64: Use modern CR0 assembly
The 16 bit bootstrap code for SMP CPUs was using the 286-era "lmsw"
instruction (load machine status word) to set the protected bit in CR0
(which is the modern evolution of the same register), presumably
because this is 16 bit code and we can't move a dword into CR0.

But that's wrong, because the full instruction set *is* available in
real mode on a 386, you just have to use a operand size prefix to get
to it, which the assembler emits for you automatically when you use
the .code16 directive.

Write this conventionally and use modern (e.g. 1986-era) instructions.
It also has the advantage of not confusing much more modern
hypervisors like ACRN by issuing instructions they (and I!) never knew
existed.

Fixes #35076

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-06-03 20:07:50 -05:00
Andy Ross 5e9c583c24 arch/x86_64: Terrible, awful hackery to bootstrap entry
Because of a historical misunderstanding, by default the ACRN
hypervisor wants to load Zephyr at address 0x1000 and enter the binary
at that same address.  This entry point corresponds to the __start
symbol of the build they were given, which is a 1-cpu non-SMP
configuration.  Unfortunately, when we build with
CONFIG_MP_NUM_CPUS=1, the code in locore.S #if's out the 16 bit entry
point for the auxiliary CPUs at the start of the section.  So in the
build ACRN received, the start address happened to be 0x7000, the same
address we need to launch the AP processors from.

That's right: under ACRN, the SAME ADDRESS used to enter the OS in 32
bit mode needs to be used later to boot CPUs running in 16 bit real
mode!

The solution, such as it is, is to put a 32 bit jump at the entry
address which hops to the 32 bit OS entry code, and then scribble NOP
instructions over that jump once we get there so that the next time we
reach that address (in real mode) we fall through to the correct
entry.

This patch should be considered a temporary workaround.  While it
works on all x86 hardware, it's not really needed.  A much better
solution would be to eliminate the locore linker region entirely
(which causes other headaches) and enter the Zephyr binary in a 32 bit
address somewhere in the contiguous high memory area.  All that locore
is needed for is the 16 bit bootstrap code for SMP processors, which
is ~6 instructions and can be copied in from the kernel at runtime.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2021-06-03 20:07:50 -05:00
Jennifer Williams d6a3679c97 logging: log_msg.c: fix coding guideline 15.7 missing comment
The final else {} in the if...else if is missing required
comment (non-empty, ';' is not sufficient). This adds a comment
to comply with CG 15.7.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-06-03 20:07:16 -05:00
Jennifer Williams 09ee9d6e29 logging: log_core.c: fix coding guideline 15.7 missing comment
The final else {} in the if...else if is missing required
comment (non-empty, ';' is not sufficient). This adds a comment
to comply with CG 15.7.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-06-03 20:07:16 -05:00
Mahesh Mahadevan a02704bacf tests: i2s_speed: Increase the RX buffer count
The NXP I2S driver queues 2 receive buffers to avoid receive overflows.
Allocate an extra block so we do not see test failures due to allocate
failures

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-06-03 14:14:24 -05:00
Flavio Ceolin b06d084488 docs: pm: System power management diagram
Add a diagram for system power management.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2021-06-03 14:12:52 -05:00
Mahesh Mahadevan 6cfced8bab boards: rt600: Add information to connect an external debug probe
Update documentation to include information on how to connect
an external debug probe

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2021-06-03 14:12:23 -05:00
Kumar Gala af75587e39 doc/releases: v2.6.0: add resolved issues
Add list of all resolved issues since 2.5.0.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-03 12:15:21 -05:00
Maureen Helm 0aeb6788b6 doc: release: Add NXP-related changes to v2.6.0 release notes
Adds v2.6.0 release notes for NXP boards.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-03 10:09:35 -05:00
Maureen Helm 4f3a76a329 doc: release: Add sensor changes to v2.6.0 release notes
Fills in the sensor drivers section of the v2.6.0 release notes.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2021-06-03 10:09:35 -05:00
Gerard Marull-Paretas 1d43f2fdf6 boards: arm: 96b_aerocore2: fix table rendering
J1 header table was not rendered correctly.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-06-03 09:59:04 -05:00
Armando Visconti e879be1dbb drivers/sensor: lis2mdl: Fix temperature sample handling
The lis2mdl temperature samples work with a level of 25 Celsius.
When temperature goes below that level the samples become negative
and there was an issue in properly propagating the sign.

Fix #35910

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-06-03 09:44:31 -05:00
Hake Huang c9a7ce8937 nxp: rt series eth timer clock enable
enable ethernet timer clock when enabling ptp

Signed-off-by: Hake Huang <hake.huang@oss.nxp.com>
2021-06-03 09:38:45 -05:00
Armando Visconti 4e8c809d74 drivers/sensor: lps22hh: Fix the raw to kPa sample conversion
The lps22hh 24 bit raw sample is left aligned, which means that
it needs to be right-shifted by 8 before applying conversion.
Moreover the conversion has been simplified for clarity.

Fix #35871

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-06-03 09:30:42 -05:00
Johann Fischer 92afba6278 doc: release-notes-2.6: add release notes for USB
Add release notes for USB.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-06-03 08:43:06 -05:00
Johann Fischer d7707b482c doc: release-notes-2.6: add release notes for disk drivers
Add release notes for disk drivers.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
2021-06-03 08:43:06 -05:00
Torsten Rasmussen 86c92869d2 cmake: warn the user if a Zephyr library is created in app-mode
Fixes: #19582

When `find_package(Zephyr)` completes then all boilerplate code has been
processed and all Zephyr libraries has been placed inside the
whole archive flags.

Also all libs dependencies has been processed.

This is indicated by the presence of the zephyr_prebuilt target.

Thus, warn the user if `zephyr_library()` / `zephyr_library_named()`
is called in app-mode.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2021-06-03 08:34:19 -05:00
Torbjörn Leksell 70d721c1bb Tracing: Incorrect Unlock Mutex Trace Hook Fix
Changed location of the last k_mutex_unlock trace hook since it was
being called after k_sched_unlock, which could result in tracing
scenarios (other thread waiting for lock) where it appeared that a
mutex was being locked again before becoming unlocked.

Signed-off-by: Torbjörn Leksell <torbjorn.leksell@percepio.com>
2021-06-03 07:10:05 -05:00
Carles Cufi cb8c90e62b doc: gs: Clearly state the main dependencies min version
Introduce a table with the minimum version required for the three main
dependencies (CMake, Python and DTC). At the same time remove the CMake
help code from the GSG, since it's just a duplicate of the instructions
that Kitware provides.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Co-authored-by: Ruth Fuchss <ruth.fuchss@nordicsemi.no>
2021-06-03 13:40:14 +02:00
Carles Cufi 3260ed187f doc: intro: Add a reference to ARMv8-R
Specify that 64-bit Cortex-R, ARMv8-R, is now supported in Zephyr.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2021-06-03 13:40:14 +02:00
Joakim Andersson 4dd49ac746 Bluetooth: host: Fix CCC store on write for multiple connections
Fix CCC store on write feature for multiple connections. CCCs are only
enqueued for storing when going from no connections subscribed to any
connection subscribed.
The CCC should be stored when its value is changed for the specific
connection.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-06-03 11:36:22 +02:00
Erwan Gouriou 366a64cb1e samples/boards/stm32: PM Blinky: Rework README
Rework README to provide a correct and understandable status.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-06-02 16:50:02 -05:00
Kumar Gala 733eaa29b9 doc/releases: v2.6.0: Updates
* Removed ARCH POSIX, driver/pinmux, updatehub, settings, random, POSIX
  subsystem, and LGVL sections as no significant changes this release
* Add new drivers for eeprom, timer and watchdog sections
* Added bullet item about shared interrupt support being devicetree
  based
* Added bullet about moving of CMSIS portability headers

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-02 16:46:22 -05:00
Gerard Marull-Paretas 328e842043 doc: scripts: gen_devicetree_rest: add workaround for page width
Since Zephyr docs switched to fixed-width, the binding pages are not
displayed correctly. We should move to another data representation
format that works better for fixed-width documents. Until this decision
is made, add a workaround that forces the template to expand page width
to the maximum on binding pages.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2021-06-02 12:13:13 -05:00
Robert Lubos f6119965e2 samples: net: sockets: big_http_download: Update certificate
The Let's Encrypt X3 certificate is no longer in use, replace it with an
up-to-date certificate.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2021-06-02 10:36:33 -05:00
Armando Visconti 282a644b0e drivers/sensor: lis2dh: use gpio_dt_spec oriented macros
Use gpio_dt_spec structure and related macros for both drdy
and AnyMotion interrupts, to have a more compat, readable and
safe code. Moreover, skip setting DRDY or AnyMotion trigger
from application if the corresponding irq-gpios has not been set.

(This commit also fixes #34794)

Signed-off-by: Armando Visconti <armando.visconti@st.com>
2021-06-02 08:51:14 -05:00
Stephanos Ioannidis 79788137cf tests: net: getaddrinfo: Increase newlib heap size
This commit increases the newlib heap size to 2048, which is the
recommended minimum required to ensure proper operation of the newlib
nano used by test (see #35799).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-02 08:50:45 -05:00
Stephanos Ioannidis c1849d10c3 tests: mem_alloc: Increase heap size for newlib nano test
This commit increases the heap size for the newlib nano test to 2048,
which is the recommended minimum required to ensure proper operation
(see #35799).

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-02 08:50:45 -05:00
Stephanos Ioannidis 182417f32f lib: newlib: Add minimum required heap size config
This commit adds a new `CONFIG_NEWLIB_MIN_REQUIRED_HEAP_SIZE` config
that allows user to specify the minimum required heap size for the
newlib heap, and makes `malloc_prepare` validate that the memory space
available for the newlib heap is greater than this value.

The default minimum required heap size values were empiricially
determined, so as to allow the basic standard C functions such as
`printf` and `scanf` to work properly.

Signed-off-by: Stephanos Ioannidis <root@stephanos.io>
2021-06-02 08:50:45 -05:00
Dominik Ermel ed4072838b doc/releases: v2.6.0: Update to MCUmgr and Shell section
Short update to list of changes to MCUmgr that impact Zephyr.
Note to Shell on changes that affect mcumgr.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-06-02 08:50:11 -05:00
Jennifer Williams 7e6e05c5e4 tests: posix: common: clock: exclude ehl_crb from test posix realtime
The ehl_crb board has hardware issue that prevents this test from
being able to pass this otherwise-correct test. So exclude ehl_crb
from the testcase.yaml.

Fixes #33544.

Signed-off-by: Jennifer Williams <jennifer.m.williams@intel.com>
2021-06-02 08:49:45 -05:00
Aymeric Aillet d8cf5fa9d5 boards: doc: Update H3ULCB documentation
Update documentation for H3ULCB board following the
addition of new features during v2.6 windows.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
2021-06-02 08:38:10 -05:00
Christian Taedcke d88ee23f96 doc: colibri board: Add missing empty lines
Two code-blocks were not correctly rendered, due to missing
empty lines before them. This commit fixes this.

Signed-off-by: Christian Taedcke <christian.taedcke@lemonbeat.com>
2021-06-02 08:15:25 -05:00
Kumar Gala e35e7e1d59 doc/releases: v2.6.0: Updates and cleanups
* Add high level bullets about tracing & power mgmt
* Removed duplicated bluetooth section
* Remvoed RISC-V section, to changes of note for this release

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2021-06-02 08:15:02 -05:00