Commit Graph

45 Commits

Author SHA1 Message Date
Caspar Friedrich b011c45b58 segger: config: Add CCM option for linker sections
Some CPUs have Core Coupled Memory (CCM) instead DTCM.

Signed-off-by: Caspar Friedrich <c.s.w.friedrich@gmail.com>
2024-03-30 21:20:45 +01:00
Florian Grandel 9d01912859 segger: config: RTT spinlock implementation
RTT locking is now implemented with spinlocks:
* The prior implementation did not support RTT logging and tracing from
  ISR context.
* Mutexes caused infinite loops when tracing.
* Spinlocks are more lightweight than mutexes, especially on non-SMP
  systems.

Fixes: #61133

Signed-off-by: Florian Grandel <fgrandel@code-for-humans.de>
2023-08-04 12:55:42 +02:00
Sigvart Hovland 5792675a24 segger: update to 3.40
Update to 3.40 of SystemView Target sources.

Signed-off-by: Sigvart Hovland <sigvart.hovland@nordicsemi.no>
2023-05-19 13:31:55 +02:00
Henrik Brix Andersen 4bfaf28a11 zephyr: use external Kconfig
Use external Kconfig files for the Segger module.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2023-04-17 16:29:56 +09:00
Piotr Jasiński e2ff220055 Add Segger debug monitor implementation
Signed-off-by: Piotr Jasiński <piotr.jasinski@nordicsemi.no>
2022-12-14 15:11:57 +01:00
Coenen Christoph d4e568a920 Resolve circular include dependencies
Zephyr kernel is dependend on trace.
Trace is dependend on segger rtt.
Segger rtt MUST NOT be dependend on zephyr kernel.

Move lock functions from header into c file to avoid circular
dependency.

Fixes #43887.

Signed-off-by: Christoph Coenen <ccoenen@baumer.com>
2022-08-01 17:20:11 +02:00
Fabio Baltieri 2799f8e10a include: add "zephyr/" include prefix
Add relevant "zephyr/" prefixes to allow building with
LEGACY_INCLUDE_PATH=n.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2022-07-26 16:10:57 +02:00
Pieter De Gendt 3a52ab2221 config: Use zephyr provided options
Re-introduced the zephyr Kconfig options which were removed in PR #6

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2021-06-04 07:47:00 -05:00
Krzysztof Chruscinski 7cbc8446db config: Add lock/unlock macro for no multithreading
Added version of SEGGER_RTT_LOCK/UNLOCK when multithreading is off.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
2021-05-27 10:42:28 +02:00
Anas Nashif 7d78f7121d zephyr: use customer locking based on Kconfig
Make overriding default locking configurable. The mutex being used here
is interferring with trace tools and generating assertions in some trace
hooks.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-21 10:54:32 -04:00
Anas Nashif 2aa031c081 rtt: define LOCK/UNLOCK for Zephyr
Use a mutex for locking to make it work with other Zephyr subsystems.
Originally added in 6432202678

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-04 13:40:53 -04:00
Anas Nashif b60d6e14b6 segger: update to 3.30
Update to 3.30 and move zephyr related files to the Zephyr tree.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-05-04 13:40:53 -04:00
Maureen Helm 38c79a447e rtt: systemview: Add linker section options
Enables optionally placing Segger RTT and SystemView data in the DTCM
linker section instead of the default data section. This is needed on
SoCs in the i.MX RT series that use cacheable external SDRAM to store
data.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
2020-11-13 09:58:17 +01:00
Tomasz Bursztyka 874d9e9696 rtt: Device instance are all constant now
Switching device parameter to constant.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:43:23 +02:00
Mattia Fiumara f5226b01cb debug: SystemView post-mortem feature
This change adds a KConfig option for post-mortem debugging.

Signed-off-by: Mattia Fiumara <mattia.fiumara@bgrid.com>
2020-08-26 08:09:54 -04:00
Henrik Brix Andersen 6fcf61606d ext: segger: update to SystemView v2.52h
Update the external Segger RTT and SystemView libraries to version
2.52h.

This fixes #14082.

