FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2012 Threads]
I am following the example of the vTaskGetRunTimeStats() on page 52-55 provided for the PIC32 port of FreeRTOS. I am running mplabc32_V2_02a for windows. The LM3Sxxxx Eclispse example has you enter the following line into the FreeRTOSConfig.h file: "extern unsigned long ulHighFrequencyTimerTicks;" When I build the project I get the following error message:
FreeRTOSConfig.h: Assembler messages:
./FreeRTOSConfig.h:106: Error: unrecognized opcode `extern unsigned long ulHighFrequencyTimerTicks'
What is the fix for this error.
“I am following the example of the vTaskGetRunTimeStats() on page 52-55 provided for the PIC32 port of FreeRTOS”
Page 52 of 55 of what? I assumed you meant the PIC32 edition of the FreeRTOS tutorial book, but having just looked at that, page 52 is about deleting tasks.
“"extern unsigned long ulHighFrequencyTimerTicks;" When I build the project I get the following error message:
FreeRTOSConfig.h: Assembler messages:
./FreeRTOSConfig.h:106: Error: unrecognized opcode `extern unsigned long ulHighFrequencyTimerTicks'
What is the fix for this error.”
FreeRTOSConfig.h gets included from the assembly file in the FreeRTOS port layer, so I'm guessing the assembly file does not understand what an extern unsigned long is.
If I am right, then to get the file through the compilation, you will need to ensure the extern unsigned long is only visible inside C file, and invisible inside assembly files. This can normally be done using a #if conditional compilation.
For example, when using the IAR compiler, __ICCARM__ is defined by the C compiler, but not the assembler, so I would do something like this:
#ifdef __ICCARM__
extern unsigned long my_variable;
#endif
I don't know what the equivalent is for GCC, but I would recommend trying __GNUC__ as a starting point.
Regards.
Following your directions - I was unable to find the condition where the compiler would recognize the extern ... but the assembler would not. However, (with the aid of a smart undergrad student) we did find a work around.
We removed the line "extern volatile unsigned long ulHighFrequencyTimerTicks;" from FreeRTOSConfig.h and added the following lines to task.c
#if configGENERATE_RUN_TIME_STATS == 1
extern volatile unsigned long ulHighFrequencyTimerTicks;
#endif
Than complies and the vTaskGetRunTImeStates( cBuffer) now works.
As a side note, I implemented the high frequency counter using the PIC32 Timer 4 running at 10K Hz.
Thanks for the suggestion and I hope this helps the next guy using FreeRTOS and the PIC32
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.