You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/01/29 09:26:16 UTC

[incubator-nuttx] branch master updated (794df92 -> 8f16680)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from 794df92  libs/libc/libc.csv: Add feof
     new e04ccba  note/sysview: add Segger System View support
     new 3fc18d5  tools/nxstyle: add Segger System View prototype name into white list
     new 11f04e5  drivers/segger: download the RTT/SystemView from github
     new 8e31fa5  segger/RTT: hotfix for RTT compile warning
     new 8f16680  sim/sysview: add build config of Segger System View

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../sim/sim/sim/configs/{nsh => sysview}/defconfig |   6 +-
 drivers/Kconfig                                    |   1 +
 drivers/Makefile                                   |   7 +-
 drivers/note/Kconfig                               |  12 +
 drivers/note/note_driver.c                         |   9 +
 drivers/segger/.gitignore                          |   3 +
 ...include-the-SEGGER_RTT_Conf.h-from-custom.patch |  29 ++
 drivers/segger/Kconfig                             |  67 +++
 drivers/segger/Make.defs                           |  72 +++
 .../esp32c3.h => drivers/segger/config/Global.h    |  32 +-
 drivers/segger/config/SEGGER_RTT_Conf.h            |  84 ++++
 .../segger/config/SEGGER_SYSVIEW_Conf.h            |  50 +--
 drivers/segger/note_sysview.c                      | 493 +++++++++++++++++++++
 .../nuttx/note/note_sysview.h                      |  20 +-
 tools/Directories.mk                               |   2 +-
 tools/nxstyle.c                                    |  11 +
 16 files changed, 837 insertions(+), 61 deletions(-)
 copy boards/sim/sim/sim/configs/{nsh => sysview}/defconfig (92%)
 create mode 100644 drivers/segger/.gitignore
 create mode 100644 drivers/segger/0001-segger-RTT-include-the-SEGGER_RTT_Conf.h-from-custom.patch
 create mode 100644 drivers/segger/Kconfig
 create mode 100644 drivers/segger/Make.defs
 copy arch/risc-v/src/esp32c3/esp32c3.h => drivers/segger/config/Global.h (75%)
 create mode 100644 drivers/segger/config/SEGGER_RTT_Conf.h
 copy include/nuttx/crypto/crypto.h => drivers/segger/config/SEGGER_SYSVIEW_Conf.h (65%)
 create mode 100644 drivers/segger/note_sysview.c
 copy arch/risc-v/src/esp32c3/esp32c3_ble.h => include/nuttx/note/note_sysview.h (80%)

[incubator-nuttx] 03/05: drivers/segger: download the RTT/SystemView from github

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 11f04e516aef876d3fe31810ed629b94b4a243c8
Author: chao.an <an...@xiaomi.com>
AuthorDate: Wed Jan 26 22:34:47 2022 +0800

    drivers/segger: download the RTT/SystemView from github
    
    RTT:
    https://github.com/SEGGERMicro/RTT/archive/refs/tags/V7.54.zip
    
    SystemView:
    https://github.com/SEGGERMicro/SystemView/archive/refs/tags/V3.30.zip
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 drivers/Makefile          |  6 ++++--
 drivers/segger/.gitignore |  1 +
 drivers/segger/Make.defs  | 30 ++++++++++++++++++++++++++++++
 tools/Directories.mk      |  2 +-
 4 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index 94c1460..7433c13 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -103,7 +103,7 @@ OBJS = $(AOBJS) $(COBJS)
 BIN = libdrivers$(LIBEXT)
 
 all: $(BIN)
-.PHONY: depend clean distclean
+.PHONY: context depend clean distclean
 
 $(AOBJS): %$(OBJEXT): %.S
 	$(call ASSEMBLE, $<, $@)
@@ -114,6 +114,8 @@ $(COBJS): %$(OBJEXT): %.c
 $(BIN): $(OBJS)
 	$(call ARCHIVE, $@, $(OBJS))
 
+context::
+
 makedepfile: $(CSRCS:.c=.ddc) $(ASRCS:.S=.dds)
 	$(call CATFILE, Make.dep, $^)
 	$(call DELFILE, $^)
@@ -128,7 +130,7 @@ clean:
 	$(call DELFILE, $(BIN))
 	$(call CLEAN)
 
-distclean: clean
+distclean:: clean
 	$(call DELFILE, Make.dep)
 	$(call DELFILE, .depend)
 
diff --git a/drivers/segger/.gitignore b/drivers/segger/.gitignore
index 481d748..052ff30 100644
--- a/drivers/segger/.gitignore
+++ b/drivers/segger/.gitignore
@@ -1,2 +1,3 @@
 /RTT
 /SystemView
