2 *****************************************************************************
6 ** Author : Auto-generated by STM32CubeIDE
8 ** Abstract : STM32CubeIDE Minimal System calls file
10 ** For more information about which c-functions
11 ** need which of these lowlevel functions
12 ** please consult the Newlib libc-manual
14 ** Environment : STM32CubeIDE MCU
16 ** Distribution: The file is distributed as is, without any warranty
19 *****************************************************************************
21 ** <h2><center>© COPYRIGHT(c) 2018 STMicroelectronics</center></h2>
23 ** Redistribution and use in source and binary forms, with or without modification,
24 ** are permitted provided that the following conditions are met:
25 ** 1. Redistributions of source code must retain the above copyright notice,
26 ** this list of conditions and the following disclaimer.
27 ** 2. Redistributions in binary form must reproduce the above copyright notice,
28 ** this list of conditions and the following disclaimer in the documentation
29 ** and/or other materials provided with the distribution.
30 ** 3. Neither the name of STMicroelectronics nor the names of its contributors
31 ** may be used to endorse or promote products derived from this software
32 ** without specific prior written permission.
34 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
35 ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37 ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
38 ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39 ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
40 ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
41 ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
42 ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
43 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46 *****************************************************************************
57 #include <sys/times.h>
63 extern int __io_putchar(int ch) __attribute__((weak));
64 extern int __io_getchar(void) __attribute__((weak));
66 register char * stack_ptr asm("sp");
68 char *__env[1] = { 0 };
69 char **environ = __env;
73 void initialise_monitor_handles()
82 int _kill(int pid, int sig)
88 void _exit (int status)
91 while (1) {} /* Make sure we hang here */
94 __attribute__((weak)) int _read(int file, char *ptr, int len)
98 for (DataIdx = 0; DataIdx < len; DataIdx++)
100 *ptr++ = __io_getchar();
106 __attribute__((weak)) int _write(int file, char *ptr, int len)
110 for (DataIdx = 0; DataIdx < len; DataIdx++)
112 __io_putchar(*ptr++);
123 int _fstat(int file, struct stat *st)
125 st->st_mode = S_IFCHR;
129 int _isatty(int file)
134 int _lseek(int file, int ptr, int dir)
139 int _open(char *path, int flags, ...)
141 /* Pretend like we always fail */
145 int _wait(int *status)
151 int _unlink(char *name)
157 int _times(struct tms *buf)
162 int _stat(char *file, struct stat *st)
164 st->st_mode = S_IFCHR;
168 int _link(char *old, char *new)
180 int _execve(char *name, char **argv, char **env)