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


FreeRTOS V3.0 PIC18 port withe mcc18

Posted by Nobody/Anonymous on June 5, 2005
Hi everybody,
I'm new at Freertos and I wanted to try it. I'm using mplab and a custom board with an PIC18f452. My first compile with mcc18 fails with the following error : Executing: "I:\mcc18\bin\mcc18.exe" -p=18F452 "tasks.c" -fo="tasks.o" /i"I:\mcc18\h" /i"M:\FreeRTOS\demo\common\include" /i"M:\FreeRTOS\source\include" /i"M:\FreeRTOS\source\portable\mplab\PIC18F" /i"M:\FreeRTOS\demo\PIC18_MPLAB" -w3 -DMPLAB_PIC18F_PORT -Ls -Opa-
M:\FreeRTOS\Source\tasks.c:176:Fatal [100] -internal- unhandled opcode in constant expression
Error executing I:\mcc18\bin\mcc18-traditional [error=1]
Halting build on first failure as requested.

The source line concerned in tasks.c is as follows :
static volatile xListpxReadyTasksLists[configMAX_PRIORITIES];/*< Prioratised ready tasks. */
If someone has already faced the same problem or any idea please help.
thanks in advance.

RE: FreeRTOS V3.0 PIC18 port withe mcc18

Posted by Richard on June 5, 2005
Does the code compile exactly as downloaded (without modification).

If you get the same problem with the unmodified code then this could be an MPLAB C problem. I have found the following extract from a MPLAB bug list:

"(20361) the 'sizeof' operator when used to specify an array size may
cause an internal error:

char buf[sizeof("hello world")];

Fatal [100]-internal - unhandled opcode in constant expression

The workaround is to use a different method of specifying the array size

#define STRING_LEN 11
char buf[STRING_LEN + 1];

The sizeof operator is not explicitly used to define configMAX_PRIORITIES but may be used implicitly because of the cast.

configMAX_PRIORITIES is defined in FreeRTOS\Demo\PIC18_MPLAB\FreeRTOSConfig.h. Try removing the cast in the constant definition so it reads:

#define configMAX_PRIORITIES 4

Which version of the compiler and IDE are you using?


[ 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