+/*.zip
diff --git a/drivers/segger/Make.defs b/drivers/segger/Make.defs
index 902f063..4edadb8 100644
--- a/drivers/segger/Make.defs
+++ b/drivers/segger/Make.defs
@@ -18,6 +18,9 @@
 #
 ############################################################################
 
+TARGET_ZIP =
+SGDIR      = segger
+
 ifeq ($(CONFIG_SEGGER_RTT),y)
   CSRCS += segger/RTT/RTT/SEGGER_RTT.c
 
@@ -29,6 +32,16 @@ ifeq ($(CONFIG_SEGGER_RTT),y)
   ifeq ($(CONFIG_ARCH_ARMV7M),y)
     ASRCS += segger/RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S
   endif
+
+  RTT_VERSION ?= 7.54
+
+$(SGDIR)/RTT.zip:
+	$(Q) curl -L https://github.com/SEGGERMicro/RTT/archive/refs/tags/V$(RTT_VERSION).zip -o $(SGDIR)/RTT.zip
+	$(Q) unzip -o $(SGDIR)/RTT.zip -d $(SGDIR)
+	$(Q) mv $(SGDIR)/RTT-$(RTT_VERSION) $(SGDIR)/RTT
+
+TARGET_ZIP += $(SGDIR)/RTT.zip
+
 endif
 
 ifeq ($(CONFIG_SEGGER_SYSVIEW),y)
@@ -38,4 +51,21 @@ ifeq ($(CONFIG_SEGGER_SYSVIEW),y)
   CFLAGS += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)sched}
   CFLAGS += ${shell $(INCDIR) "$(CC)" segger$(DELIM)SystemView$(DELIM)SEGGER}
   CFLAGS += ${shell $(INCDIR) "$(CC)" segger$(DELIM)SystemView$(DELIM)SYSVIEW}
+
+  SYSVIEW_VERSION ?= 3.30
+
+$(SGDIR)/SystemView.zip:
+	$(Q) curl -L https://github.com/SEGGERMicro/SystemView/archive/refs/tags/V$(SYSVIEW_VERSION).zip -o $(SGDIR)/SystemView.zip
+	$(Q) unzip -o $(SGDIR)/SystemView.zip -d $(SGDIR)
+	$(Q) mv $(SGDIR)/SystemView-$(SYSVIEW_VERSION) $(SGDIR)/SystemView
+
+TARGET_ZIP += $(SGDIR)/SystemView.zip
+
 endif
+
+context:: $(TARGET_ZIP)
+
+distclean::
+	$(call DELDIR, $(SGDIR)/SystemView)
+	$(call DELDIR, $(SGDIR)/RTT)
+	$(call DELFILE, $(TARGET_ZIP))
diff --git a/tools/Directories.mk b/tools/Directories.mk
index 00ce04e..4192f10 100644
--- a/tools/Directories.mk
+++ b/tools/Directories.mk
@@ -61,7 +61,7 @@ ifeq ($(EXTERNALDIR),external)
   KERNDEPDIRS += external
 endif
 
-CONTEXTDIRS = boards fs $(APPDIR) $(ARCH_SRC)
+CONTEXTDIRS = boards drivers fs $(APPDIR) $(ARCH_SRC)
 CLEANDIRS += pass1
 
 ifeq ($(CONFIG_BUILD_FLAT),y)

[incubator-nuttx] 02/05: tools/nxstyle: add Segger System View prototype name into white list

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 3fc18d50b8a83d491666b0c46181953204d2ecb5
Author: chao.an <an...@xiaomi.com>
AuthorDate: Mon Jan 24 21:46:17 2022 +0800

    tools/nxstyle: add Segger System View prototype name into white list
    
    Reference:
    https: //github.com/SEGGERMicro/SystemView/blob/master/SYSVIEW/SEGGER_SYSVIEW.h
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 tools/nxstyle.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/nxstyle.c b/tools/nxstyle.c
index 138fa32..008d312 100644
--- a/tools/nxstyle.c
+++ b/tools/nxstyle.c
@@ -265,6 +265,17 @@ static const char *g_white_list[] =
   "WideCharToMultiByte",
 
   /* Ref:
+   * drivers/segger/note_sysview.c
+   */
+
+  "SEGGER_SYSVIEW",
+  "TaskID",
+  "sName",
+  "Prio",
+  "StackBase",
+  "StackSize",
+
+  /* Ref:
    * fs/nfs/rpc.h
    * fs/nfs/nfs_proto.h
    * fs/nfs/nfs_mount.h

[incubator-nuttx] 05/05: sim/sysview: add build config of Segger System View

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 8f166801c26ed5a38290388f8a550f4fef604d21
Author: chao.an <an...@xiaomi.com>
AuthorDate: Wed Jan 26 21:19:55 2022 +0800

    sim/sysview: add build config of Segger System View
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 boards/sim/sim/sim/configs/sysview/defconfig | 71 ++++++++++++++++++++++++++++
 1 file changed, 71 insertions(+)

diff --git a/boards/sim/sim/sim/configs/sysview/defconfig b/boards/sim/sim/sim/configs/sysview/defconfig
new file mode 100644
index 0000000..6e2dc19
--- /dev/null
+++ b/boards/sim/sim/sim/configs/sysview/defconfig
@@ -0,0 +1,71 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed .config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that includes your
+# modifications.
+#
+# CONFIG_NSH_CMDOPT_HEXDUMP is not set
+CONFIG_ARCH="sim"
+CONFIG_ARCH_BOARD="sim"
+CONFIG_ARCH_BOARD_SIM=y
+CONFIG_ARCH_CHIP="sim"
+CONFIG_ARCH_SIM=y
+CONFIG_BOARDCTL_APP_SYMTAB=y
+CONFIG_BOARDCTL_POWEROFF=y
+CONFIG_BOARD_LOOPSPERMSEC=0
+CONFIG_BOOT_RUNFROMEXTSRAM=y
+CONFIG_BUILTIN=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEV_GPIO=y
+CONFIG_DEV_LOOP=y
+CONFIG_DEV_ZERO=y
+CONFIG_DRIVER_NOTE=y
+CONFIG_EXAMPLES_GPIO=y
+CONFIG_EXAMPLES_HELLO=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FSUTILS_PASSWD=y
+CONFIG_FSUTILS_PASSWD_READONLY=y
+CONFIG_FS_BINFS=y
+CONFIG_FS_FAT=y
+CONFIG_FS_PROCFS=y
+CONFIG_FS_RAMMAP=y
+CONFIG_FS_ROMFS=y
+CONFIG_GPIO_LOWER_HALF=y
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_INIT_ENTRYPOINT="nsh_main"
+CONFIG_IOEXPANDER=y
+CONFIG_IOEXPANDER_DUMMY=y
+CONFIG_LIBC_ENVPATH=y
+CONFIG_LIBC_EXECFUNCS=y
+CONFIG_LIBC_LOCALE=y
+CONFIG_LIBC_LOCALE_CATALOG=y
+CONFIG_LIBC_LOCALE_GETTEXT=y
+CONFIG_NSH_ARCHINIT=y
+CONFIG_NSH_ARCHROMFS=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FATDEVNO=2
+CONFIG_NSH_FILE_APPS=y
+CONFIG_NSH_MOTD=y
+CONFIG_NSH_MOTD_STRING="MOTD: username=admin password=Administrator"
+CONFIG_NSH_READLINE=y
+CONFIG_NSH_ROMFSDEVNO=1
+CONFIG_NSH_ROMFSETC=y
+CONFIG_PATH_INITIAL="/bin"
+CONFIG_POSIX_SPAWN_PROXY_STACKSIZE=2048
+CONFIG_PSEUDOFS_ATTRIBUTES=y
+CONFIG_PSEUDOFS_SOFTLINKS=y
+CONFIG_READLINE_TABCOMPLETION=y
+CONFIG_SCHED_CRITMONITOR=y
+CONFIG_SCHED_HAVE_PARENT=y
+CONFIG_SCHED_HPWORK=y
+CONFIG_SCHED_INSTRUMENTATION=y
+CONFIG_SCHED_INSTRUMENTATION_FILTER=y
+CONFIG_SCHED_ONEXIT=y
+CONFIG_SCHED_WAITPID=y
+CONFIG_SDCLONE_DISABLE=y
+CONFIG_SEGGER_SYSVIEW=y
+CONFIG_START_MONTH=6
+CONFIG_START_YEAR=2008
+CONFIG_SYSTEM_NSH=y

[incubator-nuttx] 04/05: segger/RTT: hotfix for RTT compile warning

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 8e31fa572a5e7a319f0cbd8dd40396edf48af596
Author: chao.an <an...@xiaomi.com>
AuthorDate: Wed Jan 26 18:10:29 2022 +0800

    segger/RTT: hotfix for RTT compile warning
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 ...include-the-SEGGER_RTT_Conf.h-from-custom.patch | 29 ++++++++++++++++++++++
 drivers/segger/Make.defs                           |  1 +
 2 files changed, 30 insertions(+)

diff --git a/drivers/segger/0001-segger-RTT-include-the-SEGGER_RTT_Conf.h-from-custom.patch b/drivers/segger/0001-segger-RTT-include-the-SEGGER_RTT_Conf.h-from-custom.patch
new file mode 100644
index 0000000..d39205c
--- /dev/null
+++ b/drivers/segger/0001-segger-RTT-include-the-SEGGER_RTT_Conf.h-from-custom.patch
@@ -0,0 +1,29 @@
+From 47aaa5806bc4679386de191ede6ffb8982a66975 Mon Sep 17 00:00:00 2001
+From: "chao.an" <an...@xiaomi.com>
+Date: Thu, 27 Jan 2022 12:39:50 +0800
+Subject: [PATCH] segger/RTT: include the SEGGER_RTT_Conf.h from custom path
+
+VELAPLATFO-1419
+
+Change-Id: Idd1d8a38ab38d3e60ee9dddbed26ba8aca510595
+Signed-off-by: chao.an <an...@xiaomi.com>
+---
+ RTT/SEGGER_RTT.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/RTT/SEGGER_RTT.h segger/RTT/RTT/SEGGER_RTT.h
+index a91c36d..744b3a1 100644
+--- a/RTT/SEGGER_RTT.h
++++ segger/RTT/RTT/SEGGER_RTT.h
+@@ -58,7 +58,7 @@ Revision: $Rev: 24324 $
+ #ifndef SEGGER_RTT_H
+ #define SEGGER_RTT_H
+
+-#include "../Config/SEGGER_RTT_Conf.h"
++#include "SEGGER_RTT_Conf.h"
+
+ /*********************************************************************
+ *
+--
+2.25.1
+
diff --git a/drivers/segger/Make.defs b/drivers/segger/Make.defs
index 4edadb8..11e343d 100644
--- a/drivers/segger/Make.defs
+++ b/drivers/segger/Make.defs
@@ -39,6 +39,7 @@ $(SGDIR)/RTT.zip:
 	$(Q) curl -L https://github.com/SEGGERMicro/RTT/archive/refs/tags/V$(RTT_VERSION).zip -o $(SGDIR)/RTT.zip
 	$(Q) unzip -o $(SGDIR)/RTT.zip -d $(SGDIR)
 	$(Q) mv $(SGDIR)/RTT-$(RTT_VERSION) $(SGDIR)/RTT
+	$(Q) patch -p0 < segger/0001-segger-RTT-include-the-SEGGER_RTT_Conf.h-from-custom.patch
 
 TARGET_ZIP += $(SGDIR)/RTT.zip
 

[incubator-nuttx] 01/05: note/sysview: add Segger System View support

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit e04ccba78aa1dacf92c321b1f9b1466c81283ede
Author: chao.an <an...@xiaomi.com>
AuthorDate: Fri Jan 21 20:00:26 2022 +0800

    note/sysview: add Segger System View support
    
    Reference:
    https://www.segger.com/products/development-tools/systemview
    https://github.com/SEGGERMicro/SystemView
    https://github.com/SEGGERMicro/RTT
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 drivers/Kconfig                                    |   1 +
 drivers/Makefile                                   |   1 +
 drivers/note/Kconfig                               |  12 +
 drivers/note/note_driver.c                         |   9 +
 drivers/segger/.gitignore                          |   2 +
 drivers/segger/Kconfig                             |  67 +++
 drivers/segger/Make.defs                           |  41 ++
 .../{note/note_driver.c => segger/config/Global.h} |  60 +--
 drivers/segger/config/SEGGER_RTT_Conf.h            |  84 ++++
 .../config/SEGGER_SYSVIEW_Conf.h}                  |  78 ++--
 drivers/segger/note_sysview.c                      | 493 +++++++++++++++++++++
 .../nuttx/note/note_sysview.h                      |  39 +-
 12 files changed, 783 insertions(+), 104 deletions(-)

diff --git a/drivers/Kconfig b/drivers/Kconfig
index e5cf67c..45ea433 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -133,3 +133,4 @@ source "drivers/rf/Kconfig"
 source "drivers/rc/Kconfig"
 source "drivers/motor/Kconfig"
 source "drivers/math/Kconfig"
+source "drivers/segger/Kconfig"
diff --git a/drivers/Makefile b/drivers/Makefile
index 9b226a5..94c1460 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -64,6 +64,7 @@ include contactless/Make.defs
 include 1wire/Make.defs
 include rf/Make.defs
 include rc/Make.defs
+include segger/Make.defs
 
 ifeq ($(CONFIG_SPECIFIC_DRIVERS),y)
 -include platform/Make.defs
diff --git a/drivers/note/Kconfig b/drivers/note/Kconfig
index 646f919..cc81864 100644
--- a/drivers/note/Kconfig
+++ b/drivers/note/Kconfig
@@ -52,6 +52,18 @@ config DRIVER_NOTELOG
 	---help---
 		The note driver output to syslog.
 
+config SEGGER_SYSVIEW
+	bool "Note SEGGER SystemView driver"
+	select SEGGER_RTT
+	select SCHED_INSTRUMENTATION_EXTERNAL
+	---help---
+		SystemView is a real-time recording and visualization tool for embedded
+		systems that reveals the true runtime behavior of an application,
+		going far deeper than the system insights provided by debuggers. This is
+		particularly effective when developing and working with complex embedded
+		systems comprising multiple threads and interrupts. SystemView can ensure
+		unintended interactions and resource conflicts.
+
 endchoice
 
 config DRIVER_NOTERAM_BUFSIZE
diff --git a/drivers/note/note_driver.c b/drivers/note/note_driver.c
index 93c2466..7bdd26a 100644
--- a/drivers/note/note_driver.c
+++ b/drivers/note/note_driver.c
@@ -23,6 +23,7 @@
  ****************************************************************************/
 
 #include <nuttx/note/note_driver.h>
