cancel
Showing results for 
Search instead for 
Did you mean: 

compilation error after update to V 1.13.0

Hoffart
Associate

Since the latest update to STM32Cube V 1.13.0 I get an error during compilation of sysmem.c:

error: unknown type name 'caddr_t'

The reason seems to be a missing path to sys/types.h. At least adding

#include <sys/types.h>

to my code solves the problem.But I don't like editing system code.Is there any better solution?
6 REPLIES 6
RhSilicon
Lead

When a bug occurs with the Arduino IDE, many users stop using that version. They use the previous version until a new version is released. Maybe that's the case this time with the STM32CubeIDE. I've seen other similar bug reports here.

Hoffart
Associate

I just noticed that the function called inside sysmem.c is nowhere called.

Deleting the file solves the problem - it seems it is not needed any more.

Semer CHERNI
ST Employee

Hello @RhSilicon 

Yes indeed the GCC version was upgraded from GCC10 to GCC11 with the STM32CubeIDE 1.13.0.

You are right with the solution you have proposed of changing the caddr_t to void* or include the <sys/types.h> to sysmem.c.

With this been said, I will raise the issue internally to review it and provide a permanent solution.

KR,
Semer.

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.

"You are right with the solution you have proposed of changing the caddr_t to void* or include the <sys/types.h> to sysmem.c."

Hi, I believe there was some mistake in the forum when mentioning the OP, I ended up being mentioned, but I am not the author of the mentioned proposal. Thanks.

There is a mistake and it even has a name...

A similare problem seems to be included in x509_crt.c, which depends on several posix like inclludes (sys/types.d, sys/stat.h). If a CUBE project using file system (FATFs - MBEDTLS_FS_IO), LwIP, mbedTLS and FreeRTOS is generated for ARM / Keil and STM32H7xx this file becomes part of the project. The ARM MDK installation does not have a 'sys' subdirectory in the include path. So x509_crt.c compilation complains about missing include files (dirent.h is not available either). An atempt to 'borrow' the files from a minGW GNU C compiler does not work due to other unresolved depencies that arise then. Trying to port the calls to the functions readdir() and stat() to those defined in ff.c fails due to additional parameters required then which would result in a lot of adoptions in x509_crt.c.