Signed-off-by: Henrik Brix Andersen <henrik@brixandersen.dk>
2019-05-27 16:29:47 -04:00
Anas Nashif 5293ffba61 zephyr: add zephyr module file
Make this repo a zephyr module.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-05-23 12:44:12 -07:00
Gustavo F Nobrega 0b83aff922 doc: ext: segger: Update link to SystemView
The current link is broken. The correct link to systemview is:
https://www.segger.com/products/development-tools/systemview/

Signed-off-by: Gustavo F Nobrega <gustavofn@gmail.com>
2019-01-29 12:50:55 -05:00
Marek Pieta 4827d46d90 debug: SystemView fix
Change fixes problem with mutexes and initialization for SystemView,
adds config options to:
- choose if SystemView should start logging events on system start
- select SystemView RTT buffer size

Signed-off-by: Marek Pieta <Marek.Pieta@nordicsemi.no>
2019-01-25 17:37:51 -05:00
Anas Nashif e416092d8d debug: move segger configs to subsys/debug
We have dependency on this module in code which is part of Zephyr. When
this module is split out of the tree we need to be able to build. Move
this Kconfig part to be part of zephyr and keep the external code in
ext/ with plan to split it out on the future.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-01-22 07:45:22 -05:00
Pawel Dunaj 421a44f5df ext: debug: segger: Fix SEGGER header inclusion
Fix issue caused by 3fc497ac9af7119e0e56d4b7fe2e47d6ae12cd8a

This change removes `rtt` and `systemview` from header includes
as these are already placed in the path.

Also `SEGGER_SYSVIEW_ConfDefaults.h` header included from
`SEGGER_SYSVIEW_Int.h` is placed higher to make sure `INLINE`
definition is properly visible.

Signed-off-by: Pawel Dunaj <pawel.dunaj@nordicsemi.no>
2018-12-05 14:35:42 +01:00
Sigvart M. Hovland f72b474643 ext: debug: segger: Add missing include directories
Fix #11812 by adding include paths to the `CMakeLists.txt`

Signed-off-by: Sigvart M. Hovland <sigvart.hovland@nordicsemi.no>
2018-12-04 13:46:27 +01:00
Håkon Øye Amundsen 76090cebcd ext: segger: Use system include directive for configuration header.
By using system include directive, we allow
the user to place external SEGGER_RTT_conf.h files to the
include path in order to override the zephyr version.

Signed-off-by: Håkon Øye Amundsen <haakon.amundsen@nordicsemi.no>
2018-12-04 13:45:49 +01:00
Pavel Kral a1d6344c3c drivers: rtt: fix no return statement in rtt_init
Add missing return statement to rtt_init function.

Signed-off-by: Pavel Kral <pavel.kral@omsquare.com>
2018-11-06 11:47:15 +01:00
Pavel Kral 87b0641428 logger: console: init rtt only once
As RTT is used by more subsystem in Zephyr, initialization is moved
from RTT console and RTT logger backend to common kernel init phase.

Signed-off-by: Pavel Kral <pavel.kral@omsquare.com>
2018-10-31 12:47:53 +01:00
Pavel Kral 870a305548 logger: fix PR codestyle issues
Fix some issues as complained by shippable.

Signed-off-by: Pavel Kral <pavel.kral@omsquare.com>
2018-10-31 12:47:53 +01:00
David Kinder bf296b49a2 ext: debug: segger: Fix grammar in Kconfig
Fix grammar in ext/debug/segger/Kconfig

Signed-off-by: David Kinder <david.b.kinder@intel.com>
Signed-off-by: Pavel Kral <pavel.kral@omsquare.com>
2018-10-31 12:47:53 +01:00
Pavel Kral 82d229a17d ext: debug: segger: Add USE_SEGGER_RTT that enables RTT libraries.
This option allows to explicitly include Segger RTT libraries and
enables use of it for various subsystems. It is disabled by
default as it consumes more RAM.

Signed-off-by: Pavel Kral <pavel.kral@omsquare.com>
2018-10-31 12:47:53 +01:00
Pavel Kral 6432202678 ext: debug: segger: Terminal sharing using SEGGER_RTT_LOCK/UNLOCK macros
This commit allows to share default RTT (terminal) buffer with various
Zephyr subsystems.

