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 2006 Threads] porting from IAR to GCC STR91xPosted by Fabrizio on October 16, 2006 Hi, I've a problem with the functions vPortDisableInterruptFromThumb and vPortEnableInterruptFromThumb. In IAR arm7 (AT91SAM7S) the function are defined in portmacro.h as: __arm __interwork void vPortDisableInterruptsFromThumb( void ); __arm __interwork void vPortEnableInterruptsFromThumb( void ); They are been ported in gcc in the file portISR.c as follows: void vPortDisableInterruptsFromThumb( void ) __attribute__ ((naked)); void vPortEnableInterruptsFromThumb( void ) __attribute__ ((naked));
void vPortDisableInterruptsFromThumb( void ) { asm volatile ( "STMDBSP!, {R0}\n\t"/* Push R0.*/ "MRSR0, CPSR\n\t"/* Get CPSR.*/ "ORRR0, R0, #0xC0\n\t"/* Disable IRQ, FIQ.*/ "MSRCPSR, R0\n\t"/* Write back modified value.*/ "LDMIASP!, {R0}\n\t"/* Pop R0.*/ "BXR14" );/* Return back to thumb.*/ }
void vPortEnableInterruptsFromThumb( void ) { asm volatile ( "STMDBSP!, {R0}\n\t"/* Push R0.*/ "MRSR0, CPSR\n\t"/* Get CPSR.*/ "BICR0, R0, #0xC0\n\t"/* Enable IRQ, FIQ.*/ "MSRCPSR, R0\n\t"/* Write back modified value.*/ "LDMIASP!, {R0}\n\t"/* Pop R0.*/ "BXR14" );/* Return back to thumb.*/ } In IAR STR91x portmacro.h file, i don't have these functions but i've only two defines: #define portDISABLE_INTERRUPTS()__disable_interrupt() #define portENABLE_INTERRUPTS()__enable_interrupt() My question is: How can i port these function in portISR.c in GCC STR91x file?
Thanks.
Fabrizio.
RE: porting from IAR to GCC STR91xPosted by Nobody/Anonymous on October 17, 2006 First, you may find it easier to take an existing CrossWorks ARM7 demo, and retarget it at the STR9. Although internally there are many differences between the ARM7 and ARM9 from the programmer view point they are very similar, so probably only the timer set and memory map will be very different to the existing ARM7 demo. The ARM7 demos use a different interrupt entering mechanism than the ARM9 demo, but this is only a matter of taste.
Now to your question.
I think you can simply replace the __disable_interrupt() with libarm_disable_irq(). Lookup libarm_disable_irq() in the CrossWorks docs.
The FreeRTOS project uses the same port files as the vanilla GCC project, hence the CrossWorks extensions such as libarm_disable_irq() are not used as they would not compile with vanilla GCC.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|