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

Error on C18 port?

Posted by Marcelo Adrian Lorenzati Sanz on October 19, 2008
Hello all,

I´ve been dealing some time with different errors in FreeRTOS with C18 port.

Looking in the port i´ve found this:

#pragma code high_vector=0x08
static void prvLowInterrupt( void )
{
/* Was the interrupt the tick? */
if( PIR1bits.CCP1IF )
{
_asm
goto prvTickISR
_endasm
}

/* Was the interrupt a byte being received? */
if( PIR1bits.RCIF )
{
_asm
goto vSerialRxISR
_endasm
}

/* Was the interrupt the Tx register becoming empty? */
if( PIR1bits.TXIF )
{
if( PIE1bits.TXIE )
{
_asm
goto vSerialTxISR
_endasm
}
}
}
#pragma code

In accordance with C18 manual the pragma code place obviously code in the specified direction, but in the case of the interrupt it´s mean to be used just for a computed goto to the isr routine because the next positions (0x18) are mean for the low interrupt service.
I think the previous code is writing beyond his range, also if you want to use priority level it definitely wont fit.


Here I post a modified example:


#pragma code high_vector=0x08
static void highIsr( void )
{
_asm
goto prvHighInterrupt
_endasm
}
#pragma code

#pragma code low_vector=0x18
static void lowIsr( void )
{
_asm
goto prvLowInterrupt
_endasm
}
#pragma code


#pragma interrupt prvHighInterrupt //save=PRODH, PRODL, TABLAT, section(".tmpdata")
static void prvHighInterrupt( void )
{
/*Timer Related Interrupt*/
if( PIR1bits.CCP1IF )
{
_asm
goto prvTickISR
_endasm
}
}

#pragma interruptlow prvLowInterrupt //save=PRODH, PRODL, TABLAT, section(".tmpdata")
static void prvLowInterrupt( void )
{
/* Was the interrupt a byte being received? */
if( PIR1bits.RCIF )
{
_asm
goto vSerialRxISR
_endasm
}

/* Was the interrupt the Tx register becoming empty? */
if( PIR1bits.TXIF )
{
if( PIE1bits.TXIE )
{
_asm
goto vSerialTxISR
_endasm
}
}
}

Two more method def are required prvHighInterrupt and prvLowInterrupt.

Regards

RE: Error on C18 port?

Posted by Dave on October 20, 2008
PIC18? - eek.

RE: Error on C18 port?

Posted by Marcelo Adrian Lorenzati Sanz on October 20, 2008
Yeap, PIC18 with MCC18.
Does anyone have a newer working example for this micro?
I mean MCC18 3.2 FreeRTOS 5.0.4 and a new micro (like PIC18F2620).
I can not manage to get it working properly with this micro and compiler.
In some point I always get a stack under-over flow reset or a read over a wrong code place.


[ 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