Signed-off-by: Pavel Kral <pavel.kral@omsquare.com>
2018-10-31 12:47:53 +01:00
Pavel Kral 4ab9ef38a6 logger: Add a Segger RTT backend
Add logger backend that uses Segger RTT for message output. Several
options are provided allowing configuration of up-buffer and logger
behaviour.

Signed-off-by: Pavel Kral <pavel.kral@omsquare.com>
2018-10-31 12:47:53 +01:00
Sigvart M. Hovland 065cf429f3 ext: debug: segger: Add missing # for else in SEGGER config header
This commit fixes issue #10685

Signed-off-by: Sigvart M. Hovland <sigvart.hovland@nordicsemi.no>
2018-10-30 06:00:20 -05:00
Anas Nashif 18a0822cdd systemview: add support natively using tracing hooks
Add needed hooks as a subsystem that can be enabled in any application.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-08-21 05:45:47 -07:00
Ulf Magnusson 4ef1777cb8 Kconfig: Use a short, consistent style for prompts
Consistently use

    config FOO
            bool/int/hex/string "Prompt text"

instead of

    config FOO
            bool/int/hex/string
            prompt "Prompt text"

(...and a bunch of other variations that e.g. swapped the order of the
type and the 'prompt', or put other properties between them).

The shorthand is fully equivalent to using 'prompt'. It saves lines and
avoids tricking people into thinking there is some semantic difference.

Most of the grunt work was done by a modified version of
https://unix.stackexchange.com/questions/26284/
how-can-i-use-sed-to-replace-a-multi-line-string/26290#26290, but some
of the rarer variations had to be converted manually.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-15 04:10:10 -07:00
Ulf Magnusson d42e1309db Kconfig: Use the first default with a satisfied condition
Up until now, Zephyr has patched Kconfig to use the last 'default' with
a satisfied condition, instead of the first one. I'm not sure why the
patch was added (it predates Kconfiglib), but I suspect it's related to
Kconfig.defconfig files.

There are at least three problems with the patch:

  1. It's inconsistent with how Kconfig works in other projects, which
     might confuse newcomers.

  2. Due to oversights, earlier 'range' properties are still preferred,
     as well as earlier 'default' properties on choices.

     In addition to being inconsistent, this makes it impossible to
     override 'range' properties and choice 'default' properties if the
     base definition of the symbol/choice already has 'range'/'default'
     properties.

     I've seen errors caused by the inconsistency, and I suspect there
     are more.

  3. A fork of Kconfiglib that adds the patch needs to be maintained.

