stdio_semihosting: Add shell-based test application
This commit is contained in:
parent
99ca736b53
commit
11ee5ff2cf
10
tests/sys_stdio_semihosting/Makefile
Normal file
10
tests/sys_stdio_semihosting/Makefile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
include ../Makefile.tests_common
|
||||||
|
|
||||||
|
USEMODULE += stdio_semihosting
|
||||||
|
USEMODULE += shell
|
||||||
|
USEMODULE += shell_commands
|
||||||
|
USEMODULE += ps
|
||||||
|
|
||||||
|
RIOT_TERMINAL = semihosting
|
||||||
|
|
||||||
|
include $(RIOTBASE)/Makefile.include
|
||||||
13
tests/sys_stdio_semihosting/README.md
Normal file
13
tests/sys_stdio_semihosting/README.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Semihosting STDIO test
|
||||||
|
|
||||||
|
This test aims to test ARM semihosting based STDIO on RIOT. The test is manual,
|
||||||
|
starting a debugger on the CI for automated test is not supported.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
1. Flash the test on a board with an ARM-based MCU.
|
||||||
|
2. Use `make term RIOT_TERMINAL=semihosting` to start a debug session with
|
||||||
|
semihosting enabled.
|
||||||
|
3. Restart the microcontroller via the debug session.
|
||||||
|
|
||||||
|
The shell prompt should be available in the GDB session.
|
||||||
35
tests/sys_stdio_semihosting/main.c
Normal file
35
tests/sys_stdio_semihosting/main.c
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2020 Koen Zandberg
|
||||||
|
*
|
||||||
|
* This file is subject to the terms and conditions of the GNU Lesser
|
||||||
|
* General Public License v2.1. See the file LICENSE in the top level
|
||||||
|
* directory for more details.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ingroup tests
|
||||||
|
* @{
|
||||||
|
*
|
||||||
|
* @file
|
||||||
|
* @brief STDIO Semihosting test application using simple shell
|
||||||
|
* interaction
|
||||||
|
*
|
||||||
|
* @author Koen Zandberg <koen@bergzand.net>
|
||||||
|
*
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "shell.h"
|
||||||
|
#include "shell_commands.h"
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
puts("STDIO semihosting test application");
|
||||||
|
|
||||||
|
char line_buf[SHELL_DEFAULT_BUFSIZE];
|
||||||
|
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user