+#include <nuttx/note/note_sysview.h>
 #include <nuttx/note/noteram_driver.h>
 #include <nuttx/note/notectl_driver.h>
 
@@ -65,5 +66,13 @@ int note_register(void)
     }
 #endif
 
+#ifdef CONFIG_SEGGER_SYSVIEW
+  ret = sysview_initialize();
+  if (ret < 0)
+    {
+      return ret;
+    }
+#endif
+
   return ret;
 }
diff --git a/drivers/segger/.gitignore b/drivers/segger/.gitignore
new file mode 100644
index 0000000..481d748
--- /dev/null
+++ b/drivers/segger/.gitignore
@@ -0,0 +1,2 @@
+/RTT
+/SystemView
diff --git a/drivers/segger/Kconfig b/drivers/segger/Kconfig
new file mode 100644
index 0000000..f5451b5
--- /dev/null
+++ b/drivers/segger/Kconfig
@@ -0,0 +1,67 @@
+#
+# For a description of the syntax of this configuration file,
+# see the file kconfig-language.txt in the NuttX tools repository.
+#
+
+config SEGGER_RTT
+	bool
+	---help---
+		Enable Segger J-Link RTT libraries for platforms that support it.
+		Selection of this option enables use of RTT for various subsystems.
+		Note that by enabling this option, RTT buffers consume more RAM.
+
+if SEGGER_RTT
+
+config SEGGER_RTT_CPU_CACHE_LINE_SIZE
+	int "Segger RTT Cache Line Size"
+	default 0
+	---help---
+		Largest cache line size (in bytes) in the target system.
+
+config SEGGER_RTT_UNCACHED_OFF
+	int "Segger RTT uncached offset"
+	default 0
+	---help---
+		Address alias where RTT CB and buffers can be accessed uncached
+
+config SEGGER_RTT_MAX_NUM_UP_BUFFERS
+	int "Segger RTT Maximum Number of UP Buffers"
+	default 3
+	---help---
+		Number of up-buffers (T->H) available on this target
+
+config SEGGER_RTT_MAX_NUM_DOWN_BUFFERS
+	int "Segger RTT Maximum Number of Down Buffers"
+	default 3
+	---help---
+		Number of down-buffers (H->T) available on this target
+
+config SEGGER_RTT_BUFFER_SIZE_UP
+	int "Segger RTT UP Buffer Size"
+	default 1024
+	---help---
+		Size of the buffer for terminal output of target, up to host
+
+config SEGGER_RTT_BUFFER_SIZE_DOWN
+	int "Segger RTT Down Buffer Size"
+	default 16
+	---help---
+		Size of the buffer for terminal input to target from host (Usually keyboard input)
+
+if SEGGER_SYSVIEW
+
+config SEGGER_SYSVIEW_RTT_BUFFER_SIZE
+	int "Segger System View buffer size"
+	default 1024
+	---help---
+		Number of bytes that SystemView uses for the RTT buffer.
+
+config SEGGER_SYSVIEW_RAM_BASE
+	int "Segger System View Ram Base"
+	default 0
+	---help---
+		The lowest RAM address used for IDs
+
+endif
+
+endif
diff --git a/drivers/segger/Make.defs b/drivers/segger/Make.defs
new file mode 100644
index 0000000..902f063
--- /dev/null
+++ b/drivers/segger/Make.defs
@@ -0,0 +1,41 @@
+############################################################################
+# drivers/segger/Make.defs
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.  The
+# ASF licenses this file to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance with the
+# License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+# License for the specific language governing permissions and limitations
+# under the License.
+#
+############################################################################
+
+ifeq ($(CONFIG_SEGGER_RTT),y)
+  CSRCS += segger/RTT/RTT/SEGGER_RTT.c
+
+  CFLAGS += -Wno-shadow -Wno-array-bounds
+
+  CFLAGS += ${shell $(INCDIR) "$(CC)" segger$(DELIM)config}
+  CFLAGS += ${shell $(INCDIR) "$(CC)" segger$(DELIM)RTT$(DELIM)RTT}
+
+  ifeq ($(CONFIG_ARCH_ARMV7M),y)
+    ASRCS += segger/RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S
+  endif
+endif
+
+ifeq ($(CONFIG_SEGGER_SYSVIEW),y)
+  CSRCS += segger/note_sysview.c
+  CSRCS += segger/SystemView/SYSVIEW/SEGGER_SYSVIEW.c
+
+  CFLAGS += ${shell $(INCDIR) "$(CC)" $(TOPDIR)$(DELIM)sched}
+  CFLAGS += ${shell $(INCDIR) "$(CC)" segger$(DELIM)SystemView$(DELIM)SEGGER}
+  CFLAGS += ${shell $(INCDIR) "$(CC)" segger$(DELIM)SystemView$(DELIM)SYSVIEW}
+endif
diff --git a/drivers/note/note_driver.c b/drivers/segger/config/Global.h
similarity index 59%
copy from drivers/note/note_driver.c
copy to drivers/segger/config/Global.h
index 93c2466..5d63230 100644
--- a/drivers/note/note_driver.c
+++ b/drivers/segger/config/Global.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/note/note_driver.c
+ * drivers/segger/config/Global.h
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,52 +18,28 @@
  *
  ****************************************************************************/
 
