Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | LPC2000 | Crossstudio and asm functions

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

Crossstudio and asm functions - tomi - Sep 10 15:18:05 2009

In Crossstudio 1.7 this functions works correctly:
static inline cpu_t get_cpsr(void)
{
cpu_t val;
asm volatile ("mrs %[val], cpsr\n":[val]"=r"(val):);
return val;
}

static inline void set_cpsr(cpu_t val)
{
asm volatile ("msr cpsr, %[val]\n" ::[val]"r"(val) );
}

In Crossstudio 2.0 I have error:
'asm' undeclared (first use in this function)
when I remove volatile keyword, I have error
asm ("mrs %[val], cpsr\n":[val]"=r"(val):);
^ expected ')' before ':' token
What is wrong in this functons ?
[Non-text portions of this message have been removed]

------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


RE: Crossstudio and asm functions - FreeRTOS Info - Sep 10 15:26:42 2009

> In Crossstudio 1.7 this functions works correctly:
> static inline cpu_t get_cpsr(void)
> {
> cpu_t val;
> asm volatile ("mrs %[val], cpsr\n":[val]"=3Dr"(val):);
> return val;
> }
>=20
> static inline void set_cpsr(cpu_t val)
> {
> asm volatile ("msr cpsr, %[val]\n" ::[val]"r"(val) );
> }
>=20
> In Crossstudio 2.0 I have error:
> 'asm' undeclared (first use in this function)
> when I remove volatile keyword, I have error
> asm ("mrs %[val], cpsr\n":[val]"=3Dr"(val):);
> ^ expected ')' before ':' token
> What is wrong in this functons ?
Either switch off the "force ANSI compliance" compiler option, or replace
asm with __asm.

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T=DCV as meeting the requirements for safety related systems.

------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

RE: Crossstudio and asm functions - Michael J Scott - Sep 10 16:07:38 2009

I had the same problem I used __asm which worked. I also found a define for
__asm__, but I have not tried it.

_____

From: tomi [mailto:f...@gmail.com]
Sent: Thursday, September 10, 2009 3:16 PM
To: l...@yahoogroups.com
Subject: [lpc2000] Crossstudio and asm functions

In Crossstudio 1.7 this functions works correctly:
static inline cpu_t get_cpsr(void)
{
cpu_t val;
asm volatile ("mrs %[val], cpsr\n":[val]"=r"(val):);
return val;
}

static inline void set_cpsr(cpu_t val)
{
asm volatile ("msr cpsr, %[val]\n" ::[val]"r"(val) );
}

In Crossstudio 2.0 I have error:
'asm' undeclared (first use in this function)
when I remove volatile keyword, I have error
asm ("mrs %[val], cpsr\n":[val]"=r"(val):);
^ expected ')' before ':' token
What is wrong in this functons ?

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Crossstudio and asm functions - tomi - Sep 11 3:46:28 2009

2009/9/10 FreeRTOS Info

>
> Either switch off the "force ANSI compliance" compiler option, or replace
> asm with __asm.
>
Thank you, it working ;)
[Non-text portions of this message have been removed]

------------------------------------

______________________________
controlSUITE™ software. Comprehensive. Intuitive. Optimized.
Real-world software for real-time control. Details Here!



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )