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] [August 2010 Threads] Error found in LPC2xxx port.c filesPosted by Ben on August 18, 2010 I think I have found a possible problem in the following LPC2xxx port.c files
GCC/ARM7_LPC2000/port.c GCC/ARM7_LPC22xx/port.c IAR/ARM7_LPC2000/port.c RVDS/ARM7_LPC21xx/port.c
In all cases the VIC interrupt is enabled before the address of the vector is set. By default the address registers are 0, so if an interrupt is pending the processor will jump to location 0.
Also in some cases the VICIntEnable register is or equalled and in some cases just set. This should not matter, other than the wasted cycles.
from the GCC lpc32xx port.c
VICIntEnable = 0x00000010;
/* The ISR installed depends on whether the preemptive or cooperative
scheduler is being used. */
#if configUSE_PREEMPTION == 1
{
extern void ( vPreemptiveTick )( void );
VICVectAddr4 = ( portLONG ) vPreemptiveTick;
}
#else
{
extern void ( vNonPreemptiveTick )( void );
VICVectAddr4 = ( portLONG ) vNonPreemptiveTick;
}
#endif
VICVectCntl4 = 1;
Really the VIC interrupt should be disabled first, the address then set and finally the interrupt enabled.
regards Ben
RE: Error found in LPC2xxx port.c filesPosted by Richard on August 18, 2010 Thanks for taking the time to report this potential problem.
Interrupts are disabled in the CPSR within tasks.c, immediately prior to the port layer being called to start the scheduler, after which the code you highlight is executed. Therefore interrupts are disabled when the code you highlight is executed.
Does that satisfy you that the problem does not actually exist - or am I missing something?
Regards.
RE: Error found in LPC2xxx port.c filesPosted by Ben on August 18, 2010 As you say interrupts should be disabled so it shouldn't be a problem.
It just that I am having some problems currently that I haven't got to the bottom of yet. One problems was where I was enabling the VIC interrupt before setting the address, so I did a search of the project tree to make sure there were no other instances and found the port.c file.
I am just being picky, have seen to much code where conditions were incorrectly assumed and get fussy about things.
Regards
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|