mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 09:38:37 +08:00
drivers/segger: upgrade to v3.54
Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
@@ -1,29 +0,0 @@
|
|||||||
From 47aaa5806bc4679386de191ede6ffb8982a66975 Mon Sep 17 00:00:00 2001
|
|
||||||
From: "chao.an" <anchao@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 <anchao@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
|
|
||||||
|
|
||||||
@@ -18,38 +18,35 @@
|
|||||||
#
|
#
|
||||||
# ##############################################################################
|
# ##############################################################################
|
||||||
|
|
||||||
if(CONFIG_SEGGER_RTT)
|
if(CONFIG_SEGGER_RTT OR CONFIG_SEGGER_SYSVIEW)
|
||||||
|
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/SystemView)
|
||||||
|
|
||||||
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/RTT)
|
set(SYSVIEW_VERSION 354)
|
||||||
|
|
||||||
set(RTT_VERSION 7.54)
|
|
||||||
|
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
rtt
|
systemview
|
||||||
DOWNLOAD_NAME "RTT.zip"
|
DOWNLOAD_NAME "SystemView.zip"
|
||||||
DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
|
DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
|
||||||
URL "https://github.com/SEGGERMicro/RTT/archive/refs/tags/V${RTT_VERSION}.zip"
|
URL "https://www.segger.com/downloads/systemview/SystemView_Src_V${SYSVIEW_VERSION}.zip"
|
||||||
SOURCE_DIR
|
SOURCE_DIR
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RTT
|
${CMAKE_CURRENT_LIST_DIR}/SystemView
|
||||||
BINARY_DIR
|
BINARY_DIR
|
||||||
${CMAKE_BINARY_DIR}/RTT
|
${CMAKE_BINARY_DIR}/SystemView
|
||||||
PATCH_COMMAND
|
|
||||||
patch -p1 -d ${CMAKE_CURRENT_LIST_DIR} <
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/0001-segger-RTT-include-the-SEGGER_RTT_Conf.h-from-custom.patch
|
|
||||||
DOWNLOAD_NO_PROGRESS true
|
DOWNLOAD_NO_PROGRESS true
|
||||||
TIMEOUT 30)
|
TIMEOUT 30)
|
||||||
|
|
||||||
FetchContent_GetProperties(rtt)
|
FetchContent_GetProperties(systemview)
|
||||||
|
|
||||||
if(NOT rtt_POPULATED)
|
|
||||||
FetchContent_Populate(rtt)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
if(NOT systemview_POPULATED)
|
||||||
|
FetchContent_Populate(systemview)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(CONFIG_SEGGER_RTT)
|
||||||
nuttx_add_kernel_library(RTT)
|
nuttx_add_kernel_library(RTT)
|
||||||
|
|
||||||
set(RTT_SRCS RTT/RTT/SEGGER_RTT.c)
|
set(RTT_SRCS SystemView/SEGGER/SEGGER_RTT.c)
|
||||||
|
|
||||||
if(CONFIG_SEGGER_RTT_SECTION)
|
if(CONFIG_SEGGER_RTT_SECTION)
|
||||||
target_compile_options(
|
target_compile_options(
|
||||||
@@ -63,7 +60,7 @@ if(CONFIG_SEGGER_RTT)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_ARCH_ARMV7M)
|
if(CONFIG_ARCH_ARMV7M)
|
||||||
list(APPEND RTT_SRCS RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S)
|
list(APPEND RTT_SRCS SystemView/SEGGER/SEGGER_RTT_ASM_ARMv7M.S)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_STREAM_RTT)
|
if(CONFIG_STREAM_RTT)
|
||||||
@@ -82,46 +79,20 @@ if(CONFIG_SEGGER_RTT)
|
|||||||
list(APPEND RTT_SRCS serial_rtt.c)
|
list(APPEND RTT_SRCS serial_rtt.c)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_options(RTT PRIVATE -Wno-shadow -Wno-array-bounds)
|
target_compile_options(RTT PRIVATE -Wno-shadow -Wno-pointer-to-int-cast)
|
||||||
target_sources(RTT PRIVATE ${RTT_SRCS})
|
target_sources(RTT PRIVATE ${RTT_SRCS})
|
||||||
target_include_directories(RTT PRIVATE config RTT/RTT)
|
target_include_directories(RTT PRIVATE config SystemView/SEGGER)
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_SEGGER_SYSVIEW)
|
if(CONFIG_SEGGER_SYSVIEW)
|
||||||
|
|
||||||
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/SystemView)
|
|
||||||
|
|
||||||
set(SYSVIEW_VERSION 3.30)
|
|
||||||
|
|
||||||
FetchContent_Declare(
|
|
||||||
systemview
|
|
||||||
DOWNLOAD_NAME "SystemView.zip"
|
|
||||||
DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR}
|
|
||||||
URL "https://github.com/SEGGERMicro/SystemView/archive/refs/tags/V${SYSVIEW_VERSION}.zip"
|
|
||||||
SOURCE_DIR
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/SystemView
|
|
||||||
BINARY_DIR
|
|
||||||
${CMAKE_BINARY_DIR}/SystemView
|
|
||||||
DOWNLOAD_NO_PROGRESS true
|
|
||||||
TIMEOUT 30)
|
|
||||||
|
|
||||||
FetchContent_GetProperties(systemview)
|
|
||||||
|
|
||||||
if(NOT systemview_POPULATED)
|
|
||||||
FetchContent_Populate(systemview)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
nuttx_add_kernel_library(SystemView)
|
nuttx_add_kernel_library(SystemView)
|
||||||
|
|
||||||
target_compile_options(SystemView PRIVATE -Wno-shadow)
|
target_compile_options(SystemView PRIVATE -Wno-shadow
|
||||||
|
-Wno-pointer-to-int-cast)
|
||||||
target_sources(SystemView PRIVATE note_sysview.c
|
target_sources(SystemView PRIVATE note_sysview.c
|
||||||
SystemView/SYSVIEW/SEGGER_SYSVIEW.c)
|
SystemView/SEGGER/SEGGER_SYSVIEW.c)
|
||||||
|
|
||||||
target_include_directories(
|
target_include_directories(SystemView PRIVATE ${NUTTX_DIR}/sched config
|
||||||
SystemView PRIVATE ../../sched config RTT/RTT SystemView/SEGGER
|
RTT/RTT SystemView/SEGGER)
|
||||||
SystemView/SYSVIEW)
|
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
+15
-30
@@ -22,9 +22,9 @@ TARGET_ZIP =
|
|||||||
SGDIR = segger
|
SGDIR = segger
|
||||||
|
|
||||||
ifeq ($(CONFIG_SEGGER_RTT),y)
|
ifeq ($(CONFIG_SEGGER_RTT),y)
|
||||||
CSRCS += segger/RTT/RTT/SEGGER_RTT.c
|
CSRCS += segger/SystemView/SEGGER/SEGGER_RTT.c
|
||||||
|
|
||||||
CFLAGS += -Wno-shadow -Wno-array-bounds
|
CFLAGS += -Wno-shadow -Wno-pointer-to-int-cast
|
||||||
|
|
||||||
ifneq ($(CONFIG_SEGGER_RTT_SECTION),"")
|
ifneq ($(CONFIG_SEGGER_RTT_SECTION),"")
|
||||||
CFLAGS += ${DEFINE_PREFIX}SEGGER_RTT_SECTION=CONFIG_SEGGER_RTT_SECTION
|
CFLAGS += ${DEFINE_PREFIX}SEGGER_RTT_SECTION=CONFIG_SEGGER_RTT_SECTION
|
||||||
@@ -35,26 +35,11 @@ ifeq ($(CONFIG_SEGGER_RTT),y)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += ${INCDIR_PREFIX}segger$(DELIM)config
|
CFLAGS += ${INCDIR_PREFIX}segger$(DELIM)config
|
||||||
CFLAGS += ${INCDIR_PREFIX}segger$(DELIM)RTT$(DELIM)RTT
|
|
||||||
|
|
||||||
ifeq ($(CONFIG_ARCH_ARMV7M),y)
|
ifeq ($(CONFIG_ARCH_ARMV7M),y)
|
||||||
AFLAGS += ${INCDIR_PREFIX}segger$(DELIM)config
|
AFLAGS += ${INCDIR_PREFIX}segger$(DELIM)config
|
||||||
ASRCS += segger/RTT/RTT/SEGGER_RTT_ASM_ARMv7M.S
|
ASRCS += segger/SystemView/SEGGER/SEGGER_RTT_ASM_ARMv7M.S
|
||||||
endif
|
endif
|
||||||
|
|
||||||
RTT_VERSION ?= 7.54
|
|
||||||
|
|
||||||
# Download and unpack tarball if no git repo found
|
|
||||||
ifeq ($(wildcard $(SGDIR)/RTT/.git),)
|
|
||||||
$(SGDIR)/RTT.zip:
|
|
||||||
$(call DOWNLOAD,https://github.com/SEGGERMicro/RTT/archive/refs/tags,V$(RTT_VERSION).zip,$(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
|
|
||||||
endif
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_STREAM_RTT),y)
|
ifeq ($(CONFIG_STREAM_RTT),y)
|
||||||
@@ -75,22 +60,25 @@ endif
|
|||||||
|
|
||||||
ifeq ($(CONFIG_SEGGER_SYSVIEW),y)
|
ifeq ($(CONFIG_SEGGER_SYSVIEW),y)
|
||||||
CSRCS += segger/note_sysview.c
|
CSRCS += segger/note_sysview.c
|
||||||
CSRCS += segger/SystemView/SYSVIEW/SEGGER_SYSVIEW.c
|
CSRCS += segger/SystemView/SEGGER/SEGGER_SYSVIEW.c
|
||||||
|
|
||||||
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)sched
|
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)sched
|
||||||
CFLAGS += ${INCDIR_PREFIX}segger$(DELIM)SystemView$(DELIM)SEGGER
|
endif
|
||||||
CFLAGS += ${INCDIR_PREFIX}segger$(DELIM)SystemView$(DELIM)SYSVIEW
|
|
||||||
|
|
||||||
SYSVIEW_VERSION ?= 3.30
|
# Common settings for RTT and SYSTEMVIEW
|
||||||
|
ifneq ($(CONFIG_SEGGER_RTT)$(CONFIG_SEGGER_SYSVIEW),)
|
||||||
|
CFLAGS += ${INCDIR_PREFIX}segger$(DELIM)SystemView$(DELIM)SEGGER
|
||||||
|
|
||||||
|
SYSVIEW_VERSION ?= 354
|
||||||
|
SYSVIEW_ZIP = SystemView_Src_V$(SYSVIEW_VERSION).zip
|
||||||
|
|
||||||
# Download and unpack tarball if no git repo found
|
# Download and unpack tarball if no git repo found
|
||||||
ifeq ($(wildcard $(SGDIR)/SystemView/.git),)
|
ifeq ($(wildcard $(SGDIR)/SystemView/.git),)
|
||||||
$(SGDIR)/SystemView.zip:
|
TARGET_ZIP = $(SGDIR)/$(SYSVIEW_ZIP)
|
||||||
$(call DOWNLOAD,https://github.com/SEGGERMicro/SystemView/archive/refs/tags,V$(SYSVIEW_VERSION).zip,$(SGDIR)/SystemView.zip)
|
|
||||||
$(Q) unzip -o $(SGDIR)/SystemView.zip -d $(SGDIR)
|
|
||||||
$(Q) mv $(SGDIR)/SystemView-$(SYSVIEW_VERSION) $(SGDIR)/SystemView
|
|
||||||
|
|
||||||
TARGET_ZIP += $(SGDIR)/SystemView.zip
|
$(SGDIR)/$(SYSVIEW_ZIP):
|
||||||
|
$(call DOWNLOAD,https://www.segger.com/downloads/systemview,$(SYSVIEW_ZIP),$(TARGET_ZIP))
|
||||||
|
$(Q) unzip -o $(TARGET_ZIP) -d $(SGDIR)/SystemView
|
||||||
endif
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
@@ -100,8 +88,5 @@ context:: $(TARGET_ZIP)
|
|||||||
distclean::
|
distclean::
|
||||||
ifeq ($(wildcard $(SGDIR)/SystemView/.git),)
|
ifeq ($(wildcard $(SGDIR)/SystemView/.git),)
|
||||||
$(call DELDIR, $(SGDIR)/SystemView)
|
$(call DELDIR, $(SGDIR)/SystemView)
|
||||||
endif
|
|
||||||
ifeq ($(wildcard $(SGDIR)/RTT/.git),)
|
|
||||||
$(call DELDIR, $(SGDIR)/RTT)
|
|
||||||
endif
|
endif
|
||||||
$(call DELFILE, $(TARGET_ZIP))
|
$(call DELFILE, $(TARGET_ZIP))
|
||||||
|
|||||||
Reference in New Issue
Block a user