+#ifndef __DRIVERS_SEGGER_CONFIG_GLOBAL_H
+#define __DRIVERS_SEGGER_CONFIG_GLOBAL_H
+
 /****************************************************************************
  * Included Files
  ****************************************************************************/
 
-#include <nuttx/note/note_driver.h>
-#include <nuttx/note/noteram_driver.h>
-#include <nuttx/note/notectl_driver.h>
+#include <nuttx/config.h>
+#include <stdint.h>
 
 /****************************************************************************
- * Public Functions
+ * Pre-processor Definitions
  ****************************************************************************/
 
-/****************************************************************************
- * Name: note_register
- *
- * Description:
- *   Register sched note related drivers at /dev folder that can be used by
- *   an application to read or filter the note data.
- *
- * Input Parameters:
- *   None.
- *
- * Returned Value:
- *   Zero on succress. A negated errno value is returned on a failure.
- *
- ****************************************************************************/
-
-int note_register(void)
-{
-  int ret = 0;
-
-#ifdef CONFIG_DRIVER_NOTERAM
-  ret = noteram_register();
-  if (ret < 0)
-    {
-      return ret;
-    }
-#endif
-
-#ifdef CONFIG_DRIVER_NOTECTL
-  ret = notectl_register();
-  if (ret < 0)
-    {
-      return ret;
-    }
-#endif
-
-  return ret;
-}
+#define U8          uint8_t
+#define I8           int8_t
+#define U16        uint16_t
+#define I16         int16_t
+#define U32        uint32_t
+#define I32         int32_t
+#define U64        uint64_t
+#define I64         int64_t
+#define PTR_ADDR  uintptr_t
+
+#endif /* __DRIVERS_SEGGER_CONFIG_GLOBAL_H */
diff --git a/drivers/segger/config/SEGGER_RTT_Conf.h b/drivers/segger/config/SEGGER_RTT_Conf.h
new file mode 100644
index 0000000..5de85b9
--- /dev/null
+++ b/drivers/segger/config/SEGGER_RTT_Conf.h
@@ -0,0 +1,84 @@
+/****************************************************************************
+ * drivers/segger/config/SEGGER_RTT_Conf.h
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+#ifndef __DRIVERS_SEGGER_CONFIG_SEGGER_RTT_CONF_H
+#define __DRIVERS_SEGGER_CONFIG_SEGGER_RTT_CONF_H
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <nuttx/spinlock.h>
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+/* Take in and set to correct values for Cortex systems with CPU cache */
+
+/* Largest cache line size (in bytes) in the current system */
+
+#define SEGGER_RTT_CPU_CACHE_LINE_SIZE  CONFIG_SEGGER_RTT_CPU_CACHE_LINE_SIZE
+
+/* Address alias where RTT CB and buffers can be accessed uncached */
+
+#define SEGGER_RTT_UNCACHED_OFF         CONFIG_SEGGER_RTT_UNCACHED_OFF
+
+/* Number of up-buffers (T->H) available on this target */
+
+#define SEGGER_RTT_MAX_NUM_UP_BUFFERS   CONFIG_SEGGER_RTT_MAX_NUM_UP_BUFFERS
+
+/* Number of down-buffers (H->T) available on this target */
+
+#define SEGGER_RTT_MAX_NUM_DOWN_BUFFERS CONFIG_SEGGER_RTT_MAX_NUM_DOWN_BUFFERS
+
+/* Size of the buffer for terminal output of target, up to host */
+
+#define BUFFER_SIZE_UP                  CONFIG_SEGGER_RTT_BUFFER_SIZE_UP
+
+/* Size of the buffer for terminal input to target from host */
+
+#define BUFFER_SIZE_DOWN                CONFIG_SEGGER_RTT_BUFFER_SIZE_DOWN
+
+/* Mode for pre-initialized terminal channel */
+
+#define SEGGER_RTT_MODE_DEFAULT         SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
+
+/* 0: Use memcpy/SEGGER_RTT_MEMCPY, 1: Use a simple byte-loop */
+
+#define SEGGER_RTT_MEMCPY_USE_BYTELOOP  0
+
+/* RTT lock configuration */
+
+/* Lock RTT (nestable)   (i.e. disable interrupts) */
+
+#define SEGGER_RTT_LOCK()               irqstate_t __flags = spin_lock_irqsave(NULL)
+
+/* Unlock RTT (nestable) (i.e. enable previous interrupt lock state) */
+
+#define SEGGER_RTT_UNLOCK()             spin_unlock_irqrestore(NULL, __flags)
+
+/* Disable RTT SEGGER_RTT_WriteSkipNoLock */
+
+#define RTT_USE_ASM                     0
+
+#endif /* __DRIVERS_SEGGER_CONFIG_SEGGER_RTT_CONF_H */
diff --git a/drivers/note/note_driver.c b/drivers/segger/config/SEGGER_SYSVIEW_Conf.h
similarity index 51%
copy from drivers/note/note_driver.c
copy to drivers/segger/config/SEGGER_SYSVIEW_Conf.h
index 93c2466..6dcadb1 100644
--- a/drivers/note/note_driver.c
+++ b/drivers/segger/config/SEGGER_SYSVIEW_Conf.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/note/note_driver.c
+ * drivers/segger/config/SEGGER_SYSVIEW_Conf.h
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,52 +18,62 @@
  *
  ****************************************************************************/
 
