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

porting from IAR to GCC STR91x

Posted 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 STR91x

Posted 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.


[ 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