SoftwareSerial & Atmel Studio

Hi All!
I’m trying to run a program on my Arduino Uno (ATmega328p) within the SoftwareSerial library.
If I’m compiling with the IDE, it works! “1” is sent to the BT-Module → LED turns on…
But if I’m compiling with Atmel Studio 6.0, it doesn’t. LED gives no reaction, but the Module can be found by my Smartphone and so the connection takes place.

The following code I’m going to compile (It’s about a Bluetooth connection to my Smartphone, turning on & off a led via Bluetooth)
It’s nearly the same code I got from this website: http://www.seeedstudio.com/wiki/index.php?title=Bluetooth_Shield

#include <Arduino.h>
#include <SoftwareSerial.h>

#define RxD         6
#define TxD         7

#define PINLED      9

#define LEDON()     digitalWrite(PINLED, HIGH)
#define LEDOFF()    digitalWrite(PINLED, LOW)

#define DEBUG_ENABLED  1

SoftwareSerial blueToothSerial(RxD,TxD);

void setupBlueToothConnection()
{
 blueToothSerial.begin(38400);                           // Set BluetoothBee BaudRate to default baud rate 38400
 blueToothSerial.print("\r\n+STWMOD=0\r\n");             // set the bluetooth work in slave mode
 blueToothSerial.print("\r\n+STNA=SeeedBTSlave\r\n");    // set the bluetooth name as "SeeedBTSlave"
 blueToothSerial.print("\r\n+STOAUT=1\r\n");             // Permit Paired device to connect me
 blueToothSerial.print("\r\n+STAUTO=0\r\n");             // Auto-connection should be forbidden here
 delay(2000);                                            // This delay is required.
 blueToothSerial.print("\r\n+INQ=1\r\n");                // make the slave bluetooth inquirable
 Serial.println("The slave bluetooth is inquirable!");
 delay(2000);                                            // This delay is required.
 blueToothSerial.flush();
}

void setup()
{
 Serial.begin(9600);
 pinMode(RxD, INPUT);
 pinMode(TxD, OUTPUT);
 pinMode(PINLED, OUTPUT);
 LEDOFF();
 
 setupBlueToothConnection();
}

void loop()
{
 char recvChar;
 
 while(1)
 {
 if(blueToothSerial.available())
 {//check if there's any data sent from the remote bluetooth shield
 recvChar = blueToothSerial.read();
 Serial.print(recvChar);
 
 if(recvChar == '1')
 {
 LEDON();
 }
 else if(recvChar == '0')
 {
 LEDOFF();
 }
 }
 }
}

PS: the SoftwareSerial.cpp is imported through the Solution Explorer and the library added to Toolchain > AVR/GNU C++ Compiler > Directories

BTW: simple LED-blinking files are working, where i don’t need a serial communication like Bluetooth

B.R.
D.

Hi, i have a similary problem but i use the attiny85. You have solved it?