can not add trace function to FreeRTOSConfig.h

mfawzy79
Posts: 17
Joined: Thu Feb 18, 2021 11:21 pm

can not add trace function to FreeRTOSConfig.h

Postby mfawzy79 » Sun Aug 15, 2021 12:16 am

Hello,

I copied the freeRTOS into my project and I compiled my code properly and once I tried to add some tracing functions
extern void PROBE_vTraceHeap(void * pvAddress, size_t uiSize);
#define traceMALLOC(pvAddress, uiSize ) PROBE_vTraceHeap(pvAddress, uiSize)
to FreeRTOSConfig.h, i get Error: unknown opcode or format name 'extern'
and if I removed the 'extern', i will get the same error but for the void.

Please advise!

Victoria Nope
Posts: 75
Joined: Fri Dec 04, 2020 9:56 pm

Re: can not add trace function to FreeRTOSConfig.h

Postby Victoria Nope » Sun Aug 15, 2021 1:53 am

That config file is included in assembly source file(s) as well and the assembly compiler just cannot resolve your C code. Put it in a conditional block where __ASSEMBLER__ identifier is not defined (file is not compiled by the assembler):

Code: Select all

#ifndef __ASSEMBLER__
extern void PROBE_vTraceHeap(void * pvAddress, size_t uiSize);
#define traceMALLOC(pvAddress, uiSize) PROBE_vTraceHeap(pvAddress, uiSize)
#endif
Here is an existing example and an assembly source file which includes the mentioned header.

Who is online

Users browsing this forum: Bing [Bot], Majestic-12 [Bot] and 346 guests