cancel
Showing results for 
Search instead for 
Did you mean: 

Core/Src/sysmem.c:38:1: error: unknown type name 'caddr_t'

SKled.1
Senior II

Got a project that compiles on another computer (which I now cannot access to test whether it's still so), but now that I'm an another machine, same version of CubeIDE (1.12.1), I get the error quoted above. I'm not sure when I updated last & whether I tried to build then.

Why would the compiler not find a type within library stuff? I haven't touched those files.

Well, if, in sysmem.c, I add

#include <sys/types.h>

it compiles. I don't like messing with the vendor library files, though 😉

EDIT:

This was with toolchain GNU Tools for STM32 (11.3.rel1).

When I chose Fixed: 10.3, it compiles as before.

Why did I try that? Because, in a related project, I was suddenly also getting BS errors that prevented the build, e.g. about casting from a pointer type to a uint32 in a constexpr - this compiles just fine with 10.3, and it's essential, using unsigned values from a linker script, to address certain memory regions in the program.

Note to self: never let IDE select toolchain willy nilly, and not waste time with BS.

(I didn't even know it did that by default)

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Evangelist III

caddt_t is an obsolete typedef; recommended to replace to void*.

> Note to self: never let IDE select toolchain willy nilly, and not waste time with BS.

A great idea.

To make the toolchain choice persistent, you may want to enable per-project settings.

The project settings will be saved with the project, rather than in workspace.

Then whenever you create a new clean workspace, the project settings won't reset to CubeIDE defaults.

View solution in original post

1 REPLY 1
Pavel A.
Evangelist III

caddt_t is an obsolete typedef; recommended to replace to void*.

> Note to self: never let IDE select toolchain willy nilly, and not waste time with BS.

A great idea.

To make the toolchain choice persistent, you may want to enable per-project settings.

The project settings will be saved with the project, rather than in workspace.

Then whenever you create a new clean workspace, the project settings won't reset to CubeIDE defaults.