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.
PIC32 error “unrecognized opcode `…
PIC32 error “unrecognized opcode `…
I am following the example of the vTaskGetRunTimeStats() on page 52-55 provided for the PIC32 port of FreeRTOSPage 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 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__
FreeRTOSConfig.h: Assembler messages:
./FreeRTOSConfig.h:106: Error: unrecognized opcode `extern unsigned long ulHighFrequencyTimerTicks’
What is the fix for this error.
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.
PIC32 error “unrecognized opcode `…
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
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