+#ifndef __DRIVERS_SEGGER_CONFIG_SEGGER_SYSVIEW_CONF_H
+#define __DRIVERS_SEGGER_CONFIG_SEGGER_SYSVIEW_CONF_H
+
 /****************************************************************************
  * Included Files
  ****************************************************************************/
 
-#include <nuttx/note/note_driver.h>
-#include <nuttx/note/noteram_driver.h>
-#include <nuttx/note/notectl_driver.h>
+#include <nuttx/config.h>
 
 /****************************************************************************
- * Public Functions
+ * Pre-processor Definitions
  ****************************************************************************/
 
+/* Function macro to retrieve the Id of the currently active interrupt.
+ * Call user-supplied function SEGGER_SYSVIEW_X_GetInterruptId().
+ */
+
+#define SEGGER_SYSVIEW_GET_INTERRUPT_ID    sysview_get_interrupt_id
+
+/* Function macro to retrieve a system timestamp for SYSVIEW events.
+ * Call user-supplied function SEGGER_SYSVIEW_X_GetTimestamp().
+ */
+
+#define SEGGER_SYSVIEW_GET_TIMESTAMP       sysview_get_timestamp
+
+/* Number of bytes that SystemView uses for the RTT buffer. */
+
+#define SEGGER_SYSVIEW_RTT_BUFFER_SIZE     CONFIG_SEGGER_SYSVIEW_RTT_BUFFER_SIZE
+
+/* Largest cache line size (in bytes) in the target system. */
+
+#define SEGGER_SYSVIEW_CPU_CACHE_LINE_SIZE CONFIG_SEGGER_RTT_CPU_CACHE_LINE_SIZE
+
 /****************************************************************************
- * Name: note_register
- *
- * Description:
- *   Register sched note related drivers at /dev folder that can be used by
- *   an application to read or filter the note data.
- *
- * Input Parameters:
- *   None.
- *
- * Returned Value:
- *   Zero on succress. A negated errno value is returned on a failure.
- *
+ * Public Data
  ****************************************************************************/
 
