Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 73 additions & 22 deletions ARM.CMSIS-Compiler.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<releases>
<release version="2.2.0-dev">
Active Development ...
Add components that enable stdio retarget to UART
AC6:
- Corrected _sys_read return value when rt_fs_read returns with error (#62)
IAR:
Expand Down Expand Up @@ -108,6 +109,11 @@
<require condition="CORE"/>
<require condition="CortexDevice_ITM"/>
</condition>
<condition id="CORE UART_CMSIS">
<description>CMSIS-Compiler CORE component and CMSIS-Driver USART</description>
<require condition="CORE"/>
<require Cclass="CMSIS Driver" Cgroup="USART"/>
</condition>

<condition id="ARMCC CORE">
<description>ARMCC and CORE component</description>
Expand Down Expand Up @@ -155,6 +161,13 @@
<require condition="CORE"/>
<require Cclass="CMSIS" Cgroup="RTOS2"/>
</condition>

<condition id="STDIO UART CMSIS">
<description>STDIO retarget to CMSIS Driver UART</description>
<accept Cclass="CMSIS-Compiler" Cgroup="STDERR" Csub="UART" Cvariant="CMSIS"/>
<accept Cclass="CMSIS-Compiler" Cgroup="STDIN" Csub="UART" Cvariant="CMSIS"/>
<accept Cclass="CMSIS-Compiler" Cgroup="STDOUT" Csub="UART" Cvariant="CMSIS"/>
</condition>
</conditions>
<taxonomy>
<description Cclass="CMSIS-Compiler" doc="documentation/html/index.html">Compiler Specific Interfaces</description>
Expand Down Expand Up @@ -215,28 +228,36 @@

<components>
<!-- Core -->
<component Cclass="CMSIS-Compiler" Cgroup="CORE" Cversion="1.1.1" condition="ARMCC CortexDevice">
<component Cclass="CMSIS-Compiler" Cgroup="CORE" Cversion="1.2.0" condition="ARMCC CortexDevice">
<description>Standard C Library Retarget Core</description>
<files>
<file category="sourceC" name="source/armcc/retarget_io.c"/>
<file category="sourceC" name="source/core/armcc/retarget_io.c"/>
<file category="sourceC" name="source/core/stdio_cmsis_uart.c" condition="STDIO UART CMSIS"/>
<file category="header" name="config/stdio_cmsis_uart_config.h" attr="config" version="1.0.0" condition="STDIO UART CMSIS"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="CORE" Cversion="1.1.0" condition="GCC CortexDevice">
<component Cclass="CMSIS-Compiler" Cgroup="CORE" Cversion="1.2.0" condition="GCC CortexDevice">
<description>Standard C Library Retarget Core</description>
<files>
<file category="sourceC" name="source/gcc/retarget_syscalls.c"/>
<file category="sourceC" name="source/core/gcc/retarget_syscalls.c"/>
<file category="sourceC" name="source/core/stdio_cmsis_uart.c" condition="STDIO UART CMSIS"/>
<file category="header" name="config/stdio_cmsis_uart_config.h" attr="config" version="1.0.0" condition="STDIO UART CMSIS"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="CORE" Cversion="1.1.0" condition="CLANG CortexDevice">
<component Cclass="CMSIS-Compiler" Cgroup="CORE" Cversion="1.2.0" condition="CLANG CortexDevice">
<description>Standard C Library Retarget Core</description>
<files>
<file category="sourceC" name="source/clang/retarget_syscalls.c"/>
<file category="sourceC" name="source/core/clang/retarget_syscalls.c"/>
<file category="sourceC" name="source/core/stdio_cmsis_uart.c" condition="STDIO UART CMSIS"/>
<file category="header" name="config/stdio_cmsis_uart_config.h" attr="config" version="1.0.0" condition="STDIO UART CMSIS"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="CORE" Cversion="1.2.0" condition="IAR CortexDevice">
<component Cclass="CMSIS-Compiler" Cgroup="CORE" Cversion="1.3.0" condition="IAR CortexDevice">
<description>Standard C Library Retarget Core</description>
<files>
<file category="sourceC" name="source/iar/retarget_io.c"/>
<file category="sourceC" name="source/core/iar/retarget_io.c"/>
<file category="sourceC" name="source/core/stdio_cmsis_uart.c" condition="STDIO UART CMSIS"/>
<file category="header" name="config/stdio_cmsis_uart_config.h" attr="config" version="1.0.0" condition="STDIO UART CMSIS"/>
</files>
</component>

Expand All @@ -259,7 +280,7 @@
#define RTE_CMSIS_Compiler_File_Interface_Breakpoint /* Compiler File Interface: Breakpoint */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/retarget_fs_bkpt.c"/>
<file category="sourceC" name="source/file_interface/retarget_fs_bkpt.c"/>
</files>
</component>

Expand All @@ -281,7 +302,7 @@
#define RTE_CMSIS_Compiler_STDERR_Breakpoint /* CMSIS-Compiler STDERR: Breakpoint */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/stderr_bkpt.c"/>
<file category="sourceC" name="source/stderr/stderr_bkpt.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="STDERR" Csub="Event Recorder" Capiversion="1.1.0" Cversion="1.1.0" condition="CORE EVR">
Expand All @@ -291,7 +312,7 @@
#define RTE_CMSIS_Compiler_STDERR_Event_Recorder /* CMSIS-Compiler STDERR: Event Recorder */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/stderr_evr.c"/>
<file category="sourceC" name="source/stderr/stderr_evr.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="STDERR" Csub="ITM" Capiversion="1.1.0" Cversion="1.1.0" condition="CORE ITM">
Expand All @@ -301,7 +322,17 @@
#define RTE_CMSIS_Compiler_STDERR_ITM /* CMSIS-Compiler STDERR: ITM */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/stderr_itm.c"/>
<file category="sourceC" name="source/stderr/stderr_itm.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="STDERR" Csub="UART" Cvariant="CMSIS" Capiversion="1.1.0" Cversion="1.0.0" condition="CORE UART_CMSIS">
<description>Redirect STDERR to a CMSIS-Driver USART</description>
<RTE_Components_h>
#define RTE_CMSIS_Compiler_STDERR /* CMSIS-Compiler STDERR */
#define RTE_CMSIS_Compiler_STDERR_UART_CMSIS /* CMSIS-Compiler STDERR: UART: CMSIS */
</RTE_Components_h>
<files>
<file category="header" name="config/stderr_cmsis_uart_config.h" attr="config" version="1.0.0"/>
</files>
</component>

Expand All @@ -323,7 +354,7 @@
#define RTE_CMSIS_Compiler_STDIN_Breakpoint /* CMSIS-Compiler STDIN: Breakpoint */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/stdin_bkpt.c"/>
<file category="sourceC" name="source/stdin/stdin_bkpt.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="STDIN" Csub="ITM" Capiversion="1.1.0" Cversion="1.1.0" condition="CORE ITM">
Expand All @@ -333,7 +364,17 @@
#define RTE_CMSIS_Compiler_STDIN_ITM /* CMSIS-Compiler STDIN: ITM */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/stdin_itm.c"/>
<file category="sourceC" name="source/stdin/stdin_itm.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="STDIN" Csub="UART" Cvariant="CMSIS" Capiversion="1.1.0" Cversion="1.0.0" condition="CORE UART_CMSIS">
<description>Retrieve STDIN from a CMSIS-Driver USART</description>
<RTE_Components_h>
#define RTE_CMSIS_Compiler_STDIN /* CMSIS-Compiler STDIN */
#define RTE_CMSIS_Compiler_STDIN_UART_CMSIS /* CMSIS-Compiler STDIN: UART: CMSIS */
</RTE_Components_h>
<files>
<file category="header" name="config/stdin_cmsis_uart_config.h" attr="config" version="1.0.0"/>
</files>
</component>

Expand All @@ -355,7 +396,7 @@
#define RTE_CMSIS_Compiler_STDOUT_Breakpoint /* CMSIS-Compiler STDOUT: Breakpoint */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/stdout_bkpt.c"/>
<file category="sourceC" name="source/stdout/stdout_bkpt.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="STDOUT" Csub="Event Recorder" Capiversion="1.1.0" Cversion="1.1.0" condition="CORE EVR">
Expand All @@ -365,7 +406,7 @@
#define RTE_CMSIS_Compiler_STDOUT_Event_Recorder /* CMSIS-Compiler STDOUT: Event Recorder */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/stdout_evr.c"/>
<file category="sourceC" name="source/stdout/stdout_evr.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="STDOUT" Csub="ITM" Capiversion="1.1.0" Cversion="1.1.0" condition="CORE ITM">
Expand All @@ -375,7 +416,17 @@
#define RTE_CMSIS_Compiler_STDOUT_ITM /* CMSIS-Compiler STDOUT: ITM */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/stdout_itm.c"/>
<file category="sourceC" name="source/stdout/stdout_itm.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="STDOUT" Csub="UART" Cvariant="CMSIS" Capiversion="1.1.0" Cversion="1.0.0" condition="CORE UART_CMSIS">
<description>Redirect STDOUT to a CMSIS-Driver USART</description>
<RTE_Components_h>
#define RTE_CMSIS_Compiler_STDOUT /* CMSIS-Compiler STDOUT */
#define RTE_CMSIS_Compiler_STDOUT_UART_CMSIS /* CMSIS-Compiler STDOUT: UART: CMSIS */
</RTE_Components_h>
<files>
<file category="header" name="config/stdout_cmsis_uart_config.h" attr="config" version="1.0.0"/>
</files>
</component>

Expand All @@ -397,7 +448,7 @@
#define RTE_CMSIS_Compiler_TTY_Breakpoint /* CMSIS-Compiler TTY: Breakpoint */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/tty_bkpt.c"/>
<file category="sourceC" name="source/tty/tty_bkpt.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="TTY" Csub="ITM" Capiversion="1.1.0" Cversion="1.1.0" condition="ARMCC CORE ITM">
Expand All @@ -407,7 +458,7 @@
#define RTE_CMSIS_Compiler_TTY_ITM /* CMSIS-Compiler TTY: ITM */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/tty_itm.c"/>
<file category="sourceC" name="source/tty/tty_itm.c"/>
</files>
</component>

Expand Down Expand Up @@ -443,7 +494,7 @@
#define RTE_CMSIS_Compiler_OS_Interface_RTOS2_LIBSPACE /* Implements per-thread static data management */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/armcc/retarget_os_rtos2.c"/>
<file category="sourceC" name="source/os_interface/armcc/retarget_os_rtos2.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="OS Interface" Csub="CMSIS-RTOS2" Capiversion="1.1.0" Cversion="2.1.0" condition="GCC CORE CMSIS-RTOS2">
Expand All @@ -455,7 +506,7 @@
#define RTE_CMSIS_Compiler_OS_Interface_RTOS2_LOCKS /* Implements locking routines */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/gcc/retarget_lock_rtos2.c"/>
<file category="sourceC" name="source/os_interface/gcc/retarget_lock_rtos2.c"/>
</files>
</component>
<component Cclass="CMSIS-Compiler" Cgroup="OS Interface" Csub="CMSIS-RTOS2" Capiversion="1.0.0" Cversion="2.0.0" condition="IAR CORE CMSIS-RTOS2">
Expand All @@ -467,7 +518,7 @@
#define RTE_CMSIS_Compiler_OS_Interface_RTOS2_LOCKS /* Implements locking routines */
</RTE_Components_h>
<files>
<file category="sourceC" name="source/iar/retarget_os_rtos2.c"/>
<file category="sourceC" name="source/os_interface/iar/retarget_os_rtos2.c"/>
</files>
</component>
</components>
Expand Down
59 changes: 59 additions & 0 deletions config/stderr_cmsis_uart_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------
* Copyright (c) 2026 Arm Limited (or its affiliates).
* All rights reserved.
*
* 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
*
* 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.
* --------------------------------------------------------------------------
*
* Purpose: Configure STDERR to CMSIS-Driver USART retarget implementation
* Revision: V1.0.0
*
* --------------------------------------------------------------------------*/

#ifndef STDERR_CMSIS_UART_CONFIG_H_
#define STDERR_CMSIS_UART_CONFIG_H_

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
//------ With VS Code: Open Preview for Configuration Wizard -------------------

// <o>UART STDERR Buffer Size
// <i> UART STDERR buffer is used to store STDERR data before sending it via UART
// <i> Default: 0 (unbuffered)
#ifndef STDERR_UART_BUFFER_SIZE
#define STDERR_UART_BUFFER_SIZE 0
#endif

// <s>UART STDERR Buffer Section Name
// <i> Specify the memory section name for UART STDERR buffer
// <i> Default: .stderr_uart_buf
#ifndef STDERR_UART_BUFFER_SECTION
#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf"
#endif

// <o>UART STDERR Buffer Alignment
// <i> Define the STDERR buffer alignment in bytes
// <i> Default: 32
#ifndef STDERR_UART_BUFFER_ALIGNMENT
#define STDERR_UART_BUFFER_ALIGNMENT 32
#endif

// <q>Convert LF to CRLF
// <i> If enabled, LF characters are preceded by CR characters on output
// <i> Default: 0
#ifndef STDERR_CR_LF
#define STDERR_CR_LF 0
#endif

#endif /* STDERR_CMSIS_UART_CONFIG_H_ */
59 changes: 59 additions & 0 deletions config/stdin_cmsis_uart_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*---------------------------------------------------------------------------
* Copyright (c) 2026 Arm Limited (or its affiliates).
* All rights reserved.
*
* 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
*
* 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.
* --------------------------------------------------------------------------
*
* Purpose: Configure STDIN to CMSIS-Driver USART retarget implementation
* Revision: V1.0.0
*
* --------------------------------------------------------------------------*/

#ifndef STDIN_CMSIS_UART_CONFIG_H_
#define STDIN_CMSIS_UART_CONFIG_H_

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
//------ With VS Code: Open Preview for Configuration Wizard -------------------

// <o>UART STDIN Buffer Size
// <i> UART STDIN buffer is used to store STDIN data received via UART
// <i> Default: 64
#ifndef STDIN_UART_BUFFER_SIZE
#define STDIN_UART_BUFFER_SIZE 64
#endif

// <s>UART STDIN Buffer Section Name
// <i> Specify the memory section name for UART STDIN buffer
// <i> Default: .stdin_uart_buf
#ifndef STDIN_UART_BUFFER_SECTION
#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf"
#endif

// <o>UART STDIN Buffer Alignment
// <i> Define the STDIN buffer alignment in bytes
// <i> Default: 32
#ifndef STDIN_UART_BUFFER_ALIGNMENT
#define STDIN_UART_BUFFER_ALIGNMENT 32
#endif

// <q>Echo Input Characters
// <i> If enabled, received characters are echoed to STDOUT
// <i> Default: 0
#ifndef STDIN_ECHO
#define STDIN_ECHO 0
#endif

#endif /* STDIN_CMSIS_UART_CONFIG_H_ */
Loading
Loading