From 422eec3280e5930ac1dbf7813a666b82a4f6fd37 Mon Sep 17 00:00:00 2001 From: Vladimir Umek Date: Tue, 3 Mar 2026 14:46:36 +0100 Subject: [PATCH 1/2] Update board layers - use UART&CMSIS component to retarget stdio - add v_path parameter to fvp_config.txt - correct default configuration for vStream VideoIn/Out - add base address workaround for SSE-320 UART - align README.md text - correct linker scripts (disable compression) --- ARM.AVH_FVP.pdsc | 20 +-- board/Corstone-300/Board-U55.clayer.yml | 9 +- board/Corstone-300/Board-U65.clayer.yml | 9 +- board/Corstone-300/Board.clayer.yml | 9 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-300-MPS3/vstream_video_in_config.h | 4 +- .../SSE-300-MPS3/ac6_linker_script.sct.src | 2 +- board/Corstone-300/fvp_config.txt | 2 +- board/Corstone-300/retarget_stdio.c | 161 ------------------ board/Corstone-310/Board-U55.clayer.yml | 11 +- board/Corstone-310/Board-U65.clayer.yml | 11 +- board/Corstone-310/Board.clayer.yml | 9 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../vstream_video_in_config.h | 4 +- board/Corstone-310/fvp_config.txt | 1 + board/Corstone-310/retarget_stdio.c | 161 ------------------ board/Corstone-315/Board-U65.clayer.yml | 11 +- board/Corstone-315/Board.clayer.yml | 9 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-315-FVP/vstream_video_in_config.h | 4 +- .../SSE-315-FVP/ac6_linker_script.sct.src | 2 +- board/Corstone-315/fvp_config.txt | 1 + board/Corstone-315/retarget_stdio.c | 161 ------------------ board/Corstone-320/Board-U85.clayer.yml | 14 +- board/Corstone-320/Board.clayer.yml | 12 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-320-FVP/vstream_video_in_config.h | 4 +- .../SSE-320-FVP/ac6_linker_script.sct.src | 2 +- .../RTE/Device/SSE-320-FVP/device_cfg.h | 6 + board/Corstone-320/fvp_config.txt | 3 +- board/Corstone-320/main.c | 19 +++ board/Corstone-320/retarget_stdio.c | 161 ------------------ example/FVP_Audio/FVP_Audio.csolution.yml | 8 +- .../board/Corstone-300/Board-U55.clayer.yml | 9 +- .../board/Corstone-300/Board-U65.clayer.yml | 9 +- .../board/Corstone-300/Board.clayer.yml | 9 +- .../FVP_Audio/board/Corstone-300/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-300-MPS3/vstream_video_in_config.h | 4 +- .../SSE-300-MPS3/ac6_linker_script.sct.src | 2 +- .../board/Corstone-300/fvp_config.txt | 1 + .../board/Corstone-300/retarget_stdio.c | 161 ------------------ .../board/Corstone-310/Board-U55.clayer.yml | 11 +- .../board/Corstone-310/Board-U65.clayer.yml | 11 +- .../board/Corstone-310/Board.clayer.yml | 9 +- .../FVP_Audio/board/Corstone-310/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../vstream_video_in_config.h | 4 +- .../board/Corstone-310/fvp_config.txt | 1 + .../board/Corstone-310/retarget_stdio.c | 161 ------------------ .../board/Corstone-315/Board-U65.clayer.yml | 11 +- .../board/Corstone-315/Board.clayer.yml | 9 +- .../FVP_Audio/board/Corstone-315/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-315-FVP/vstream_video_in_config.h | 4 +- .../SSE-315-FVP/ac6_linker_script.sct.src | 2 +- .../board/Corstone-315/fvp_config.txt | 1 + .../board/Corstone-315/retarget_stdio.c | 161 ------------------ .../board/Corstone-320/Board-U85.clayer.yml | 14 +- .../board/Corstone-320/Board.clayer.yml | 12 +- .../FVP_Audio/board/Corstone-320/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-320-FVP/vstream_video_in_config.h | 4 +- .../SSE-320-FVP/ac6_linker_script.sct.src | 2 +- .../RTE/Device/SSE-320-FVP/device_cfg.h | 6 + .../board/Corstone-320/fvp_config.txt | 3 +- example/FVP_Audio/board/Corstone-320/main.c | 19 +++ .../board/Corstone-320/retarget_stdio.c | 161 ------------------ .../board/Corstone-300/Board-U55.clayer.yml | 9 +- .../board/Corstone-300/Board-U65.clayer.yml | 9 +- .../board/Corstone-300/Board.clayer.yml | 9 +- .../FVP_Hello/board/Corstone-300/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-300-MPS3/ac6_linker_script.sct.src | 2 +- .../board/Corstone-300/fvp_config.txt | 1 + .../board/Corstone-300/retarget_stdio.c | 161 ------------------ .../board/Corstone-310/Board-U55.clayer.yml | 11 +- .../board/Corstone-310/Board-U65.clayer.yml | 11 +- .../board/Corstone-310/Board.clayer.yml | 9 +- .../FVP_Hello/board/Corstone-310/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../board/Corstone-310/fvp_config.txt | 1 + .../board/Corstone-310/retarget_stdio.c | 161 ------------------ .../board/Corstone-315/Board-U65.clayer.yml | 11 +- .../board/Corstone-315/Board.clayer.yml | 9 +- .../FVP_Hello/board/Corstone-315/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-315-FVP/ac6_linker_script.sct.src | 2 +- .../board/Corstone-315/fvp_config.txt | 1 + .../board/Corstone-315/retarget_stdio.c | 161 ------------------ .../board/Corstone-320/Board-U85.clayer.yml | 14 +- .../board/Corstone-320/Board.clayer.yml | 12 +- .../FVP_Hello/board/Corstone-320/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-320-FVP/ac6_linker_script.sct.src | 2 +- .../RTE/Device/SSE-320-FVP/device_cfg.h | 6 + .../board/Corstone-320/fvp_config.txt | 3 +- example/FVP_Hello/board/Corstone-320/main.c | 19 +++ .../board/Corstone-320/retarget_stdio.c | 161 ------------------ example/FVP_Video/FVP_Video.csolution.yml | 8 +- .../board/Corstone-300/Board-U55.clayer.yml | 9 +- .../board/Corstone-300/Board-U65.clayer.yml | 9 +- .../board/Corstone-300/Board.clayer.yml | 9 +- .../FVP_Video/board/Corstone-300/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-300-MPS3/ac6_linker_script.sct.src | 2 +- .../board/Corstone-300/fvp_config.txt | 1 + .../board/Corstone-300/retarget_stdio.c | 161 ------------------ .../board/Corstone-310/Board-U55.clayer.yml | 11 +- .../board/Corstone-310/Board-U65.clayer.yml | 11 +- .../board/Corstone-310/Board.clayer.yml | 9 +- .../FVP_Video/board/Corstone-310/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../board/Corstone-310/fvp_config.txt | 1 + .../board/Corstone-310/retarget_stdio.c | 161 ------------------ .../board/Corstone-315/Board-U65.clayer.yml | 11 +- .../board/Corstone-315/Board.clayer.yml | 9 +- .../FVP_Video/board/Corstone-315/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-315-FVP/ac6_linker_script.sct.src | 2 +- .../board/Corstone-315/fvp_config.txt | 1 + .../board/Corstone-315/retarget_stdio.c | 161 ------------------ .../board/Corstone-320/Board-U85.clayer.yml | 14 +- .../board/Corstone-320/Board.clayer.yml | 12 +- .../FVP_Video/board/Corstone-320/README.md | 7 +- .../CMSIS-Compiler/stderr_cmsis_uart_config.h | 59 +++++++ .../stderr_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdin_cmsis_uart_config.h | 59 +++++++ .../stdin_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../CMSIS-Compiler/stdio_cmsis_uart_config.h | 52 ++++++ .../stdio_cmsis_uart_config.h.base@1.0.0 | 52 ++++++ .../CMSIS-Compiler/stdout_cmsis_uart_config.h | 59 +++++++ .../stdout_cmsis_uart_config.h.base@1.0.0 | 59 +++++++ .../SSE-320-FVP/ac6_linker_script.sct.src | 2 +- .../RTE/Device/SSE-320-FVP/device_cfg.h | 6 + .../board/Corstone-320/fvp_config.txt | 3 +- example/FVP_Video/board/Corstone-320/main.c | 19 +++ .../board/Corstone-320/retarget_stdio.c | 161 ------------------ 243 files changed, 7758 insertions(+), 2863 deletions(-) create mode 100644 board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 board/Corstone-300/retarget_stdio.c create mode 100644 board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 board/Corstone-310/retarget_stdio.c create mode 100644 board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 board/Corstone-315/retarget_stdio.c create mode 100644 board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 board/Corstone-320/retarget_stdio.c create mode 100644 example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Audio/board/Corstone-300/retarget_stdio.c create mode 100644 example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Audio/board/Corstone-310/retarget_stdio.c create mode 100644 example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Audio/board/Corstone-315/retarget_stdio.c create mode 100644 example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Audio/board/Corstone-320/retarget_stdio.c create mode 100644 example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Hello/board/Corstone-300/retarget_stdio.c create mode 100644 example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Hello/board/Corstone-310/retarget_stdio.c create mode 100644 example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Hello/board/Corstone-315/retarget_stdio.c create mode 100644 example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Hello/board/Corstone-320/retarget_stdio.c create mode 100644 example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Video/board/Corstone-300/retarget_stdio.c create mode 100644 example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Video/board/Corstone-310/retarget_stdio.c create mode 100644 example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Video/board/Corstone-315/retarget_stdio.c create mode 100644 example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 create mode 100644 example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h create mode 100644 example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 delete mode 100644 example/FVP_Video/board/Corstone-320/retarget_stdio.c diff --git a/ARM.AVH_FVP.pdsc b/ARM.AVH_FVP.pdsc index ecdc71a6..011aa41f 100644 --- a/ARM.AVH_FVP.pdsc +++ b/ARM.AVH_FVP.pdsc @@ -257,18 +257,18 @@ - - - + + + - - - + + + - - + + - - + + diff --git a/board/Corstone-300/Board-U55.clayer.yml b/board/Corstone-300/Board-U55.clayer.yml index c8240455..c51093ab 100644 --- a/board/Corstone-300/Board-U55.clayer.yml +++ b/board/Corstone-300/Board-U55.clayer.yml @@ -26,7 +26,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -42,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -62,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/board/Corstone-300/Board-U65.clayer.yml b/board/Corstone-300/Board-U65.clayer.yml index 2da16e7b..b3b43821 100644 --- a/board/Corstone-300/Board-U65.clayer.yml +++ b/board/Corstone-300/Board-U65.clayer.yml @@ -26,7 +26,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -42,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -62,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/board/Corstone-300/Board.clayer.yml b/board/Corstone-300/Board.clayer.yml index 3ee2ac31..29a18554 100644 --- a/board/Corstone-300/Board.clayer.yml +++ b/board/Corstone-300/Board.clayer.yml @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -40,9 +40,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -57,7 +57,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-300/RTE/CMSIS_Driver/SSE-300-MPS3/vstream_video_in_config.h b/board/Corstone-300/RTE/CMSIS_Driver/SSE-300-MPS3/vstream_video_in_config.h index a4e79fef..fd1d7d06 100644 --- a/board/Corstone-300/RTE/CMSIS_Driver/SSE-300-MPS3/vstream_video_in_config.h +++ b/board/Corstone-300/RTE/CMSIS_Driver/SSE-300-MPS3/vstream_video_in_config.h @@ -27,7 +27,7 @@ // Common frame widths: 320, 640, 800, 1024. // Default: 640 #ifndef VIDEO_IN_FRAME_WIDTH -#define VIDEO_IN_FRAME_WIDTH 320 +#define VIDEO_IN_FRAME_WIDTH 640 #endif // Frame height @@ -35,7 +35,7 @@ // Common frame heights: 240, 480, 600, 768. // Default: 480 #ifndef VIDEO_IN_FRAME_HEIGHT -#define VIDEO_IN_FRAME_HEIGHT 240 +#define VIDEO_IN_FRAME_HEIGHT 480 #endif // Frame rate diff --git a/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src b/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src +++ b/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/board/Corstone-300/fvp_config.txt b/board/Corstone-300/fvp_config.txt index b58cdaec..01014db5 100644 --- a/board/Corstone-300/fvp_config.txt +++ b/board/Corstone-300/fvp_config.txt @@ -1,7 +1,6 @@ # Parameters: # instance.parameter=value #(type, mode) default = 'def value' : description : [min..max] #------------------------------------------------------------------------------ -ethosu.num_macs=256 # (int , init-time) default = '0x80' : Number of 8x8 MACs performed per cycle (32, 64, 128, or 256). : [0x20:0x100] mps3_board.telnetterminal0.quiet=1 # (bool , init-time) default = '0' : Avoid output on stdout/stderr mps3_board.telnetterminal0.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps3_board.telnetterminal1.quiet=1 # (bool , init-time) default = '0' : Avoid output on stdout/stderr @@ -12,5 +11,6 @@ mps3_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps3_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps3_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps3_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps3_board.v_path=./board/Corstone-300/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/board/Corstone-300/retarget_stdio.c b/board/Corstone-300/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/board/Corstone-300/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/board/Corstone-310/Board-U55.clayer.yml b/board/Corstone-310/Board-U55.clayer.yml index bb59123d..e240cbfb 100644 --- a/board/Corstone-310/Board-U55.clayer.yml +++ b/board/Corstone-310/Board-U55.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-310-MPS3_FVP connections: - - connect: Corstone-310 + - connect: Corstone-310-U55 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/board/Corstone-310/Board-U65.clayer.yml b/board/Corstone-310/Board-U65.clayer.yml index 8ef70264..be9db15f 100644 --- a/board/Corstone-310/Board-U65.clayer.yml +++ b/board/Corstone-310/Board-U65.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-310-MPS3_FVP connections: - - connect: Corstone-310 + - connect: Corstone-310-U65 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/board/Corstone-310/Board.clayer.yml b/board/Corstone-310/Board.clayer.yml index 72282d70..eb91f98c 100644 --- a/board/Corstone-310/Board.clayer.yml +++ b/board/Corstone-310/Board.clayer.yml @@ -24,7 +24,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -39,9 +39,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +56,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-310/RTE/CMSIS_Driver/SSE-310-MPS3_FVP/vstream_video_in_config.h b/board/Corstone-310/RTE/CMSIS_Driver/SSE-310-MPS3_FVP/vstream_video_in_config.h index a4e79fef..fd1d7d06 100644 --- a/board/Corstone-310/RTE/CMSIS_Driver/SSE-310-MPS3_FVP/vstream_video_in_config.h +++ b/board/Corstone-310/RTE/CMSIS_Driver/SSE-310-MPS3_FVP/vstream_video_in_config.h @@ -27,7 +27,7 @@ // Common frame widths: 320, 640, 800, 1024. // Default: 640 #ifndef VIDEO_IN_FRAME_WIDTH -#define VIDEO_IN_FRAME_WIDTH 320 +#define VIDEO_IN_FRAME_WIDTH 640 #endif // Frame height @@ -35,7 +35,7 @@ // Common frame heights: 240, 480, 600, 768. // Default: 480 #ifndef VIDEO_IN_FRAME_HEIGHT -#define VIDEO_IN_FRAME_HEIGHT 240 +#define VIDEO_IN_FRAME_HEIGHT 480 #endif // Frame rate diff --git a/board/Corstone-310/fvp_config.txt b/board/Corstone-310/fvp_config.txt index 5bc39098..ada8fb1d 100644 --- a/board/Corstone-310/fvp_config.txt +++ b/board/Corstone-310/fvp_config.txt @@ -12,5 +12,6 @@ mps3_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps3_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps3_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps3_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps3_board.v_path=./board/Corstone-310/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/board/Corstone-310/retarget_stdio.c b/board/Corstone-310/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/board/Corstone-310/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/board/Corstone-315/Board-U65.clayer.yml b/board/Corstone-315/Board-U65.clayer.yml index fa85a362..375f62ca 100644 --- a/board/Corstone-315/Board-U65.clayer.yml +++ b/board/Corstone-315/Board-U65.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-315-FVP connections: - - connect: Corstone-315 + - connect: Corstone-315-U65 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::SSE_315_BSP@1.0.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-315.h diff --git a/board/Corstone-315/Board.clayer.yml b/board/Corstone-315/Board.clayer.yml index 6ec589fb..c4d93eb6 100644 --- a/board/Corstone-315/Board.clayer.yml +++ b/board/Corstone-315/Board.clayer.yml @@ -24,7 +24,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::SSE_315_BSP@1.0.0 @@ -39,9 +39,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +56,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-315.h diff --git a/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-315/RTE/CMSIS_Driver/SSE-315-FVP/vstream_video_in_config.h b/board/Corstone-315/RTE/CMSIS_Driver/SSE-315-FVP/vstream_video_in_config.h index a4e79fef..fd1d7d06 100644 --- a/board/Corstone-315/RTE/CMSIS_Driver/SSE-315-FVP/vstream_video_in_config.h +++ b/board/Corstone-315/RTE/CMSIS_Driver/SSE-315-FVP/vstream_video_in_config.h @@ -27,7 +27,7 @@ // Common frame widths: 320, 640, 800, 1024. // Default: 640 #ifndef VIDEO_IN_FRAME_WIDTH -#define VIDEO_IN_FRAME_WIDTH 320 +#define VIDEO_IN_FRAME_WIDTH 640 #endif // Frame height @@ -35,7 +35,7 @@ // Common frame heights: 240, 480, 600, 768. // Default: 480 #ifndef VIDEO_IN_FRAME_HEIGHT -#define VIDEO_IN_FRAME_HEIGHT 240 +#define VIDEO_IN_FRAME_HEIGHT 480 #endif // Frame rate diff --git a/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src b/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src +++ b/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/board/Corstone-315/fvp_config.txt b/board/Corstone-315/fvp_config.txt index 72b59da8..b8d197c4 100644 --- a/board/Corstone-315/fvp_config.txt +++ b/board/Corstone-315/fvp_config.txt @@ -12,6 +12,7 @@ mps4_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps4_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps4_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps4_board.v_path=./board/Corstone-315/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps4_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation vis_hdlcd.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/board/Corstone-315/retarget_stdio.c b/board/Corstone-315/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/board/Corstone-315/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/board/Corstone-320/Board-U85.clayer.yml b/board/Corstone-320/Board-U85.clayer.yml index 8237e6d8..cd59bcea 100644 --- a/board/Corstone-320/Board-U85.clayer.yml +++ b/board/Corstone-320/Board-U85.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-320-FVP connections: - - connect: Corstone-320 + - connect: Corstone-320-U85 provides: - CMSIS_USART - CMSIS_VIO @@ -22,13 +22,14 @@ layer: - CMSIS_target_header: \"Corstone-320.h\" - ETHOSU85 - ARM_MODEL_USE_PMU_COUNTERS + - UART0_BASE_S_TMP packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - - pack: ARM::SSE_320_BSP@1.0.0 + - pack: ARM::SSE_320_BSP@1.1.0 components: - component: CMSIS:CORE @@ -41,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-320.h diff --git a/board/Corstone-320/Board.clayer.yml b/board/Corstone-320/Board.clayer.yml index d1a25e78..97e30a13 100644 --- a/board/Corstone-320/Board.clayer.yml +++ b/board/Corstone-320/Board.clayer.yml @@ -21,12 +21,13 @@ layer: define: - CMSIS_target_header: \"Corstone-320.h\" - ARM_MODEL_USE_PMU_COUNTERS + - UART0_BASE_S_TMP packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - - pack: ARM::SSE_320_BSP@1.0.0 + - pack: ARM::SSE_320_BSP@1.1.0 components: - component: CMSIS:CORE @@ -39,9 +40,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +57,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-320.h diff --git a/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/board/Corstone-320/RTE/CMSIS_Driver/SSE-320-FVP/vstream_video_in_config.h b/board/Corstone-320/RTE/CMSIS_Driver/SSE-320-FVP/vstream_video_in_config.h index a4e79fef..fd1d7d06 100644 --- a/board/Corstone-320/RTE/CMSIS_Driver/SSE-320-FVP/vstream_video_in_config.h +++ b/board/Corstone-320/RTE/CMSIS_Driver/SSE-320-FVP/vstream_video_in_config.h @@ -27,7 +27,7 @@ // Common frame widths: 320, 640, 800, 1024. // Default: 640 #ifndef VIDEO_IN_FRAME_WIDTH -#define VIDEO_IN_FRAME_WIDTH 320 +#define VIDEO_IN_FRAME_WIDTH 640 #endif // Frame height @@ -35,7 +35,7 @@ // Common frame heights: 240, 480, 600, 768. // Default: 480 #ifndef VIDEO_IN_FRAME_HEIGHT -#define VIDEO_IN_FRAME_HEIGHT 240 +#define VIDEO_IN_FRAME_HEIGHT 480 #endif // Frame rate diff --git a/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src b/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src +++ b/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h b/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h index 19e2c883..3a68938f 100644 --- a/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h +++ b/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h @@ -64,8 +64,14 @@ /* ARM UART Controller CMSDK */ #ifdef RTE_USART0 #define UART0_CMSDK_S +#ifdef UART0_BASE_S_TMP +/* Workaround for UART0 CMSDK base address mismatch */ +extern struct uart_cmsdk_dev_t UART0_CMSDK_DEV_S_TMP; +#define UART0_CMSDK_DEV UART0_CMSDK_DEV_S_TMP +#else #define UART0_CMSDK_DEV UART0_CMSDK_DEV_S #endif +#endif #ifdef RTE_USART1 #define UART1_CMSDK_S #define UART1_CMSDK_DEV UART1_CMSDK_DEV_S diff --git a/board/Corstone-320/fvp_config.txt b/board/Corstone-320/fvp_config.txt index faa69459..d40b2d89 100644 --- a/board/Corstone-320/fvp_config.txt +++ b/board/Corstone-320/fvp_config.txt @@ -1,7 +1,7 @@ # Parameters: # instance.parameter=value #(type, mode) default = 'def value' : description : [min..max] #------------------------------------------------------------------------------ -mps4_board.subsystem.ethosu.num_macs=1024 # (int , init-time) default = '0x400' : Number of 8x8 MACs performed per cycle (128, 256, 512, 1024, or 2048). : [0x80:0x800] +mps4_board.subsystem.ethosu.num_macs=256 # (int , init-time) default = '0x400' : Number of 8x8 MACs performed per cycle (128, 256, 512, 1024, or 2048). : [0x80:0x800] mps4_board.telnetterminal0.quiet=1 # (bool , init-time) default = '0' : Avoid output on stdout/stderr mps4_board.telnetterminal0.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.telnetterminal1.quiet=1 # (bool , init-time) default = '0' : Avoid output on stdout/stderr @@ -12,6 +12,7 @@ mps4_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps4_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps4_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps4_board.v_path=./board/Corstone-320/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps4_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation vis_hdlcd.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/board/Corstone-320/main.c b/board/Corstone-320/main.c index 69b34855..6d2b31ac 100644 --- a/board/Corstone-320/main.c +++ b/board/Corstone-320/main.c @@ -21,6 +21,25 @@ #include "main.h" +#ifdef UART0_BASE_S_TMP +/* Workaround for UART0 CMSDK base address mismatch */ +#include "uart_cmsdk_drv.h" + +static const struct uart_cmsdk_dev_cfg_t UART0_CMSDK_DEV_CFG_S_TMP = { + .base = 0x58203000 + 0x01100000, + .default_baudrate = 115200 +}; +static struct uart_cmsdk_dev_data_t UART0_CMSDK_DEV_DATA_S_TMP = { + .state = 0, + .system_clk = 0, + .baudrate = 0 +}; +struct uart_cmsdk_dev_t UART0_CMSDK_DEV_S_TMP = { + &(UART0_CMSDK_DEV_CFG_S_TMP), + &(UART0_CMSDK_DEV_DATA_S_TMP) +}; +#endif + int main (void) { /* Initialize STDIO */ diff --git a/board/Corstone-320/retarget_stdio.c b/board/Corstone-320/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/board/Corstone-320/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Audio/FVP_Audio.csolution.yml b/example/FVP_Audio/FVP_Audio.csolution.yml index a8552373..f6e479f8 100644 --- a/example/FVP_Audio/FVP_Audio.csolution.yml +++ b/example/FVP_Audio/FVP_Audio.csolution.yml @@ -28,7 +28,7 @@ solution: name: Arm-FVP model: FVP_Corstone_SSE-300 config-file: ./board/Corstone-300/fvp_config.txt - args: -C mps3_board.v_path=./board/Corstone-300/vsi/python/ + args: "" images: - project-context: FVP_Audio.Debug @@ -43,7 +43,7 @@ solution: name: Arm-FVP model: FVP_Corstone_SSE-310 config-file: ./board/Corstone-310/fvp_config.txt - args: -C mps3_board.v_path=./board/Corstone-310/vsi/python/ + args: "" images: - project-context: FVP_Audio.Debug @@ -58,7 +58,7 @@ solution: name: Arm-FVP model: FVP_Corstone_SSE-315 config-file: ./board/Corstone-315/fvp_config.txt - args: -C mps4_board.v_path=./board/Corstone-315/vsi/python/ + args: "" images: - project-context: FVP_Audio.Debug @@ -73,7 +73,7 @@ solution: name: Arm-FVP model: FVP_Corstone_SSE-320 config-file: ./board/Corstone-320/fvp_config.txt - args: -C mps4_board.v_path=./board/Corstone-320/vsi/python/ + args: "" images: - project-context: FVP_Audio.Debug diff --git a/example/FVP_Audio/board/Corstone-300/Board-U55.clayer.yml b/example/FVP_Audio/board/Corstone-300/Board-U55.clayer.yml index c8240455..c51093ab 100644 --- a/example/FVP_Audio/board/Corstone-300/Board-U55.clayer.yml +++ b/example/FVP_Audio/board/Corstone-300/Board-U55.clayer.yml @@ -26,7 +26,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -42,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -62,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/example/FVP_Audio/board/Corstone-300/Board-U65.clayer.yml b/example/FVP_Audio/board/Corstone-300/Board-U65.clayer.yml index 2da16e7b..b3b43821 100644 --- a/example/FVP_Audio/board/Corstone-300/Board-U65.clayer.yml +++ b/example/FVP_Audio/board/Corstone-300/Board-U65.clayer.yml @@ -26,7 +26,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -42,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -62,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/example/FVP_Audio/board/Corstone-300/Board.clayer.yml b/example/FVP_Audio/board/Corstone-300/Board.clayer.yml index 3ee2ac31..29a18554 100644 --- a/example/FVP_Audio/board/Corstone-300/Board.clayer.yml +++ b/example/FVP_Audio/board/Corstone-300/Board.clayer.yml @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -40,9 +40,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -57,7 +57,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/example/FVP_Audio/board/Corstone-300/README.md b/example/FVP_Audio/board/Corstone-300/README.md index 1d12f402..49bda6da 100644 --- a/example/FVP_Audio/board/Corstone-300/README.md +++ b/example/FVP_Audio/board/Corstone-300/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-300 FVP -Device: SSE-300-MPS3 +This layer works for: + +```yml + board: ARM::V2M-MPS3-SSE-300-FVP + device: ARM::SSE-300-MPS3 +``` ### System Configuration diff --git a/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-300/RTE/CMSIS_Driver/SSE-300-MPS3/vstream_video_in_config.h b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS_Driver/SSE-300-MPS3/vstream_video_in_config.h index a4e79fef..fd1d7d06 100644 --- a/example/FVP_Audio/board/Corstone-300/RTE/CMSIS_Driver/SSE-300-MPS3/vstream_video_in_config.h +++ b/example/FVP_Audio/board/Corstone-300/RTE/CMSIS_Driver/SSE-300-MPS3/vstream_video_in_config.h @@ -27,7 +27,7 @@ // Common frame widths: 320, 640, 800, 1024. // Default: 640 #ifndef VIDEO_IN_FRAME_WIDTH -#define VIDEO_IN_FRAME_WIDTH 320 +#define VIDEO_IN_FRAME_WIDTH 640 #endif // Frame height @@ -35,7 +35,7 @@ // Common frame heights: 240, 480, 600, 768. // Default: 480 #ifndef VIDEO_IN_FRAME_HEIGHT -#define VIDEO_IN_FRAME_HEIGHT 240 +#define VIDEO_IN_FRAME_HEIGHT 480 #endif // Frame rate diff --git a/example/FVP_Audio/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src b/example/FVP_Audio/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/example/FVP_Audio/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src +++ b/example/FVP_Audio/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/example/FVP_Audio/board/Corstone-300/fvp_config.txt b/example/FVP_Audio/board/Corstone-300/fvp_config.txt index 83488eb3..01014db5 100644 --- a/example/FVP_Audio/board/Corstone-300/fvp_config.txt +++ b/example/FVP_Audio/board/Corstone-300/fvp_config.txt @@ -11,5 +11,6 @@ mps3_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps3_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps3_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps3_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps3_board.v_path=./board/Corstone-300/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Audio/board/Corstone-300/retarget_stdio.c b/example/FVP_Audio/board/Corstone-300/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Audio/board/Corstone-300/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Audio/board/Corstone-310/Board-U55.clayer.yml b/example/FVP_Audio/board/Corstone-310/Board-U55.clayer.yml index bb59123d..e240cbfb 100644 --- a/example/FVP_Audio/board/Corstone-310/Board-U55.clayer.yml +++ b/example/FVP_Audio/board/Corstone-310/Board-U55.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-310-MPS3_FVP connections: - - connect: Corstone-310 + - connect: Corstone-310-U55 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/example/FVP_Audio/board/Corstone-310/Board-U65.clayer.yml b/example/FVP_Audio/board/Corstone-310/Board-U65.clayer.yml index 8ef70264..be9db15f 100644 --- a/example/FVP_Audio/board/Corstone-310/Board-U65.clayer.yml +++ b/example/FVP_Audio/board/Corstone-310/Board-U65.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-310-MPS3_FVP connections: - - connect: Corstone-310 + - connect: Corstone-310-U65 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/example/FVP_Audio/board/Corstone-310/Board.clayer.yml b/example/FVP_Audio/board/Corstone-310/Board.clayer.yml index 72282d70..eb91f98c 100644 --- a/example/FVP_Audio/board/Corstone-310/Board.clayer.yml +++ b/example/FVP_Audio/board/Corstone-310/Board.clayer.yml @@ -24,7 +24,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -39,9 +39,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +56,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/example/FVP_Audio/board/Corstone-310/README.md b/example/FVP_Audio/board/Corstone-310/README.md index a22bff32..43c0faa1 100644 --- a/example/FVP_Audio/board/Corstone-310/README.md +++ b/example/FVP_Audio/board/Corstone-310/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-310 FVP -Device: SSE-310-MPS3_FVP +This layer works for: + +```yml + board: ARM::V2M-MPS3-SSE-310 + device: ARM::SSE-310-MPS3_FVP +``` ### System Configuration diff --git a/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-310/RTE/CMSIS_Driver/SSE-310-MPS3_FVP/vstream_video_in_config.h b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS_Driver/SSE-310-MPS3_FVP/vstream_video_in_config.h index a4e79fef..fd1d7d06 100644 --- a/example/FVP_Audio/board/Corstone-310/RTE/CMSIS_Driver/SSE-310-MPS3_FVP/vstream_video_in_config.h +++ b/example/FVP_Audio/board/Corstone-310/RTE/CMSIS_Driver/SSE-310-MPS3_FVP/vstream_video_in_config.h @@ -27,7 +27,7 @@ // Common frame widths: 320, 640, 800, 1024. // Default: 640 #ifndef VIDEO_IN_FRAME_WIDTH -#define VIDEO_IN_FRAME_WIDTH 320 +#define VIDEO_IN_FRAME_WIDTH 640 #endif // Frame height @@ -35,7 +35,7 @@ // Common frame heights: 240, 480, 600, 768. // Default: 480 #ifndef VIDEO_IN_FRAME_HEIGHT -#define VIDEO_IN_FRAME_HEIGHT 240 +#define VIDEO_IN_FRAME_HEIGHT 480 #endif // Frame rate diff --git a/example/FVP_Audio/board/Corstone-310/fvp_config.txt b/example/FVP_Audio/board/Corstone-310/fvp_config.txt index 5bc39098..ada8fb1d 100644 --- a/example/FVP_Audio/board/Corstone-310/fvp_config.txt +++ b/example/FVP_Audio/board/Corstone-310/fvp_config.txt @@ -12,5 +12,6 @@ mps3_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps3_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps3_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps3_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps3_board.v_path=./board/Corstone-310/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Audio/board/Corstone-310/retarget_stdio.c b/example/FVP_Audio/board/Corstone-310/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Audio/board/Corstone-310/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Audio/board/Corstone-315/Board-U65.clayer.yml b/example/FVP_Audio/board/Corstone-315/Board-U65.clayer.yml index fa85a362..375f62ca 100644 --- a/example/FVP_Audio/board/Corstone-315/Board-U65.clayer.yml +++ b/example/FVP_Audio/board/Corstone-315/Board-U65.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-315-FVP connections: - - connect: Corstone-315 + - connect: Corstone-315-U65 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::SSE_315_BSP@1.0.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-315.h diff --git a/example/FVP_Audio/board/Corstone-315/Board.clayer.yml b/example/FVP_Audio/board/Corstone-315/Board.clayer.yml index 6ec589fb..c4d93eb6 100644 --- a/example/FVP_Audio/board/Corstone-315/Board.clayer.yml +++ b/example/FVP_Audio/board/Corstone-315/Board.clayer.yml @@ -24,7 +24,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::SSE_315_BSP@1.0.0 @@ -39,9 +39,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +56,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-315.h diff --git a/example/FVP_Audio/board/Corstone-315/README.md b/example/FVP_Audio/board/Corstone-315/README.md index 0c1b9fc6..6f4d0228 100644 --- a/example/FVP_Audio/board/Corstone-315/README.md +++ b/example/FVP_Audio/board/Corstone-315/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-315 FVP -Device: SSE-315-FVP +This layer works for: + +```yml + board: ARM::SSE-315 + device: ARM::SSE-315-FVP +``` ### System Configuration diff --git a/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-315/RTE/CMSIS_Driver/SSE-315-FVP/vstream_video_in_config.h b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS_Driver/SSE-315-FVP/vstream_video_in_config.h index a4e79fef..fd1d7d06 100644 --- a/example/FVP_Audio/board/Corstone-315/RTE/CMSIS_Driver/SSE-315-FVP/vstream_video_in_config.h +++ b/example/FVP_Audio/board/Corstone-315/RTE/CMSIS_Driver/SSE-315-FVP/vstream_video_in_config.h @@ -27,7 +27,7 @@ // Common frame widths: 320, 640, 800, 1024. // Default: 640 #ifndef VIDEO_IN_FRAME_WIDTH -#define VIDEO_IN_FRAME_WIDTH 320 +#define VIDEO_IN_FRAME_WIDTH 640 #endif // Frame height @@ -35,7 +35,7 @@ // Common frame heights: 240, 480, 600, 768. // Default: 480 #ifndef VIDEO_IN_FRAME_HEIGHT -#define VIDEO_IN_FRAME_HEIGHT 240 +#define VIDEO_IN_FRAME_HEIGHT 480 #endif // Frame rate diff --git a/example/FVP_Audio/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src b/example/FVP_Audio/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/example/FVP_Audio/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src +++ b/example/FVP_Audio/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/example/FVP_Audio/board/Corstone-315/fvp_config.txt b/example/FVP_Audio/board/Corstone-315/fvp_config.txt index 72b59da8..b8d197c4 100644 --- a/example/FVP_Audio/board/Corstone-315/fvp_config.txt +++ b/example/FVP_Audio/board/Corstone-315/fvp_config.txt @@ -12,6 +12,7 @@ mps4_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps4_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps4_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps4_board.v_path=./board/Corstone-315/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps4_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation vis_hdlcd.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Audio/board/Corstone-315/retarget_stdio.c b/example/FVP_Audio/board/Corstone-315/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Audio/board/Corstone-315/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Audio/board/Corstone-320/Board-U85.clayer.yml b/example/FVP_Audio/board/Corstone-320/Board-U85.clayer.yml index 8237e6d8..cd59bcea 100644 --- a/example/FVP_Audio/board/Corstone-320/Board-U85.clayer.yml +++ b/example/FVP_Audio/board/Corstone-320/Board-U85.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-320-FVP connections: - - connect: Corstone-320 + - connect: Corstone-320-U85 provides: - CMSIS_USART - CMSIS_VIO @@ -22,13 +22,14 @@ layer: - CMSIS_target_header: \"Corstone-320.h\" - ETHOSU85 - ARM_MODEL_USE_PMU_COUNTERS + - UART0_BASE_S_TMP packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - - pack: ARM::SSE_320_BSP@1.0.0 + - pack: ARM::SSE_320_BSP@1.1.0 components: - component: CMSIS:CORE @@ -41,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-320.h diff --git a/example/FVP_Audio/board/Corstone-320/Board.clayer.yml b/example/FVP_Audio/board/Corstone-320/Board.clayer.yml index d1a25e78..97e30a13 100644 --- a/example/FVP_Audio/board/Corstone-320/Board.clayer.yml +++ b/example/FVP_Audio/board/Corstone-320/Board.clayer.yml @@ -21,12 +21,13 @@ layer: define: - CMSIS_target_header: \"Corstone-320.h\" - ARM_MODEL_USE_PMU_COUNTERS + - UART0_BASE_S_TMP packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - - pack: ARM::SSE_320_BSP@1.0.0 + - pack: ARM::SSE_320_BSP@1.1.0 components: - component: CMSIS:CORE @@ -39,9 +40,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +57,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-320.h diff --git a/example/FVP_Audio/board/Corstone-320/README.md b/example/FVP_Audio/board/Corstone-320/README.md index b2489e0e..0fd62fe6 100644 --- a/example/FVP_Audio/board/Corstone-320/README.md +++ b/example/FVP_Audio/board/Corstone-320/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-320 FVP -Device: SSE-320-FVP +This layer works for: + +```yml + board: ARM::SSE-320 + device: ARM::SSE-320-FVP +``` ### System Configuration diff --git a/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Audio/board/Corstone-320/RTE/CMSIS_Driver/SSE-320-FVP/vstream_video_in_config.h b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS_Driver/SSE-320-FVP/vstream_video_in_config.h index a4e79fef..fd1d7d06 100644 --- a/example/FVP_Audio/board/Corstone-320/RTE/CMSIS_Driver/SSE-320-FVP/vstream_video_in_config.h +++ b/example/FVP_Audio/board/Corstone-320/RTE/CMSIS_Driver/SSE-320-FVP/vstream_video_in_config.h @@ -27,7 +27,7 @@ // Common frame widths: 320, 640, 800, 1024. // Default: 640 #ifndef VIDEO_IN_FRAME_WIDTH -#define VIDEO_IN_FRAME_WIDTH 320 +#define VIDEO_IN_FRAME_WIDTH 640 #endif // Frame height @@ -35,7 +35,7 @@ // Common frame heights: 240, 480, 600, 768. // Default: 480 #ifndef VIDEO_IN_FRAME_HEIGHT -#define VIDEO_IN_FRAME_HEIGHT 240 +#define VIDEO_IN_FRAME_HEIGHT 480 #endif // Frame rate diff --git a/example/FVP_Audio/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src b/example/FVP_Audio/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/example/FVP_Audio/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src +++ b/example/FVP_Audio/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/example/FVP_Audio/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h b/example/FVP_Audio/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h index 19e2c883..3a68938f 100644 --- a/example/FVP_Audio/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h +++ b/example/FVP_Audio/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h @@ -64,8 +64,14 @@ /* ARM UART Controller CMSDK */ #ifdef RTE_USART0 #define UART0_CMSDK_S +#ifdef UART0_BASE_S_TMP +/* Workaround for UART0 CMSDK base address mismatch */ +extern struct uart_cmsdk_dev_t UART0_CMSDK_DEV_S_TMP; +#define UART0_CMSDK_DEV UART0_CMSDK_DEV_S_TMP +#else #define UART0_CMSDK_DEV UART0_CMSDK_DEV_S #endif +#endif #ifdef RTE_USART1 #define UART1_CMSDK_S #define UART1_CMSDK_DEV UART1_CMSDK_DEV_S diff --git a/example/FVP_Audio/board/Corstone-320/fvp_config.txt b/example/FVP_Audio/board/Corstone-320/fvp_config.txt index faa69459..d40b2d89 100644 --- a/example/FVP_Audio/board/Corstone-320/fvp_config.txt +++ b/example/FVP_Audio/board/Corstone-320/fvp_config.txt @@ -1,7 +1,7 @@ # Parameters: # instance.parameter=value #(type, mode) default = 'def value' : description : [min..max] #------------------------------------------------------------------------------ -mps4_board.subsystem.ethosu.num_macs=1024 # (int , init-time) default = '0x400' : Number of 8x8 MACs performed per cycle (128, 256, 512, 1024, or 2048). : [0x80:0x800] +mps4_board.subsystem.ethosu.num_macs=256 # (int , init-time) default = '0x400' : Number of 8x8 MACs performed per cycle (128, 256, 512, 1024, or 2048). : [0x80:0x800] mps4_board.telnetterminal0.quiet=1 # (bool , init-time) default = '0' : Avoid output on stdout/stderr mps4_board.telnetterminal0.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.telnetterminal1.quiet=1 # (bool , init-time) default = '0' : Avoid output on stdout/stderr @@ -12,6 +12,7 @@ mps4_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps4_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps4_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps4_board.v_path=./board/Corstone-320/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps4_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation vis_hdlcd.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Audio/board/Corstone-320/main.c b/example/FVP_Audio/board/Corstone-320/main.c index 69b34855..6d2b31ac 100644 --- a/example/FVP_Audio/board/Corstone-320/main.c +++ b/example/FVP_Audio/board/Corstone-320/main.c @@ -21,6 +21,25 @@ #include "main.h" +#ifdef UART0_BASE_S_TMP +/* Workaround for UART0 CMSDK base address mismatch */ +#include "uart_cmsdk_drv.h" + +static const struct uart_cmsdk_dev_cfg_t UART0_CMSDK_DEV_CFG_S_TMP = { + .base = 0x58203000 + 0x01100000, + .default_baudrate = 115200 +}; +static struct uart_cmsdk_dev_data_t UART0_CMSDK_DEV_DATA_S_TMP = { + .state = 0, + .system_clk = 0, + .baudrate = 0 +}; +struct uart_cmsdk_dev_t UART0_CMSDK_DEV_S_TMP = { + &(UART0_CMSDK_DEV_CFG_S_TMP), + &(UART0_CMSDK_DEV_DATA_S_TMP) +}; +#endif + int main (void) { /* Initialize STDIO */ diff --git a/example/FVP_Audio/board/Corstone-320/retarget_stdio.c b/example/FVP_Audio/board/Corstone-320/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Audio/board/Corstone-320/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Hello/board/Corstone-300/Board-U55.clayer.yml b/example/FVP_Hello/board/Corstone-300/Board-U55.clayer.yml index c8240455..c51093ab 100644 --- a/example/FVP_Hello/board/Corstone-300/Board-U55.clayer.yml +++ b/example/FVP_Hello/board/Corstone-300/Board-U55.clayer.yml @@ -26,7 +26,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -42,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -62,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/example/FVP_Hello/board/Corstone-300/Board-U65.clayer.yml b/example/FVP_Hello/board/Corstone-300/Board-U65.clayer.yml index 2da16e7b..b3b43821 100644 --- a/example/FVP_Hello/board/Corstone-300/Board-U65.clayer.yml +++ b/example/FVP_Hello/board/Corstone-300/Board-U65.clayer.yml @@ -26,7 +26,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -42,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -62,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/example/FVP_Hello/board/Corstone-300/Board.clayer.yml b/example/FVP_Hello/board/Corstone-300/Board.clayer.yml index 3ee2ac31..29a18554 100644 --- a/example/FVP_Hello/board/Corstone-300/Board.clayer.yml +++ b/example/FVP_Hello/board/Corstone-300/Board.clayer.yml @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -40,9 +40,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -57,7 +57,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/example/FVP_Hello/board/Corstone-300/README.md b/example/FVP_Hello/board/Corstone-300/README.md index 1d12f402..49bda6da 100644 --- a/example/FVP_Hello/board/Corstone-300/README.md +++ b/example/FVP_Hello/board/Corstone-300/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-300 FVP -Device: SSE-300-MPS3 +This layer works for: + +```yml + board: ARM::V2M-MPS3-SSE-300-FVP + device: ARM::SSE-300-MPS3 +``` ### System Configuration diff --git a/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src b/example/FVP_Hello/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/example/FVP_Hello/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src +++ b/example/FVP_Hello/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/example/FVP_Hello/board/Corstone-300/fvp_config.txt b/example/FVP_Hello/board/Corstone-300/fvp_config.txt index 83488eb3..01014db5 100644 --- a/example/FVP_Hello/board/Corstone-300/fvp_config.txt +++ b/example/FVP_Hello/board/Corstone-300/fvp_config.txt @@ -11,5 +11,6 @@ mps3_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps3_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps3_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps3_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps3_board.v_path=./board/Corstone-300/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Hello/board/Corstone-300/retarget_stdio.c b/example/FVP_Hello/board/Corstone-300/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Hello/board/Corstone-300/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Hello/board/Corstone-310/Board-U55.clayer.yml b/example/FVP_Hello/board/Corstone-310/Board-U55.clayer.yml index bb59123d..e240cbfb 100644 --- a/example/FVP_Hello/board/Corstone-310/Board-U55.clayer.yml +++ b/example/FVP_Hello/board/Corstone-310/Board-U55.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-310-MPS3_FVP connections: - - connect: Corstone-310 + - connect: Corstone-310-U55 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/example/FVP_Hello/board/Corstone-310/Board-U65.clayer.yml b/example/FVP_Hello/board/Corstone-310/Board-U65.clayer.yml index 8ef70264..be9db15f 100644 --- a/example/FVP_Hello/board/Corstone-310/Board-U65.clayer.yml +++ b/example/FVP_Hello/board/Corstone-310/Board-U65.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-310-MPS3_FVP connections: - - connect: Corstone-310 + - connect: Corstone-310-U65 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/example/FVP_Hello/board/Corstone-310/Board.clayer.yml b/example/FVP_Hello/board/Corstone-310/Board.clayer.yml index 72282d70..eb91f98c 100644 --- a/example/FVP_Hello/board/Corstone-310/Board.clayer.yml +++ b/example/FVP_Hello/board/Corstone-310/Board.clayer.yml @@ -24,7 +24,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -39,9 +39,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +56,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/example/FVP_Hello/board/Corstone-310/README.md b/example/FVP_Hello/board/Corstone-310/README.md index a22bff32..43c0faa1 100644 --- a/example/FVP_Hello/board/Corstone-310/README.md +++ b/example/FVP_Hello/board/Corstone-310/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-310 FVP -Device: SSE-310-MPS3_FVP +This layer works for: + +```yml + board: ARM::V2M-MPS3-SSE-310 + device: ARM::SSE-310-MPS3_FVP +``` ### System Configuration diff --git a/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-310/fvp_config.txt b/example/FVP_Hello/board/Corstone-310/fvp_config.txt index 5bc39098..ada8fb1d 100644 --- a/example/FVP_Hello/board/Corstone-310/fvp_config.txt +++ b/example/FVP_Hello/board/Corstone-310/fvp_config.txt @@ -12,5 +12,6 @@ mps3_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps3_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps3_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps3_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps3_board.v_path=./board/Corstone-310/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Hello/board/Corstone-310/retarget_stdio.c b/example/FVP_Hello/board/Corstone-310/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Hello/board/Corstone-310/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Hello/board/Corstone-315/Board-U65.clayer.yml b/example/FVP_Hello/board/Corstone-315/Board-U65.clayer.yml index fa85a362..375f62ca 100644 --- a/example/FVP_Hello/board/Corstone-315/Board-U65.clayer.yml +++ b/example/FVP_Hello/board/Corstone-315/Board-U65.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-315-FVP connections: - - connect: Corstone-315 + - connect: Corstone-315-U65 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::SSE_315_BSP@1.0.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-315.h diff --git a/example/FVP_Hello/board/Corstone-315/Board.clayer.yml b/example/FVP_Hello/board/Corstone-315/Board.clayer.yml index 6ec589fb..c4d93eb6 100644 --- a/example/FVP_Hello/board/Corstone-315/Board.clayer.yml +++ b/example/FVP_Hello/board/Corstone-315/Board.clayer.yml @@ -24,7 +24,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::SSE_315_BSP@1.0.0 @@ -39,9 +39,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +56,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-315.h diff --git a/example/FVP_Hello/board/Corstone-315/README.md b/example/FVP_Hello/board/Corstone-315/README.md index 0c1b9fc6..6f4d0228 100644 --- a/example/FVP_Hello/board/Corstone-315/README.md +++ b/example/FVP_Hello/board/Corstone-315/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-315 FVP -Device: SSE-315-FVP +This layer works for: + +```yml + board: ARM::SSE-315 + device: ARM::SSE-315-FVP +``` ### System Configuration diff --git a/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src b/example/FVP_Hello/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/example/FVP_Hello/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src +++ b/example/FVP_Hello/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/example/FVP_Hello/board/Corstone-315/fvp_config.txt b/example/FVP_Hello/board/Corstone-315/fvp_config.txt index 72b59da8..b8d197c4 100644 --- a/example/FVP_Hello/board/Corstone-315/fvp_config.txt +++ b/example/FVP_Hello/board/Corstone-315/fvp_config.txt @@ -12,6 +12,7 @@ mps4_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps4_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps4_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps4_board.v_path=./board/Corstone-315/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps4_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation vis_hdlcd.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Hello/board/Corstone-315/retarget_stdio.c b/example/FVP_Hello/board/Corstone-315/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Hello/board/Corstone-315/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Hello/board/Corstone-320/Board-U85.clayer.yml b/example/FVP_Hello/board/Corstone-320/Board-U85.clayer.yml index 8237e6d8..cd59bcea 100644 --- a/example/FVP_Hello/board/Corstone-320/Board-U85.clayer.yml +++ b/example/FVP_Hello/board/Corstone-320/Board-U85.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-320-FVP connections: - - connect: Corstone-320 + - connect: Corstone-320-U85 provides: - CMSIS_USART - CMSIS_VIO @@ -22,13 +22,14 @@ layer: - CMSIS_target_header: \"Corstone-320.h\" - ETHOSU85 - ARM_MODEL_USE_PMU_COUNTERS + - UART0_BASE_S_TMP packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - - pack: ARM::SSE_320_BSP@1.0.0 + - pack: ARM::SSE_320_BSP@1.1.0 components: - component: CMSIS:CORE @@ -41,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-320.h diff --git a/example/FVP_Hello/board/Corstone-320/Board.clayer.yml b/example/FVP_Hello/board/Corstone-320/Board.clayer.yml index d1a25e78..97e30a13 100644 --- a/example/FVP_Hello/board/Corstone-320/Board.clayer.yml +++ b/example/FVP_Hello/board/Corstone-320/Board.clayer.yml @@ -21,12 +21,13 @@ layer: define: - CMSIS_target_header: \"Corstone-320.h\" - ARM_MODEL_USE_PMU_COUNTERS + - UART0_BASE_S_TMP packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - - pack: ARM::SSE_320_BSP@1.0.0 + - pack: ARM::SSE_320_BSP@1.1.0 components: - component: CMSIS:CORE @@ -39,9 +40,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +57,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-320.h diff --git a/example/FVP_Hello/board/Corstone-320/README.md b/example/FVP_Hello/board/Corstone-320/README.md index b2489e0e..0fd62fe6 100644 --- a/example/FVP_Hello/board/Corstone-320/README.md +++ b/example/FVP_Hello/board/Corstone-320/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-320 FVP -Device: SSE-320-FVP +This layer works for: + +```yml + board: ARM::SSE-320 + device: ARM::SSE-320-FVP +``` ### System Configuration diff --git a/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Hello/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Hello/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src b/example/FVP_Hello/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/example/FVP_Hello/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src +++ b/example/FVP_Hello/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/example/FVP_Hello/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h b/example/FVP_Hello/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h index 19e2c883..3a68938f 100644 --- a/example/FVP_Hello/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h +++ b/example/FVP_Hello/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h @@ -64,8 +64,14 @@ /* ARM UART Controller CMSDK */ #ifdef RTE_USART0 #define UART0_CMSDK_S +#ifdef UART0_BASE_S_TMP +/* Workaround for UART0 CMSDK base address mismatch */ +extern struct uart_cmsdk_dev_t UART0_CMSDK_DEV_S_TMP; +#define UART0_CMSDK_DEV UART0_CMSDK_DEV_S_TMP +#else #define UART0_CMSDK_DEV UART0_CMSDK_DEV_S #endif +#endif #ifdef RTE_USART1 #define UART1_CMSDK_S #define UART1_CMSDK_DEV UART1_CMSDK_DEV_S diff --git a/example/FVP_Hello/board/Corstone-320/fvp_config.txt b/example/FVP_Hello/board/Corstone-320/fvp_config.txt index faa69459..d40b2d89 100644 --- a/example/FVP_Hello/board/Corstone-320/fvp_config.txt +++ b/example/FVP_Hello/board/Corstone-320/fvp_config.txt @@ -1,7 +1,7 @@ # Parameters: # instance.parameter=value #(type, mode) default = 'def value' : description : [min..max] #------------------------------------------------------------------------------ -mps4_board.subsystem.ethosu.num_macs=1024 # (int , init-time) default = '0x400' : Number of 8x8 MACs performed per cycle (128, 256, 512, 1024, or 2048). : [0x80:0x800] +mps4_board.subsystem.ethosu.num_macs=256 # (int , init-time) default = '0x400' : Number of 8x8 MACs performed per cycle (128, 256, 512, 1024, or 2048). : [0x80:0x800] mps4_board.telnetterminal0.quiet=1 # (bool , init-time) default = '0' : Avoid output on stdout/stderr mps4_board.telnetterminal0.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.telnetterminal1.quiet=1 # (bool , init-time) default = '0' : Avoid output on stdout/stderr @@ -12,6 +12,7 @@ mps4_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps4_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps4_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps4_board.v_path=./board/Corstone-320/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps4_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation vis_hdlcd.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Hello/board/Corstone-320/main.c b/example/FVP_Hello/board/Corstone-320/main.c index 69b34855..6d2b31ac 100644 --- a/example/FVP_Hello/board/Corstone-320/main.c +++ b/example/FVP_Hello/board/Corstone-320/main.c @@ -21,6 +21,25 @@ #include "main.h" +#ifdef UART0_BASE_S_TMP +/* Workaround for UART0 CMSDK base address mismatch */ +#include "uart_cmsdk_drv.h" + +static const struct uart_cmsdk_dev_cfg_t UART0_CMSDK_DEV_CFG_S_TMP = { + .base = 0x58203000 + 0x01100000, + .default_baudrate = 115200 +}; +static struct uart_cmsdk_dev_data_t UART0_CMSDK_DEV_DATA_S_TMP = { + .state = 0, + .system_clk = 0, + .baudrate = 0 +}; +struct uart_cmsdk_dev_t UART0_CMSDK_DEV_S_TMP = { + &(UART0_CMSDK_DEV_CFG_S_TMP), + &(UART0_CMSDK_DEV_DATA_S_TMP) +}; +#endif + int main (void) { /* Initialize STDIO */ diff --git a/example/FVP_Hello/board/Corstone-320/retarget_stdio.c b/example/FVP_Hello/board/Corstone-320/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Hello/board/Corstone-320/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Video/FVP_Video.csolution.yml b/example/FVP_Video/FVP_Video.csolution.yml index 1a774505..c3b34a5c 100644 --- a/example/FVP_Video/FVP_Video.csolution.yml +++ b/example/FVP_Video/FVP_Video.csolution.yml @@ -28,7 +28,7 @@ solution: name: Arm-FVP model: FVP_Corstone_SSE-300 config-file: ./board/Corstone-300/fvp_config.txt - args: -C mps3_board.v_path=./board/Corstone-300/vsi/python/ + args: "" images: - project-context: FVP_Video.Debug @@ -43,7 +43,7 @@ solution: name: Arm-FVP model: FVP_Corstone_SSE-310 config-file: ./board/Corstone-310/fvp_config.txt - args: -C mps3_board.v_path=./board/Corstone-310/vsi/python/ + args: "" images: - project-context: FVP_Video.Debug @@ -58,7 +58,7 @@ solution: name: Arm-FVP model: FVP_Corstone_SSE-315 config-file: ./board/Corstone-315/fvp_config.txt - args: -C mps4_board.v_path=./board/Corstone-315/vsi/python/ + args: "" images: - project-context: FVP_Video.Debug @@ -73,7 +73,7 @@ solution: name: Arm-FVP model: FVP_Corstone_SSE-320 config-file: ./board/Corstone-320/fvp_config.txt - args: -C mps4_board.v_path=./board/Corstone-320/vsi/python/ + args: "" images: - project-context: FVP_Video.Debug diff --git a/example/FVP_Video/board/Corstone-300/Board-U55.clayer.yml b/example/FVP_Video/board/Corstone-300/Board-U55.clayer.yml index c8240455..c51093ab 100644 --- a/example/FVP_Video/board/Corstone-300/Board-U55.clayer.yml +++ b/example/FVP_Video/board/Corstone-300/Board-U55.clayer.yml @@ -26,7 +26,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -42,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -62,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/example/FVP_Video/board/Corstone-300/Board-U65.clayer.yml b/example/FVP_Video/board/Corstone-300/Board-U65.clayer.yml index 2da16e7b..b3b43821 100644 --- a/example/FVP_Video/board/Corstone-300/Board-U65.clayer.yml +++ b/example/FVP_Video/board/Corstone-300/Board-U65.clayer.yml @@ -26,7 +26,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -42,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -62,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/example/FVP_Video/board/Corstone-300/Board.clayer.yml b/example/FVP_Video/board/Corstone-300/Board.clayer.yml index 3ee2ac31..29a18554 100644 --- a/example/FVP_Video/board/Corstone-300/Board.clayer.yml +++ b/example/FVP_Video/board/Corstone-300/Board.clayer.yml @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0 @@ -40,9 +40,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -57,7 +57,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-300.h diff --git a/example/FVP_Video/board/Corstone-300/README.md b/example/FVP_Video/board/Corstone-300/README.md index 1d12f402..49bda6da 100644 --- a/example/FVP_Video/board/Corstone-300/README.md +++ b/example/FVP_Video/board/Corstone-300/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-300 FVP -Device: SSE-300-MPS3 +This layer works for: + +```yml + board: ARM::V2M-MPS3-SSE-300-FVP + device: ARM::SSE-300-MPS3 +``` ### System Configuration diff --git a/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Video/board/Corstone-300/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src b/example/FVP_Video/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/example/FVP_Video/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src +++ b/example/FVP_Video/board/Corstone-300/RTE/Device/SSE-300-MPS3/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/example/FVP_Video/board/Corstone-300/fvp_config.txt b/example/FVP_Video/board/Corstone-300/fvp_config.txt index 83488eb3..01014db5 100644 --- a/example/FVP_Video/board/Corstone-300/fvp_config.txt +++ b/example/FVP_Video/board/Corstone-300/fvp_config.txt @@ -11,5 +11,6 @@ mps3_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps3_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps3_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps3_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps3_board.v_path=./board/Corstone-300/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Video/board/Corstone-300/retarget_stdio.c b/example/FVP_Video/board/Corstone-300/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Video/board/Corstone-300/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Video/board/Corstone-310/Board-U55.clayer.yml b/example/FVP_Video/board/Corstone-310/Board-U55.clayer.yml index bb59123d..e240cbfb 100644 --- a/example/FVP_Video/board/Corstone-310/Board-U55.clayer.yml +++ b/example/FVP_Video/board/Corstone-310/Board-U55.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-310-MPS3_FVP connections: - - connect: Corstone-310 + - connect: Corstone-310-U55 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/example/FVP_Video/board/Corstone-310/Board-U65.clayer.yml b/example/FVP_Video/board/Corstone-310/Board-U65.clayer.yml index 8ef70264..be9db15f 100644 --- a/example/FVP_Video/board/Corstone-310/Board-U65.clayer.yml +++ b/example/FVP_Video/board/Corstone-310/Board-U65.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-310-MPS3_FVP connections: - - connect: Corstone-310 + - connect: Corstone-310-U65 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/example/FVP_Video/board/Corstone-310/Board.clayer.yml b/example/FVP_Video/board/Corstone-310/Board.clayer.yml index 72282d70..eb91f98c 100644 --- a/example/FVP_Video/board/Corstone-310/Board.clayer.yml +++ b/example/FVP_Video/board/Corstone-310/Board.clayer.yml @@ -24,7 +24,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0 @@ -39,9 +39,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +56,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-310.h diff --git a/example/FVP_Video/board/Corstone-310/README.md b/example/FVP_Video/board/Corstone-310/README.md index a22bff32..43c0faa1 100644 --- a/example/FVP_Video/board/Corstone-310/README.md +++ b/example/FVP_Video/board/Corstone-310/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-310 FVP -Device: SSE-310-MPS3_FVP +This layer works for: + +```yml + board: ARM::V2M-MPS3-SSE-310 + device: ARM::SSE-310-MPS3_FVP +``` ### System Configuration diff --git a/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Video/board/Corstone-310/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-310/fvp_config.txt b/example/FVP_Video/board/Corstone-310/fvp_config.txt index 5bc39098..ada8fb1d 100644 --- a/example/FVP_Video/board/Corstone-310/fvp_config.txt +++ b/example/FVP_Video/board/Corstone-310/fvp_config.txt @@ -12,5 +12,6 @@ mps3_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps3_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps3_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps3_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps3_board.v_path=./board/Corstone-310/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps3_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Video/board/Corstone-310/retarget_stdio.c b/example/FVP_Video/board/Corstone-310/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Video/board/Corstone-310/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Video/board/Corstone-315/Board-U65.clayer.yml b/example/FVP_Video/board/Corstone-315/Board-U65.clayer.yml index fa85a362..375f62ca 100644 --- a/example/FVP_Video/board/Corstone-315/Board-U65.clayer.yml +++ b/example/FVP_Video/board/Corstone-315/Board-U65.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-315-FVP connections: - - connect: Corstone-315 + - connect: Corstone-315-U65 provides: - CMSIS_USART - CMSIS_VIO @@ -25,7 +25,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - pack: ARM::SSE_315_BSP@1.0.0 @@ -41,9 +41,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +61,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-315.h diff --git a/example/FVP_Video/board/Corstone-315/Board.clayer.yml b/example/FVP_Video/board/Corstone-315/Board.clayer.yml index 6ec589fb..c4d93eb6 100644 --- a/example/FVP_Video/board/Corstone-315/Board.clayer.yml +++ b/example/FVP_Video/board/Corstone-315/Board.clayer.yml @@ -24,7 +24,7 @@ layer: packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - pack: ARM::SSE_315_BSP@1.0.0 @@ -39,9 +39,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +56,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-315.h diff --git a/example/FVP_Video/board/Corstone-315/README.md b/example/FVP_Video/board/Corstone-315/README.md index 0c1b9fc6..6f4d0228 100644 --- a/example/FVP_Video/board/Corstone-315/README.md +++ b/example/FVP_Video/board/Corstone-315/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-315 FVP -Device: SSE-315-FVP +This layer works for: + +```yml + board: ARM::SSE-315 + device: ARM::SSE-315-FVP +``` ### System Configuration diff --git a/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Video/board/Corstone-315/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src b/example/FVP_Video/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/example/FVP_Video/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src +++ b/example/FVP_Video/board/Corstone-315/RTE/Device/SSE-315-FVP/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/example/FVP_Video/board/Corstone-315/fvp_config.txt b/example/FVP_Video/board/Corstone-315/fvp_config.txt index 72b59da8..b8d197c4 100644 --- a/example/FVP_Video/board/Corstone-315/fvp_config.txt +++ b/example/FVP_Video/board/Corstone-315/fvp_config.txt @@ -12,6 +12,7 @@ mps4_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps4_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps4_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps4_board.v_path=./board/Corstone-315/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps4_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation vis_hdlcd.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Video/board/Corstone-315/retarget_stdio.c b/example/FVP_Video/board/Corstone-315/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Video/board/Corstone-315/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file diff --git a/example/FVP_Video/board/Corstone-320/Board-U85.clayer.yml b/example/FVP_Video/board/Corstone-320/Board-U85.clayer.yml index 8237e6d8..cd59bcea 100644 --- a/example/FVP_Video/board/Corstone-320/Board-U85.clayer.yml +++ b/example/FVP_Video/board/Corstone-320/Board-U85.clayer.yml @@ -5,7 +5,7 @@ layer: for-device: ARM::SSE-320-FVP connections: - - connect: Corstone-320 + - connect: Corstone-320-U85 provides: - CMSIS_USART - CMSIS_VIO @@ -22,13 +22,14 @@ layer: - CMSIS_target_header: \"Corstone-320.h\" - ETHOSU85 - ARM_MODEL_USE_PMU_COUNTERS + - UART0_BASE_S_TMP packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::ethos-u-core-driver@^1.25.2 - pack: ARM::AVH_FVP - - pack: ARM::SSE_320_BSP@1.0.0 + - pack: ARM::SSE_320_BSP@1.1.0 components: - component: CMSIS:CORE @@ -41,9 +42,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -61,7 +62,6 @@ layer: - file: ./main.c - file: ./main.h - file: ./ethos_setup.c - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-320.h diff --git a/example/FVP_Video/board/Corstone-320/Board.clayer.yml b/example/FVP_Video/board/Corstone-320/Board.clayer.yml index d1a25e78..97e30a13 100644 --- a/example/FVP_Video/board/Corstone-320/Board.clayer.yml +++ b/example/FVP_Video/board/Corstone-320/Board.clayer.yml @@ -21,12 +21,13 @@ layer: define: - CMSIS_target_header: \"Corstone-320.h\" - ARM_MODEL_USE_PMU_COUNTERS + - UART0_BASE_S_TMP packs: - pack: ARM::CMSIS - - pack: ARM::CMSIS-Compiler@^2.1.0 + - pack: ARM::CMSIS-Compiler@^2.2.0 - pack: ARM::AVH_FVP - - pack: ARM::SSE_320_BSP@1.0.0 + - pack: ARM::SSE_320_BSP@1.1.0 components: - component: CMSIS:CORE @@ -39,9 +40,9 @@ layer: - component: CMSIS Driver:vStream:VideoOut - component: CMSIS-Compiler:CORE - - component: CMSIS-Compiler:STDERR:Custom - - component: CMSIS-Compiler:STDIN:Custom - - component: CMSIS-Compiler:STDOUT:Custom + - component: CMSIS-Compiler:STDERR:UART&CMSIS + - component: CMSIS-Compiler:STDIN:UART&CMSIS + - component: CMSIS-Compiler:STDOUT:UART&CMSIS - component: Device:Definition - component: Device:Startup&C Startup @@ -56,7 +57,6 @@ layer: files: - file: ./main.c - file: ./main.h - - file: ./retarget_stdio.c linker: - regions: ./regions_SSE-320.h diff --git a/example/FVP_Video/board/Corstone-320/README.md b/example/FVP_Video/board/Corstone-320/README.md index b2489e0e..0fd62fe6 100644 --- a/example/FVP_Video/board/Corstone-320/README.md +++ b/example/FVP_Video/board/Corstone-320/README.md @@ -2,7 +2,12 @@ ## Board Layer for Corstone-320 FVP -Device: SSE-320-FVP +This layer works for: + +```yml + board: ARM::SSE-320 + device: ARM::SSE-320-FVP +``` ### System Configuration diff --git a/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h new file mode 100644 index 00000000..d6a30a31 --- /dev/null +++ b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 1 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..192648e0 --- /dev/null +++ b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stderr_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDERR Buffer Size +// UART STDERR buffer is used to store STDERR data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDERR_UART_BUFFER_SIZE +#define STDERR_UART_BUFFER_SIZE 0 +#endif + +// UART STDERR Buffer Section Name +// Specify the memory section name for UART STDERR buffer +// Default: .stderr_uart_buf +#ifndef STDERR_UART_BUFFER_SECTION +#define STDERR_UART_BUFFER_SECTION ".stderr_uart_buf" +#endif + +// UART STDERR Buffer Alignment +// Define the STDERR buffer alignment in bytes +// Default: 32 +#ifndef STDERR_UART_BUFFER_ALIGNMENT +#define STDERR_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDERR_CR_LF +#define STDERR_CR_LF 0 +#endif + +#endif /* STDERR_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..bce0ba24 --- /dev/null +++ b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdin_cmsis_uart_config.h.base@1.0.0 @@ -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 ------------------- + +// UART STDIN Buffer Size +// UART STDIN buffer is used to store STDIN data received via UART +// Default: 64 +#ifndef STDIN_UART_BUFFER_SIZE +#define STDIN_UART_BUFFER_SIZE 64 +#endif + +// UART STDIN Buffer Section Name +// Specify the memory section name for UART STDIN buffer +// Default: .stdin_uart_buf +#ifndef STDIN_UART_BUFFER_SECTION +#define STDIN_UART_BUFFER_SECTION ".stdin_uart_buf" +#endif + +// UART STDIN Buffer Alignment +// Define the STDIN buffer alignment in bytes +// Default: 32 +#ifndef STDIN_UART_BUFFER_ALIGNMENT +#define STDIN_UART_BUFFER_ALIGNMENT 32 +#endif + +// Echo Input Characters +// If enabled, received characters are echoed to STDOUT +// Default: 0 +#ifndef STDIN_ECHO +#define STDIN_ECHO 0 +#endif + +#endif /* STDIN_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..aeeca61f --- /dev/null +++ b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdio_cmsis_uart_config.h.base@1.0.0 @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------- + * 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: STDIO to CMSIS Driver USART Retarget Configuration + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDIO_CMSIS_UART_CONFIG_H_ +#define STDIO_CMSIS_UART_CONFIG_H_ + +#ifdef CMSIS_target_header +#include CMSIS_target_header +#else +#define RETARGET_STDIO_UART 0 +#endif + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// Connect to hardware via Driver_USART# +// Select driver control block for hardware interface +// Default: 0 +#ifndef STDIO_UART_DRIVER +#define STDIO_UART_DRIVER RETARGET_STDIO_UART +#endif + +// UART baudrate +// Specifies the baudrate for UART communication +// Common values: 9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600 +// Default: 115200 +#ifndef STDIO_UART_BAUDRATE +#define STDIO_UART_BAUDRATE 115200 +#endif + +#endif /* STDIO_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h new file mode 100644 index 00000000..3cdc2aea --- /dev/null +++ b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 1 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 new file mode 100644 index 00000000..323d2176 --- /dev/null +++ b/example/FVP_Video/board/Corstone-320/RTE/CMSIS-Compiler/stdout_cmsis_uart_config.h.base@1.0.0 @@ -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 STDOUT to CMSIS-Driver USART retarget implementation + * Revision: V1.0.0 + * + * --------------------------------------------------------------------------*/ + +#ifndef STDOUT_CMSIS_UART_CONFIG_H_ +#define STDOUT_CMSIS_UART_CONFIG_H_ + +//-------- <<< Use Configuration Wizard in Context Menu >>> -------------------- +//------ With VS Code: Open Preview for Configuration Wizard ------------------- + +// UART STDOUT Buffer Size +// UART STDOUT buffer is used to store STDOUT data before sending it via UART +// Default: 0 (unbuffered) +#ifndef STDOUT_UART_BUFFER_SIZE +#define STDOUT_UART_BUFFER_SIZE 0 +#endif + +// UART STDOUT Buffer Section Name +// Specify the memory section name for UART STDOUT buffer +// Default: .stdout_uart_buf +#ifndef STDOUT_UART_BUFFER_SECTION +#define STDOUT_UART_BUFFER_SECTION ".stdout_uart_buf" +#endif + +// UART STDOUT Buffer Alignment +// Define the buffer alignment in bytes +// Default: 32 +#ifndef STDOUT_UART_BUFFER_ALIGNMENT +#define STDOUT_UART_BUFFER_ALIGNMENT 32 +#endif + +// Convert LF to CRLF +// If enabled, LF characters are preceded by CR characters on output +// Default: 0 +#ifndef STDOUT_CR_LF +#define STDOUT_CR_LF 0 +#endif + +#endif /* STDOUT_CMSIS_UART_CONFIG_H_ */ diff --git a/example/FVP_Video/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src b/example/FVP_Video/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src index 220ca387..4db620c1 100644 --- a/example/FVP_Video/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src +++ b/example/FVP_Video/board/Corstone-320/RTE/Device/SSE-320-FVP/ac6_linker_script.sct.src @@ -50,7 +50,7 @@ LR_ROM1 __ROM1_BASE __ROM1_SIZE { } } -LR_RAM0 __RAM0_BASE { +LR_RAM0 __RAM0_BASE NOCOMPRESS { RW_NOINIT __RAM0_BASE UNINIT (__RAM0_SIZE - __HEAP_SIZE - __STACK_SIZE - __STACKSEAL_SIZE) { *.o(.bss.noinit) diff --git a/example/FVP_Video/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h b/example/FVP_Video/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h index 19e2c883..3a68938f 100644 --- a/example/FVP_Video/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h +++ b/example/FVP_Video/board/Corstone-320/RTE/Device/SSE-320-FVP/device_cfg.h @@ -64,8 +64,14 @@ /* ARM UART Controller CMSDK */ #ifdef RTE_USART0 #define UART0_CMSDK_S +#ifdef UART0_BASE_S_TMP +/* Workaround for UART0 CMSDK base address mismatch */ +extern struct uart_cmsdk_dev_t UART0_CMSDK_DEV_S_TMP; +#define UART0_CMSDK_DEV UART0_CMSDK_DEV_S_TMP +#else #define UART0_CMSDK_DEV UART0_CMSDK_DEV_S #endif +#endif #ifdef RTE_USART1 #define UART1_CMSDK_S #define UART1_CMSDK_DEV UART1_CMSDK_DEV_S diff --git a/example/FVP_Video/board/Corstone-320/fvp_config.txt b/example/FVP_Video/board/Corstone-320/fvp_config.txt index faa69459..d40b2d89 100644 --- a/example/FVP_Video/board/Corstone-320/fvp_config.txt +++ b/example/FVP_Video/board/Corstone-320/fvp_config.txt @@ -1,7 +1,7 @@ # Parameters: # instance.parameter=value #(type, mode) default = 'def value' : description : [min..max] #------------------------------------------------------------------------------ -mps4_board.subsystem.ethosu.num_macs=1024 # (int , init-time) default = '0x400' : Number of 8x8 MACs performed per cycle (128, 256, 512, 1024, or 2048). : [0x80:0x800] +mps4_board.subsystem.ethosu.num_macs=256 # (int , init-time) default = '0x400' : Number of 8x8 MACs performed per cycle (128, 256, 512, 1024, or 2048). : [0x80:0x800] mps4_board.telnetterminal0.quiet=1 # (bool , init-time) default = '0' : Avoid output on stdout/stderr mps4_board.telnetterminal0.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.telnetterminal1.quiet=1 # (bool , init-time) default = '0' : Avoid output on stdout/stderr @@ -12,6 +12,7 @@ mps4_board.telnetterminal5.quiet=1 # (bool , init-time) defa mps4_board.telnetterminal5.start_telnet=0 # (bool , init-time) default = '1' : Start telnet if nothing connected mps4_board.uart0.out_file=- # (string, init-time) default = '' : Output file to hold data written by the UART (use '-' to send all output to stdout) mps4_board.uart0.shutdown_on_eot=1 # (bool , init-time) default = '0' : Shutdown simulation when a EOT (ASCII 4) char is transmitted (useful for regression tests when semihosting is not available) +mps4_board.v_path=./board/Corstone-320/vsi/python/ # (string, init-time) default = '' : Specify path to python folder with scripts for both of VSI and VIO mps4_board.visualisation.disable-visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation vis_hdlcd.disable_visualisation=1 # (bool , init-time) default = '0' : Enable/disable visualisation #------------------------------------------------------------------------------ diff --git a/example/FVP_Video/board/Corstone-320/main.c b/example/FVP_Video/board/Corstone-320/main.c index 69b34855..6d2b31ac 100644 --- a/example/FVP_Video/board/Corstone-320/main.c +++ b/example/FVP_Video/board/Corstone-320/main.c @@ -21,6 +21,25 @@ #include "main.h" +#ifdef UART0_BASE_S_TMP +/* Workaround for UART0 CMSDK base address mismatch */ +#include "uart_cmsdk_drv.h" + +static const struct uart_cmsdk_dev_cfg_t UART0_CMSDK_DEV_CFG_S_TMP = { + .base = 0x58203000 + 0x01100000, + .default_baudrate = 115200 +}; +static struct uart_cmsdk_dev_data_t UART0_CMSDK_DEV_DATA_S_TMP = { + .state = 0, + .system_clk = 0, + .baudrate = 0 +}; +struct uart_cmsdk_dev_t UART0_CMSDK_DEV_S_TMP = { + &(UART0_CMSDK_DEV_CFG_S_TMP), + &(UART0_CMSDK_DEV_DATA_S_TMP) +}; +#endif + int main (void) { /* Initialize STDIO */ diff --git a/example/FVP_Video/board/Corstone-320/retarget_stdio.c b/example/FVP_Video/board/Corstone-320/retarget_stdio.c deleted file mode 100644 index f553eedf..00000000 --- a/example/FVP_Video/board/Corstone-320/retarget_stdio.c +++ /dev/null @@ -1,161 +0,0 @@ -/*--------------------------------------------------------------------------- - * Copyright (c) 2025 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. - * - * Name: retarget_stdio.c - * Purpose: Retarget stdio to CMSIS UART - * - *---------------------------------------------------------------------------*/ - -#ifdef CMSIS_target_header -#include CMSIS_target_header -#else -#include "Driver_USART.h" -#endif - -#ifndef RETARGET_STDIO_UART -#error "RETARGET_STDIO_UART not defined!" -#endif - -/* Compile-time configuration */ -#ifndef UART_BAUDRATE -#define UART_BAUDRATE 115200 -#endif - -/* References to the external retarget functions */ -extern int stdio_init (void); -extern int stderr_putchar (int ch); -extern int stdout_putchar (int ch); -extern int stdin_getchar (void); - -/* Reference to the underlying USART driver */ -#ifndef CMSIS_target_header -extern ARM_DRIVER_USART ARM_Driver_USART_(RETARGET_STDIO_UART); -#endif -#define ptrUSART (&ARM_Driver_USART_(RETARGET_STDIO_UART)) - -/** - Initialize stdio - - \return 0 on success, or -1 on error. -*/ -int stdio_init (void) { - - if (ptrUSART->Initialize(NULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->PowerControl(ARM_POWER_FULL) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_MODE_ASYNCHRONOUS | - ARM_USART_DATA_BITS_8 | - ARM_USART_PARITY_NONE | - ARM_USART_STOP_BITS_1 | - ARM_USART_FLOW_CONTROL_NONE, - UART_BAUDRATE) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_RX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - if (ptrUSART->Control(ARM_USART_CONTROL_TX, 1U) != ARM_DRIVER_OK) { - return -1; - } - - return 0; -} - -/** - Put a character to the stderr - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stderr_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Put a character to the stdout - - \param[in] ch Character to output - \return The character written, or -1 on write error. -*/ -int stdout_putchar (int ch) { - uint8_t buf[1]; - - if (ch == '\n') { - buf[0] = (uint8_t)'\r'; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - } - - buf[0] = (uint8_t)ch; - - if (ptrUSART->Send(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().tx_busy != 0U); - - return ch; -} - -/** - Get a character from the stdio - - \return The next character from the input, or -1 on read error. -*/ -int stdin_getchar (void) { - uint8_t buf[1]; - - if (ptrUSART->Receive(buf, 1U) != ARM_DRIVER_OK) { - return -1; - } - - while (ptrUSART->GetStatus().rx_busy != 0U); - - return (int)buf[0]; -} \ No newline at end of file From 6d78b5656891081ee30d9da607bb326c82cb0934 Mon Sep 17 00:00:00 2001 From: Vladimir Umek Date: Wed, 4 Mar 2026 13:17:26 +0100 Subject: [PATCH 2/2] workflows: remove v_path specification, extend simlimit, enable SSE-320 UART check --- .github/workflows/Build_Run_FVP_Audio.yml | 5 +---- .github/workflows/Build_Run_FVP_Hello.yml | 4 +--- .github/workflows/Build_Run_FVP_Video.yml | 5 +---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/Build_Run_FVP_Audio.yml b/.github/workflows/Build_Run_FVP_Audio.yml index eabf173a..b1bcc7ea 100644 --- a/.github/workflows/Build_Run_FVP_Audio.yml +++ b/.github/workflows/Build_Run_FVP_Audio.yml @@ -118,9 +118,8 @@ jobs: ${{ matrix.context.model }} \ -a ./out/${{matrix.context.proj}}/${{matrix.context.target_type}}/${{matrix.context.build_type}}/${{matrix.context.proj}}.${{matrix.toolchain.ext}} \ -f ./board/${{matrix.context.layer}}/fvp_config.txt \ - -C ${{matrix.context.mps}}_board.v_path=./board/${{matrix.context.layer}}/vsi/python/ \ -C ${{matrix.context.mps}}_board.uart0.out_file=${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log \ - --simlimit 30 + --simlimit 100 - name: Show UART output working-directory: ./example/FVP_Audio @@ -129,8 +128,6 @@ jobs: cat ${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log - name: Check UART output - # Disable SSE-320 output check due to known issue with FVP UART output - if: matrix.context.target_type != 'SSE-320' working-directory: ./example/FVP_Audio run: | echo "Check FVP UART output:" diff --git a/.github/workflows/Build_Run_FVP_Hello.yml b/.github/workflows/Build_Run_FVP_Hello.yml index d293252e..7067808d 100644 --- a/.github/workflows/Build_Run_FVP_Hello.yml +++ b/.github/workflows/Build_Run_FVP_Hello.yml @@ -98,7 +98,7 @@ jobs: -a ./out/${{matrix.context.proj}}/${{matrix.context.target_type}}/${{matrix.context.build_type}}/${{matrix.context.proj}}.${{matrix.toolchain.ext}} \ -f ./board/${{matrix.context.layer}}/fvp_config.txt \ -C ${{matrix.context.mps}}_board.uart0.out_file=${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log \ - --simlimit 30 + --simlimit 100 - name: Show example output working-directory: ./example/FVP_Hello @@ -107,8 +107,6 @@ jobs: cat ${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log - name: Check example output - # Disable SSE-320 output check due to known issue with FVP UART output - if: matrix.context.target_type != 'SSE-320' working-directory: ./example/FVP_Hello run: | echo "Check FVP UART output:" diff --git a/.github/workflows/Build_Run_FVP_Video.yml b/.github/workflows/Build_Run_FVP_Video.yml index 670803e3..ff99e0f1 100644 --- a/.github/workflows/Build_Run_FVP_Video.yml +++ b/.github/workflows/Build_Run_FVP_Video.yml @@ -118,9 +118,8 @@ jobs: ${{ matrix.context.model }} \ -a ./out/${{matrix.context.proj}}/${{matrix.context.target_type}}/${{matrix.context.build_type}}/${{matrix.context.proj}}.${{matrix.toolchain.ext}} \ -f ./board/${{matrix.context.layer}}/fvp_config.txt \ - -C ${{matrix.context.mps}}_board.v_path=./board/${{matrix.context.layer}}/vsi/python/ \ -C ${{matrix.context.mps}}_board.uart0.out_file=${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log \ - --simlimit 30 + --simlimit 100 - name: Show UART output working-directory: ./example/FVP_Video @@ -129,8 +128,6 @@ jobs: cat ${{matrix.context.proj}}_${{matrix.context.build_type}}_${{matrix.context.target_type}}_${{matrix.toolchain.name}}.log - name: Check UART output - # Disable SSE-320 output check due to known issue with FVP UART output - if: matrix.context.target_type != 'SSE-320' working-directory: ./example/FVP_Video run: | echo "Check FVP UART output:"