cancel
Showing results for 
Search instead for 
Did you mean: 

Project not compilable on other computer

resea
Associate

Hello dear ST Community

I have my first real problem, unfortunately.

Since we now want to work with multiple people on projects, we have now set up our git cleanly by only sharing the project files (no workspace). However, now I unfortunately have the problem that on my computer the project is not compilable. I get the following error messages:

Spoiler
'caddr_t' undeclared (first use in this function) sysmem.c
expected ';' before 'prev_heap_end' sysmem.c
make: *** [Src/subdir.mk:52: Src/sysmem.o] Error 1 
make: *** Waiting for unfinished jobs....
unknown type name 'caddr_t' sysmem.c 

i have already tried:

- as recommended in another post here, add the line #include <sys/types.h> to the sysmem.c file.

- change the code in sysmem.c from

Spoiler
// external char end asm("end");
// static char *heap_end;
// char *prev_heap_end;
//
// if (heap_end == 0)
// heap_end = &end;
//
// prev_heap_end = heap_end;
// if (heap_end + incr > stack_ptr)
// {
// errno = ENOMEM;
// return (caddr_t) -1;
// }
//
// heap_end += incr;
//
// return (caddr_t) prev_heap_end;
by:
 
Spoiler
external uint8_t _end; /* Symbol defined in linker script */
external uint8_t _estack; /* Symbol defined in linker script */
external uint32_t _Min_Stack_Size; /* Symbol defined in linker script */
const uint32_t stack_limit = (uint32_t) &_estack
- (uint32_t) &_Min_Stack_Size;
const uint8_t *max_heap = (uint8_t*) stack_limit;
uint8_t *prev_heap_end;
 
/* Initialise the end of the heap on the first call */
if (NULL == __sbrk_heap_end) {
__sbrk_heap_end = &_end;
}
 
/* Protect heap from growing into reserved MSP stack */
if (__sbrk_heap_end + incr > max_heap) {
errno = ENOMEM;
return (void*) -1;
}
 
prev_heap_end = __sbrk_heap_end;
__sbrk_heap_end += incr;
 
return (void*) prev_heap_end;
}
 
 
to replace. This minimised the errors to two, namely the IDE now grumbles that "caddr_t" is unknown.
 

I understand that caddr_t seems to be an outdated system. Unfortunately, I don't fully understand how to replace the old version with the code from a newly generated sysmem.c file.

I hope you know a solution to my problem.

Many greetings and thanks in advance
Patrick

 
 
2 REPLIES 2
Pavel A.
Evangelist III

A short answer: your project or team has grown to the state when it needs a person who deals with these software & tools issues for all team members. Congratulations. If you are assuming this role, consider finding a consultant.

kosmamoczek
Associate

For anyone who stumbles upon the same problem, the solution is: use the same toolchain version that STM32CubeIDE ships with. For example, if the IDE lives in:

c:\ST\STM32CubeIDE_1.15.1\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.win32_1.0.200.202406191623\tools\bin

then you should install arm-gnu-toolchain-12.3.rel1-mingw-w64-i686-arm-none-eabi.exe from https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads and make sure that specific version is in your PATH. Alternatively, you can add the above folder to PATH if you have the IDE installed.