From d554ee405347131135d1f2c6ff4a336de56f8d13 Mon Sep 17 00:00:00 2001 From: explorer2005 Date: Wed, 3 Dec 2025 00:19:11 +0530 Subject: [PATCH 1/2] Added target to XShell demo in txt --- demos/STM32/RT-STM32-XSHELL/readme.txt | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 demos/STM32/RT-STM32-XSHELL/readme.txt diff --git a/demos/STM32/RT-STM32-XSHELL/readme.txt b/demos/STM32/RT-STM32-XSHELL/readme.txt new file mode 100644 index 0000000000..0098e7ab87 --- /dev/null +++ b/demos/STM32/RT-STM32-XSHELL/readme.txt @@ -0,0 +1,57 @@ +***************************************************************************** +** ChibiOS/RT X-Shell Demo for STM32. ** +***************************************************************************** + +** TARGET ** + +The demo supports multiple STM32 target boards: +- STM32 Nucleo144-H563ZI board (stm32h563zi_nucleo144.make) +- STM32 Nucleo144-U575ZI board (stm32u575zi_nucleo144.make) +- STM32 Nucleo64-C071RB board (stm32c071rb_nucleo64.make) +- STM32 Nucleo64-G474RE board (stm32g474re_nucleo64.make) +- STM32 Nucleo64-U083RC board (stm32u083rc_nucleo64.make) +- STM32 Nucleo64-U385RG board (stm32u385rg_nucleo64.make) + +** The Demo ** + +This demo demonstrates the X-Shell (extended shell) functionality on various +STM32 boards. X-Shell provides an interactive command-line interface with +features like command history, editing, and various built-in commands. + +The shell is accessible via the serial port (typically mapped on USB virtual +COM port or STLink v2-1 Virtual COM Port, depending on the board). + +Available shell commands include: +- halt: Halts the system +- write: Write test command +- clock: Clock-related commands +- test: Run system tests (RT and OSLIB test suites) +- systime: Display system time +- mem: Display memory information +- threads: List running threads +- And other standard X-Shell commands + +** Build Procedure ** + +The demo can be built for different target boards by using the corresponding +makefile in the make/ directory: + + make -f make/stm32h563zi_nucleo144.make + make -f make/stm32u575zi_nucleo144.make + make -f make/stm32g474re_nucleo64.make + make -f make/stm32c071rb_nucleo64.make + make -f make/stm32u083rc_nucleo64.make + make -f make/stm32u385rg_nucleo64.make + +Alternatively, run 'make' at the root to build all targets. + +The demo has been tested using the free GCC ARM embedded toolchain. + +** Notes ** + +Some files used by the demo are not part of ChibiOS/RT but are copyright of +ST Microelectronics and are licensed under a different license. +Also note that not all the files present in the ST library are distributed +with ChibiOS/RT, you can find the whole library on the ST web site: + + http://www.st.com From d53c0917a1eddc6fdb194fc1c28986d9a4b72361 Mon Sep 17 00:00:00 2001 From: explorer2005 Date: Wed, 3 Dec 2025 01:48:15 +0530 Subject: [PATCH 2/2] Fixed Thread Descriptor Bug in main.c, Created Missing Configuration Directory --- .../cfg/stm32c071rb_nucleo64/portab.c | 2 +- .../cfg/stm32c071rb_nucleo64/portab.h | 2 +- .../cfg/stm32g474re_nucleo64/portab.c | 2 +- .../cfg/stm32g474re_nucleo64/portab.h | 2 +- .../cfg/stm32h563zi_nucleo144/portab.c | 2 +- .../cfg/stm32h563zi_nucleo144/portab.h | 2 +- .../cfg/stm32u083rc_nucleo64/portab.c | 2 +- .../cfg/stm32u083rc_nucleo64/portab.h | 2 +- .../cfg/stm32u385rg_nucleo64/portab.c | 2 +- .../cfg/stm32u385rg_nucleo64/portab.h | 2 +- .../cfg/stm32u575zi_nucleo144/portab.c | 57 ++++++++++++++ .../cfg/stm32u575zi_nucleo144/portab.h | 76 +++++++++++++++++++ demos/STM32/RT-STM32-XSHELL/main.c | 4 +- 13 files changed, 145 insertions(+), 12 deletions(-) create mode 100644 demos/STM32/RT-STM32-XSHELL/cfg/stm32u575zi_nucleo144/portab.c create mode 100644 demos/STM32/RT-STM32-XSHELL/cfg/stm32u575zi_nucleo144/portab.h diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32c071rb_nucleo64/portab.c b/demos/STM32/RT-STM32-XSHELL/cfg/stm32c071rb_nucleo64/portab.c index fa9eec389e..a74b33c3ed 100644 --- a/demos/STM32/RT-STM32-XSHELL/cfg/stm32c071rb_nucleo64/portab.c +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32c071rb_nucleo64/portab.c @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32c071rb_nucleo64/portab.h b/demos/STM32/RT-STM32-XSHELL/cfg/stm32c071rb_nucleo64/portab.h index e179d24896..a1f982d953 100644 --- a/demos/STM32/RT-STM32-XSHELL/cfg/stm32c071rb_nucleo64/portab.h +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32c071rb_nucleo64/portab.h @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32g474re_nucleo64/portab.c b/demos/STM32/RT-STM32-XSHELL/cfg/stm32g474re_nucleo64/portab.c index 893c1e79b3..b35bb0ffa1 100644 --- a/demos/STM32/RT-STM32-XSHELL/cfg/stm32g474re_nucleo64/portab.c +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32g474re_nucleo64/portab.c @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32g474re_nucleo64/portab.h b/demos/STM32/RT-STM32-XSHELL/cfg/stm32g474re_nucleo64/portab.h index 6e65894652..bbc5fbd490 100644 --- a/demos/STM32/RT-STM32-XSHELL/cfg/stm32g474re_nucleo64/portab.h +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32g474re_nucleo64/portab.h @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32h563zi_nucleo144/portab.c b/demos/STM32/RT-STM32-XSHELL/cfg/stm32h563zi_nucleo144/portab.c index 893c1e79b3..b35bb0ffa1 100644 --- a/demos/STM32/RT-STM32-XSHELL/cfg/stm32h563zi_nucleo144/portab.c +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32h563zi_nucleo144/portab.c @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32h563zi_nucleo144/portab.h b/demos/STM32/RT-STM32-XSHELL/cfg/stm32h563zi_nucleo144/portab.h index b67d19380b..b47f518275 100644 --- a/demos/STM32/RT-STM32-XSHELL/cfg/stm32h563zi_nucleo144/portab.h +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32h563zi_nucleo144/portab.h @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32u083rc_nucleo64/portab.c b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u083rc_nucleo64/portab.c index 1f868f6df1..f8b3203f61 100644 --- a/demos/STM32/RT-STM32-XSHELL/cfg/stm32u083rc_nucleo64/portab.c +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u083rc_nucleo64/portab.c @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32u083rc_nucleo64/portab.h b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u083rc_nucleo64/portab.h index 9ef4db8434..06f8b745ed 100644 --- a/demos/STM32/RT-STM32-XSHELL/cfg/stm32u083rc_nucleo64/portab.h +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u083rc_nucleo64/portab.h @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32u385rg_nucleo64/portab.c b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u385rg_nucleo64/portab.c index fa9eec389e..a74b33c3ed 100644 --- a/demos/STM32/RT-STM32-XSHELL/cfg/stm32u385rg_nucleo64/portab.c +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u385rg_nucleo64/portab.c @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32u385rg_nucleo64/portab.h b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u385rg_nucleo64/portab.h index 16c98a8583..afa954ea30 100644 --- a/demos/STM32/RT-STM32-XSHELL/cfg/stm32u385rg_nucleo64/portab.h +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u385rg_nucleo64/portab.h @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32u575zi_nucleo144/portab.c b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u575zi_nucleo144/portab.c new file mode 100644 index 0000000000..b35bb0ffa1 --- /dev/null +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u575zi_nucleo144/portab.c @@ -0,0 +1,57 @@ +/* + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file portab.c + * @brief Application portability module code. + * + * @addtogroup application_portability + * @{ + */ + +#include "hal.h" + +#include "portab.h" + +/*===========================================================================*/ +/* Module local definitions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Module exported variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Module local types. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Module local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Module local functions. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Module exported functions. */ +/*===========================================================================*/ + +void portab_setup(void) { + +} + +/** @} */ diff --git a/demos/STM32/RT-STM32-XSHELL/cfg/stm32u575zi_nucleo144/portab.h b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u575zi_nucleo144/portab.h new file mode 100644 index 0000000000..cd169b31cc --- /dev/null +++ b/demos/STM32/RT-STM32-XSHELL/cfg/stm32u575zi_nucleo144/portab.h @@ -0,0 +1,76 @@ +/* + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file portab.h + * @brief Application portability macros and structures. + * + * @addtogroup application_portability + * @{ + */ + +#ifndef PORTAB_H +#define PORTAB_H + +/*===========================================================================*/ +/* Module constants. */ +/*===========================================================================*/ + +#define PORTAB_LINE_LED1 LINE_LED_GREEN +#define PORTAB_LINE_LED2 LINE_LED_BLUE +#define PORTAB_LED_OFF PAL_LOW +#define PORTAB_LED_ON PAL_HIGH + +#define PORTAB_LINE_BUTTON LINE_BUTTON +#define PORTAB_BUTTON_PRESSED PAL_HIGH + +#define PORTAB_SIOD1 SIOD1 + +/*===========================================================================*/ +/* Module pre-compile time settings. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Derived constants and error checks. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Module data structures and types. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Module macros. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +#ifdef __cplusplus +extern "C" { +#endif + void portab_setup(void); +#ifdef __cplusplus +} +#endif + +/*===========================================================================*/ +/* Module inline functions. */ +/*===========================================================================*/ + +#endif /* PORTAB_H */ + +/** @} */ diff --git a/demos/STM32/RT-STM32-XSHELL/main.c b/demos/STM32/RT-STM32-XSHELL/main.c index 57705fa3a2..be79921b6b 100644 --- a/demos/STM32/RT-STM32-XSHELL/main.c +++ b/demos/STM32/RT-STM32-XSHELL/main.c @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2025 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -143,7 +143,7 @@ int main(void) { */ static thread_t thd1; static const THD_DECL_STATIC(thd1_desc, "blinker", thd1_stack, - NORMALPRIO + 10, thd1_func, NULL, NULL); + NORMALPRIO + 10, thd1_func, NULL); chThdSpawnRunning(&thd1, &thd1_desc); /*