Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




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 ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists