diff --git a/features/frameworks/mbed-trace/README.md b/features/frameworks/mbed-trace/README.md index f27ac6b429..cc3dc7697c 100644 --- a/features/frameworks/mbed-trace/README.md +++ b/features/frameworks/mbed-trace/README.md @@ -58,6 +58,7 @@ The purpose of the library is to provide a light, simple and general tracing sol ### Enabling the tracing API in mbed OS 5 +* Add the feature COMMON_PAL into the build * Set `MBED_CONF_MBED_TRACE_ENABLE` to 1 or true To do so, add the following to your mbed_app.json: @@ -66,6 +67,7 @@ To do so, add the following to your mbed_app.json: { "target_overrides": { "*": { + "target.features_add": ["COMMON_PAL"], "mbed-trace.enable": 1 } } diff --git a/features/frameworks/mbed-trace/mbed-trace/ns_trace.h b/features/frameworks/mbed-trace/mbed-trace/ns_trace.h new file mode 100644 index 0000000000..de9c6785ba --- /dev/null +++ b/features/frameworks/mbed-trace/mbed-trace/ns_trace.h @@ -0,0 +1,37 @@ +// ---------------------------------------------------------------------------- +// Copyright 2015-2021 Pelion. +// +// SPDX-License-Identifier: Apache-2.0 +// +// Licensed 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. +// ---------------------------------------------------------------------------- + +/** + * \file ns_trace.h + * Trace interface abstraction for NanoStack library as well as application. + * + * This file was moved to this library for legacy compatibility + * Actual used trace library is mbed-trace. For usage details check mbed_trace.h. + * + */ +#ifndef NS_TRACE_H_ +#define NS_TRACE_H_ + +#if defined(HAVE_DEBUG) && !defined(FEA_TRACE_SUPPORT) +#define FEA_TRACE_SUPPORT +#endif + +#include "ns_types.h" +#include "mbed-trace/mbed_trace.h" + +#endif /* NS_TRACE_H_ */ diff --git a/features/frameworks/mbed-trace/mbed_lib.json b/features/frameworks/mbed-trace/mbed_lib.json index f58ccb2ac1..cb1dadf366 100644 --- a/features/frameworks/mbed-trace/mbed_lib.json +++ b/features/frameworks/mbed-trace/mbed_lib.json @@ -14,15 +14,7 @@ "fea-ipv6": { "help": "Used to globally disable ipv6 tracing features.", "value": null - }, - "allocator": { - "value": "malloc", - "macro_name": "MEM_ALLOC" - }, - "deallocator": { - "value": "free", - "macro_name": "MEM_FREE" } - } + } } \ No newline at end of file diff --git a/features/frameworks/mbed-trace/source/mbed_trace.c b/features/frameworks/mbed-trace/source/mbed_trace.c index eba23ef2c7..20b1ca24a5 100644 --- a/features/frameworks/mbed-trace/source/mbed_trace.c +++ b/features/frameworks/mbed-trace/source/mbed_trace.c @@ -202,6 +202,7 @@ void mbed_trace_free(void) m_trace.line_length = DEFAULT_TRACE_LINE_LENGTH; m_trace.tmp_data = 0; m_trace.tmp_data_length = DEFAULT_TRACE_TMP_LINE_LEN; + m_trace.tmp_data_ptr = 0; m_trace.prefix_f = 0; m_trace.suffix_f = 0; m_trace.printf = mbed_trace_default_print;