-int note_register(void)
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C"
 {
-  int ret = 0;
-
-#ifdef CONFIG_DRIVER_NOTERAM
-  ret = noteram_register();
-  if (ret < 0)
-    {
-      return ret;
-    }
+#else
+#define EXTERN extern
 #endif
 
-#ifdef CONFIG_DRIVER_NOTECTL
-  ret = notectl_register();
-  if (ret < 0)
-    {
-      return ret;
-    }
-#endif
+/****************************************************************************
+ * Public Function Prototypes
+ ****************************************************************************/
+
+unsigned int sysview_get_interrupt_id(void);
+unsigned int sysview_get_timestamp(void);
 
-  return ret;
+#undef EXTERN
+#if defined(__cplusplus)
 }
+#endif
+
+#endif /* __DRIVERS_SEGGER_CONFIG_SEGGER_SYSVIEW_CONF_H */
diff --git a/drivers/segger/note_sysview.c b/drivers/segger/note_sysview.c
new file mode 100644
index 0000000..053eb1a
--- /dev/null
+++ b/drivers/segger/note_sysview.c
@@ -0,0 +1,493 @@
+/****************************************************************************
+ * drivers/segger/note_sysview.c
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.  The
+ * ASF licenses this file to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the
+ * License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+#include <syslog.h>
+
+#include <nuttx/clock.h>
+#include <nuttx/sched.h>
+#include <nuttx/sched_note.h>
+
+#include <SEGGER_RTT.h>
+#include <SEGGER_SYSVIEW.h>
+
+#include "sched/sched.h"
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct sysview_s
+{
+  unsigned int              irq[CONFIG_SMP_NCPUS];
+#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
+  struct note_filter_mode_s mode;
+#endif
+#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
+  struct note_filter_irq_s  irq_mask;
+#endif
+};
+
+/****************************************************************************
+ * Private Data
+ ****************************************************************************/
+
+static struct sysview_s g_sysview =
+{
+#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
+  .mode =
+    {
+      .flag = CONFIG_SCHED_INSTRUMENTATION_FILTER_DEFAULT_MODE,
+#ifdef CONFIG_SMP
+      .cpuset = CONFIG_SCHED_INSTRUMENTATION_CPUSET,
+#endif
+    }
+#endif
+};
+
+/****************************************************************************
+ * Private Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: sysview_send_taskinfo
+ ****************************************************************************/
+
+static void sysview_send_taskinfo(FAR struct tcb_s *tcb)
+{
+  SEGGER_SYSVIEW_TASKINFO info;
+
+  info.TaskID     = tcb->pid;
+  info.sName      = tcb->name;
+  info.Prio       = tcb->sched_priority;
+  info.StackBase  = (uintptr_t)tcb->stack_base_ptr;
+  info.StackSize  = tcb->adj_stack_size;
+
+  SEGGER_SYSVIEW_SendTaskInfo(&info);
+}
+
+/****************************************************************************
+ * Name: sysview_get_time
+ ****************************************************************************/
+
+static uint64_t sysview_get_time(void)
+{
+  return TICK2USEC(clock_systime_ticks());
+}
+
+/****************************************************************************
+ * Name: sysview_send_tasklist
+ ****************************************************************************/
+
+static void sysview_send_tasklist(void)
+{
+  int i;
+
+  for (i = 0; i < g_npidhash; i++)
+    {
+      if (g_pidhash[i] != NULL)
+        {
+          sysview_send_taskinfo(g_pidhash[i]);
+        }
+    }
+}
+
+/****************************************************************************
+ * Name: sysview_send_description
+ ****************************************************************************/
+
+static void sysview_send_description(void)
+{
+  SEGGER_SYSVIEW_SendSysDesc("N="SEGGER_SYSVIEW_APP_NAME);
+  SEGGER_SYSVIEW_SendSysDesc("D="CONFIG_LIBC_HOSTNAME);
+  SEGGER_SYSVIEW_SendSysDesc("O=NuttX");
+}
+
+/****************************************************************************
+ * Name: sysview_isenabled
+ *
+ * Description:
+ *   Check whether the instrumentation is enabled.
+ *
+ * Input Parameters:
+ *   None
+ *
+ * Returned Value:
+ *   True is returned if the instrumentation is enabled.
+ *
+ ****************************************************************************/
+
+static bool sysview_isenabled(void)
+{
+  bool enable;
+
+  enable = SEGGER_SYSVIEW_IsStarted();
+
+#if defined(CONFIG_SCHED_INSTRUMENTATION_FILTER) && defined(CONFIG_SMP)
+  /* Ignore notes that are not in the set of monitored CPUs */
+
+  if (enable && (g_sysview.mode.cpuset & (1 << this_cpu())) == 0)
+    {
+      /* Not in the set of monitored CPUs.  Do not log the note. */
+
+      return false;
+    }
+#endif
+
+  return enable;
+}
+
+/****************************************************************************
+ * Name: sysview_isenabled_irqhandler
+ *
+ * Description:
+ *   Check whether the interrupt handler instrumentation is enabled.
+ *
+ * Input Parameters:
+ *   irq   - IRQ number
+ *   enter - interrupt enter/leave flag
+ *
+ * Returned Value:
+ *   True is returned if the instrumentation is enabled.
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
+static bool sysview_isenabled_irq(int irq, bool enter)
+{
+#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
+  if (!sysview_isenabled())
+    {
+      return false;
+    }
+
+  /* If the IRQ trace is disabled or the IRQ number is masked, disable
+   * subsequent syscall traces until leaving the interrupt handler
+   */
+
+  if ((g_sysview.mode.flag & NOTE_FILTER_MODE_FLAG_IRQ) == 0 ||
+      NOTE_FILTER_IRQMASK_ISSET(irq, &g_sysview.irq_mask))
+    {
+      return false;
+    }
+#endif
+
+  return true;
+}
+#endif
+
+/****************************************************************************
+ * Public Functions
+ ****************************************************************************/
+
+/****************************************************************************
+ * Name: sched_note_start, sched_note_stop, sched_note_switch,
+ *       sched_note_premption
+ *
+ * Description:
+ *   Hooks to scheduler monitor
+ *
+ * Input Parameters:
+ *   Varies
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+void sched_note_start(FAR struct tcb_s *tcb)
+{
+  if (!sysview_isenabled())
+    {
+      return;
+    }
+
+  SEGGER_SYSVIEW_OnTaskCreate(tcb->pid);
+  sysview_send_taskinfo(tcb);
+}
+
+void sched_note_stop(FAR struct tcb_s *tcb)
+{
+  if (!sysview_isenabled())
+    {
+      return;
+    }
+
+  SEGGER_SYSVIEW_OnTaskTerminate(tcb->pid);
+}
+
+#ifdef CONFIG_SCHED_INSTRUMENTATION_SWITCH
+void sched_note_suspend(FAR struct tcb_s *tcb)
+{
+  if (!sysview_isenabled())
+    {
+      return;
+    }
+
+  if (!up_interrupt_context())
+    {
+      SEGGER_SYSVIEW_OnTaskStopExec();
+    }
+}
+
+void sched_note_resume(FAR struct tcb_s *tcb)
+{
+  if (!sysview_isenabled())
+    {
+      return;
+    }
+
+  if (!up_interrupt_context())
+    {
+      if (tcb->flink == NULL)
+        {
+          SEGGER_SYSVIEW_OnIdle();
+        }
+      else
+        {
+          SEGGER_SYSVIEW_OnTaskStartExec(tcb->pid);
+        }
+    }
+}
+#endif
+
+#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
+void sched_note_irqhandler(int irq, FAR void *handler, bool enter)
+{
+  if (!sysview_isenabled_irq(irq, enter))
+    {
+      return;
+    }
+
+  if (enter)
+    {
+      g_sysview.irq[up_cpu_index()] = irq;
+
+      SEGGER_SYSVIEW_OnTaskStopExec();
+      SEGGER_SYSVIEW_RecordEnterISR();
+    }
+  else
+    {
+      SEGGER_SYSVIEW_RecordExitISR();
+
+      if (up_interrupt_context())
+        {
+          FAR struct tcb_s *tcb = this_task();
+
+          if (tcb && tcb->flink != NULL)
+            {
+              SEGGER_SYSVIEW_OnTaskStartExec(tcb->pid);
+            }
+          else
+            {
+              SEGGER_SYSVIEW_OnIdle();
+            }
+        }
+
+      g_sysview.irq[up_cpu_index()] = 0;
+    }
+}
+#endif
+
+/****************************************************************************
+ * Name: sysview_get_interrupt_id
+ *
+ * Description:
+ *   Retrieve the Id of the currently active interrupt.
+ *
+ ****************************************************************************/
+
+unsigned int sysview_get_interrupt_id(void)
+{
+  return g_sysview.irq[up_cpu_index()];
+}
+
+/****************************************************************************
+ * Name: sysview_get_timestamp
+ *
+ * Description:
+ *   Retrieve a system timestamp for SYSVIEW events.
+ *
+ ****************************************************************************/
+
+unsigned int sysview_get_timestamp(void)
+{
+  return up_perf_gettime();
+}
+
+/****************************************************************************
+ * Name: sysview_initialize
+ *
+ * Description:
+ *   Initializes the SYSVIEW module.
+ *
+ * Input Parameters:
+ *   None.
+ *
+ * Returned Value:
+ *   Zero on succress. A negated errno value is returned on a failure.
+ *
+ ****************************************************************************/
+
+int sysview_initialize(void)
+{
+  uint32_t freq = up_perf_getfreq();
+
+  static const SEGGER_SYSVIEW_OS_API g_sysview_trace_api =
+    {
+      sysview_get_time,
+      sysview_send_tasklist,
+    };
+
+  SEGGER_SYSVIEW_Init(freq, freq, &g_sysview_trace_api,
+                      sysview_send_description);
+
+#if CONFIG_SEGGER_SYSVIEW_RAM_BASE != 0
+  SEGGER_SYSVIEW_SetRAMBase(CONFIG_SEGGER_SYSVIEW_RAM_BASE);
+#endif
+
+  if ((g_sysview.mode.flag & NOTE_FILTER_MODE_FLAG_ENABLE) != 0)
+    {
+      SEGGER_SYSVIEW_Start();
+    }
+
+  syslog(LOG_NOTICE, "SEGGER RTT Control Block Address: %#" PRIxPTR "\n",
+                      (uintptr_t)&_SEGGER_RTT +
+                      CONFIG_SEGGER_RTT_UNCACHED_OFF);
+  return 0;
+}
+
+#ifdef CONFIG_SCHED_INSTRUMENTATION_FILTER
+
+/****************************************************************************
+ * Name: sched_note_filter_mode
+ *
+ * Description:
+ *   Set and get note filter mode.
+ *   (Same as NOTECTL_GETMODE / NOTECTL_SETMODE ioctls)
+ *
+ * Input Parameters:
+ *   oldm - A writable pointer to struct note_filter_mode_s to get current
+ *          filter mode
+ *          If 0, no data is written.
+ *   newm - A read-only pointer to struct note_filter_mode_s which holds the
+ *          new filter mode
+ *          If 0, the filter mode is not updated.
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+void sched_note_filter_mode(struct note_filter_mode_s *oldm,
+                            struct note_filter_mode_s *newm)
+{
+  irqstate_t flags;
+
+  flags = spin_lock_irqsave(NULL);
+
+  if (oldm != NULL)
+    {
+      if (SEGGER_SYSVIEW_IsStarted())
+        {
+          g_sysview.mode.flag |= NOTE_FILTER_MODE_FLAG_ENABLE;
+        }
+      else
+        {
+          g_sysview.mode.flag &= ~NOTE_FILTER_MODE_FLAG_ENABLE;
+        }
+
+      *oldm = g_sysview.mode;
+    }
+
+  if (newm != NULL)
+    {
+      g_sysview.mode = *newm;
+
+      if ((g_sysview.mode.flag & NOTE_FILTER_MODE_FLAG_ENABLE) != 0)
+        {
+          if (!SEGGER_SYSVIEW_IsStarted())
+            {
+              SEGGER_SYSVIEW_Start();
+            }
+        }
+      else
+        {
+          if (SEGGER_SYSVIEW_IsStarted())
+            {
+              SEGGER_SYSVIEW_Stop();
+            }
+        }
+    }
+
+  spin_unlock_irqrestore(NULL, flags);
+}
+
+/****************************************************************************
+ * Name: sched_note_filter_irq
+ *
+ * Description:
+ *   Set and get IRQ filter setting
+ *   (Same as NOTECTL_GETIRQFILTER / NOTECTL_SETIRQFILTER ioctls)
+ *
+ * Input Parameters:
+ *   oldf - A writable pointer to struct note_filter_irq_s to get
+ *          current IRQ filter setting
+ *          If 0, no data is written.
+ *   newf - A read-only pointer to struct note_filter_irq_s of the new
+ *          IRQ filter setting
+ *          If 0, the setting is not updated.
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+#ifdef CONFIG_SCHED_INSTRUMENTATION_IRQHANDLER
+void sched_note_filter_irq(struct note_filter_irq_s *oldf,
+                           struct note_filter_irq_s *newf)
+{
+  irqstate_t flags;
+
+  flags = spin_lock_irqsave(NULL);
+
+  if (oldf != NULL)
+    {
+      /* Return the current filter setting */
+
+      *oldf = g_sysview.irq_mask;
+    }
+
+  if (newf != NULL)
+    {
+      /* Replace the syscall filter mask by the provided setting */
+
+      g_sysview.irq_mask = *newf;
+    }
+
+  spin_unlock_irqrestore(NULL, flags);
+}
+#endif
+
+#endif
diff --git a/drivers/note/note_driver.c b/include/nuttx/note/note_sysview.h
similarity index 73%
copy from drivers/note/note_driver.c
copy to include/nuttx/note/note_sysview.h
index 93c2466..44633b6 100644
--- a/drivers/note/note_driver.c
+++ b/include/nuttx/note/note_sysview.h
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/note/note_driver.c
+ * include/nuttx/note/note_sysview.h
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -18,24 +18,24 @@
  *
  ****************************************************************************/
 
