Skip to main content
Associate II
August 2, 2023
Solved

Can't compile uart_printf example

  • August 2, 2023
  • 5 replies
  • 2662 views

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

 

This topic has been closed for replies.
Best answer by nadavpp

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

 

5 replies

Pavel A.
Super User
August 2, 2023

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
Technical Moderator
August 2, 2023

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
Super User
August 2, 2023

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

nadavppAuthorBest answer
Associate II
August 2, 2023

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.
Super User
August 2, 2023

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