Get rid of the patch and go back to standard Kconfig behavior, as
follows:

  1. Include the Kconfig.defconfig files first instead of last in
     Kconfig.zephyr.

  2. Include boards/Kconfig and arch/<arch>/Kconfig first instead of
     last in arch/Kconfig.

  3. Include arch/<arch>/soc/*/Kconfig first instead of last in
     arch/<arch>/Kconfig.

  4. Swap a few other 'source's to preserve behavior for some scattered
     symbols with multiple definitions.

     Swap 'source's in some no-op cases too, where it might match the
     intent.

  5. Reverse the defaults on symbol definitions that have more than one
     default.

     Skip defaults that are mutually exclusive, e.g. where each default
     has an 'if <some board>' condition. They are already safe.

  6. Remove the prefer-later-defaults patch from Kconfiglib.

Testing was done with a Python script that lists all Kconfig
symbols/choices with multiple defaults, along with a whitelist of fixed
symbols. The script also verifies that there are no "unreachable"
defaults hidden by defaults without conditions

As an additional test, zephyr/.config was generated before and after the
change for several samples and checked to be identical (after sorting).

This commit includes some default-related cleanups as well:

  - Simplify some symbol definitions, e.g. where a default has 'if FOO'
    when the symbol already has 'depends on FOO'.

  - Remove some redundant 'default ""' for string symbols. This is the
    implicit default.

Piggyback fixes for swapped ranges on BT_L2CAP_RX_MTU and
BT_L2CAP_TX_MTU (caused by confusing inconsistency).

Piggyback some fixes for style nits too, e.g. unindented help texts.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-08-10 12:38:28 -07:00
Piotr Zięcik 71df58741c ext: debug: segger: Fix CONFIG_SEGGER_RTT_MODE generation.
The value of CONFIG_SEGGER_RTT_MODE was incorrectly generated
as last default entry overwritten the previous ones. This commit
fixes this problem and ensures that correct value is selected.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
2018-07-06 10:08:07 +02:00
Krzysztof Chruściński bbcb426690 ext: debug: segger: Updating Segger RTT to 6.32d
Segger RTT update includes alignment of SEGGER_RTT_Conf.h to use
KConfig configuration.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2018-06-28 09:36:58 -05:00
Krzysztof Chruściński 26eef9278a ext: debug: segger: Move RTT configuration to KConfig
Extended KConfig to be able to control configuration present in
SEGGER_RTT_Conf.h file.

Signed-off-by: Krzysztof Chruściński <krzysztof.chruscinski@nordicsemi.no>
2018-06-28 09:36:58 -05:00
Ulf Magnusson d8b041971e ext: Kconfig: Remove redundant 'default n' properties
Bool symbols implicitly default to 'n'.

A 'default n' could make sense e.g. in a Kconfig.defconfig file, if you
wanted to override a 'default y' on the base definition of the symbol,
but it doesn't seem to be used like that on any of these symbols.

Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
2018-06-18 15:26:38 -04:00
Anas Nashif f3400eb9ec debug: fix RTT console Kconfig
Use HAS_ Kconfig option as intended, those are invisible option that
signify support of a certain feature that can be selected by a hardware
or platform.

For RTT and system view this was not dont in an inconsistent way.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2018-03-19 15:37:26 -04:00
Sebastian Bøe c5e62eb72a kbuild: Removed KBuild
Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
Sebastian Bøe 695e3b5384 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00
David B. Kinder 578712c1a2 doc: fix uses of back quotes in documentation
ReST defines interpreted text roles where text enclosed by single quotes
can be "intrepreted", for example :ref:`some name` becomes a link to
a label anywhere in the doc set named "some name", :c:func:`funcname()`
becomes a link to the API documentation for "funcname", and
:option:`CONFIG_NAME` becomes a link to, in our case, the documentation
for the generated Kconfig option.

This patch fixes uses of `some name` (without a role) by either adding
an explicit role, or changing to ``some name``, which indicates inline
code block formatting (most likely what was intended).

This is a precursor to changing the default behavior of interpreted
text to treat `some name` as :any:`some name` (as configured in
doc/conf.py), which would attempt to create a link to any available
definition of "some name".

We may not change this default role behavior, but it becomes an option
after the fixes in this patch.  In any case, this patch fixes incorrect
uses of single-quoted text (possibly introduced because GitHub's
markdown language uses single-quoted text for inline code formatting).

Jira: ZEP-2414

Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
2017-08-03 11:08:23 -04:00
Leandro Pereira a488946dcc debug: Add SEGGER SystemView libraries
These libraries allow publishing information to enable system profiling
when using the SEGGER SystemView tool.  This tool provides a way to record
and visualize events such as threads scheduling, interrupts, and can help
find unintended interactions and resource conflicts.  More information can
be obtained from SEGGER website at [1], including downloads for major
platforms.

[1] https://www.segger.com/systemview.html?p=1731

Jira: ZEP-1463
Origin: https://www.segger.com/systemview.html?p=1731
Change-Id: I04f5897690089dc8a8fb4ae60726fe3a022b7a30
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-04-25 02:16:37 +00:00
Anas Nashif b17bd66792 license: use SPDX identifier for files in ext/
Change-Id: I32cb4211056046ca28a81aa97aca5d3c0b9b8303
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2017-01-20 20:22:57 -05:00
Carles Cufi f5f57285e0 ext: Import Segger J-Link RTT library
The Real Time Terminal functionality of the Segger J-Link
debug probe and software suite allows applications to write
to a certain RAM area that is read in real-time by the
debugger. This is specially useful when a UART is not
available to provide a console.

Origin: Segger J-Link 6.10m
URL: https://www.segger.com/downloads/jlink
Maintained-by: External

Change-Id: I47f5e2d5172797004a3f34ea2f002cd781a22cc8
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2016-12-03 15:24:38 +00:00