FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [October 2008 Threads] 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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|