+#ifndef __INCLUDE_NUTTX_NOTE_NOTE_SYSVIEW_H
+#define __INCLUDE_NUTTX_NOTE_NOTE_SYSVIEW_H
+
 /****************************************************************************
  * Included Files
  ****************************************************************************/
 
-#include <nuttx/note/note_driver.h>
-#include <nuttx/note/noteram_driver.h>
-#include <nuttx/note/notectl_driver.h>
+#include <nuttx/config.h>
 
 /****************************************************************************
- * Public Functions
+ * Public Function Prototypes
  ****************************************************************************/
 
 /****************************************************************************
- * Name: note_register
+ * Name: sysview_initialize
  *
  * Description:
- *   Register sched note related drivers at /dev folder that can be used by
- *   an application to read or filter the note data.
+ *   Initializes the SYSVIEW module.
  *
  * Input Parameters:
  *   None.
@@ -45,25 +45,8 @@
  *
  ****************************************************************************/
 
-int note_register(void)
-{
-  int ret = 0;
-
-#ifdef CONFIG_DRIVER_NOTERAM
-  ret = noteram_register();
-  if (ret < 0)
-    {
-      return ret;
-    }
-#endif
-
-#ifdef CONFIG_DRIVER_NOTECTL
-  ret = notectl_register();
-  if (ret < 0)
-    {
-      return ret;
-    }
+#ifdef CONFIG_SEGGER_SYSVIEW
+int sysview_initialize(void);
 #endif
 
-  return ret;
-}
+#endif /* __INCLUDE_NUTTX_NOTE_NOTE_SYSVIEW_H */