Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

PIC32 error "unrecognized opcode `...

Posted by Professor Wall on October 4, 2012
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.

RE: PIC32 error "unrecognized opcode `...

Posted by Richard on October 4, 2012
“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.

RE: PIC32 error "unrecognized opcode `...

Posted by Professor Wall on October 4, 2012
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


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner