Good afternoon! I am developing a microcontroller project on ARM Cortex-M4, GCC compiler (Release 6.22a). The project includes a library that uses a nested function and is passed as a parameter to another function. When building, the project crashes on this function with the message:
undefined reference to `__clear_cache'
I wrote a pseudo-program with a similar implementation, it is built on GCC under Windows, it works, but on GCC ARM the same problem.
C
#include <stdio.h>
#include <stdlib.h>
int func_cb(int (*taskFunc)(int))
{
return taskFunc(5);
}
int func(void) //Error: undefined reference to `__clear_cache'
{
int square (int b) { return b * b; }
return func_cb(square);
}
int main(void)
{
func();
//printf("%d", func());
while (1);
}
Display More
Tell me, where could be the problem?