cancel
Showing results for 
Search instead for 
Did you mean: 

Can't compile uart_printf example

nadavpp
Associate III

I created a project from the uart_printf example and it does not compile

I'm using STM32CubeIDE Version: 1.13.1 (STM32CubeF7 Firmware Package V1.17.0 / 10-June-2022)

eval board: NUCLEO-746ZG

I didn't change any settings, I created the project from the example and compiled.

The errors I get are:

in function `_close_r': (.text._close_r+0xc): warning: _close is not implemented and will always fail
in function `_fstat_r': (.text._fstat_r+0xe): warning: _fstat is not implemented and will always fail
in function `_isatty_r': (.text._isatty_r+0xc): warning: _isatty is not implemented and will always fail
in function `_lseek_r': (.text._lseek_r+0x10): warning: _lseek is not implemented and will always fail
in function `_read_r': (.text._read_r+0x10): warning: _read is not implemented and will always fail
in function `_write_r': (.text._write_r+0x10): warning: _write is not implemented and will always fail
 
I've attached a file with the full output of the compilation.
 

Does anybody know how to get this to compile?

Thanks,

Nadav

 

1 ACCEPTED SOLUTION

Accepted Solutions
nadavpp
Associate III

Hi KnarfB, thanks for your reply.
The problem is indeed that the syscalls.c is missing :(

I'm copied the syscalls.c from another project (generated from another example for this eval board) 
and the compilation warnings/errors disappeared.

Hopefully now it will work...
Thanks,

Nadav

 

View solution in original post

5 REPLIES 5
Pavel A.
Evangelist III

In the log, compilation of syscalls.c is missing. Can you do clean rebuild? If syscalls.c won't compile again, this looks like a bug in importing SW4STM32 projects. How have you imported this project?

KDJEM.1
ST Employee

Hello @nadavpp and welcome to the Community 🙂,

I advise you to refer to Migration guide from System Workbench to STM32CubeIDE user manual when you import your project.

Please let me know if the issue is solved.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

KnarfB
Principal III

Actually, those are warnings and not errors. The .elf file was built. The syscalls.c file is missing. It contains stub implementations of various system calls, including _write. See the attached copy.

This file is indeed no longer generated for my (Makefile) projects too, no idea why.

hth

KnarfB

nadavpp
Associate III

Hi KnarfB, thanks for your reply.
The problem is indeed that the syscalls.c is missing :(

I'm copied the syscalls.c from another project (generated from another example for this eval board) 
and the compilation warnings/errors disappeared.

Hopefully now it will work...
Thanks,

Nadav

 

Pavel A.
Evangelist III

The syscalls.c files are present in the project tree for another F7 Nucleo.

https://github.com/STMicroelectronics/STM32CubeF7/tree/master/Projects/STM32F767ZI-Nucleo/Examples/UART/UART_Printf/SW4STM32

This is a bug in the CubeF7 sub-tree for NUCLEO-746ZG and some other boards too. I've opened issue on github.  #bugreport

https://github.com/STMicroelectronics/STM32CubeF7/issues/99