TX Polling Not Working when setting RX interrupt stm32f103rc
This is the correct answer. Thanks to Everyone

/* Project: USART(Interrupt RX)
 * Author : Devjeet Mandal   
 * Date   : 15/2/2018       11:48
 * 
 */

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include &lt;string.h&gt;

/* Private define ------------------------------------------------------------*/
#define SYSCLK   72000000
#define BAUD            115200

#define LED_PORT_EN()           ( RCC-&gt;APB2ENR |= RCC_APB2ENR_IOPDEN )
#define LED_PORT                    GPIOD

#define LED_MODE_BIT1           8
#define LED_MODE_BIT2           9
#define LED_CNF_BIT1            10
#define LED_CNF_BIT2            11

/* Private macro -------------------------------------------------------------*/
#define CNF_SET_PORTD(BIT1,BIT2)            (   LED_PORT-&gt;CRL &amp;= ~((1&lt;&lt;BIT1) | (1&lt;&lt;BIT2)) )                 //General purpose output push-pull
#define MODE_SET_PORTD(BIT1,BIT2)           ( LED_PORT-&gt;CRL |=  (1&lt;&lt;BIT1) | (1&lt;&lt;BIT2) )                     //Output mode, max speed 50 MHz.

#define SET_GPIO_BIT_PORTD(BIT)             ( LED_PORT-&gt;BSRR =  (1 &lt;&lt; BIT) )                                            //For setting the Bit   
#define RESET_GPIO_BIT_PORTD(BIT)           ( LED_PORT-&gt;BSRR =  ( (1 &lt;&lt; BIT) &lt;&lt; 16 )    )                       //For Resseting Bit

/* Private function prototypes -----------------------------------------------*/
 void Delay(int ms);
 void Led_Init(void);
 void Blink_Led(int ms);
 void Transmit_Char(char data);
 void Transmit_String(char *str);
 void USART_Init(void);
 void NVIC_Init(void);
 void USART1_IRQHandler(void);
 void Clear_Buffer(char *str);

 /* Private variables ---------------------------------------------------------*/
 __IO uint16_t datapos;
 char rx_data[255];


 int main(void)
 {
     Led_Init();
     USART_Init();
     NVIC_Init();
     datapos = 0;
     while(1)
     {
         if(strstr(rx_data,"led on\r"))
         {
                RESET_GPIO_BIT_PORTD(2);                        //Make Led High
                Transmit_String("\nLED is ON\r\n");
              datapos = 0;
              Clear_Buffer(rx_data);
         }
         else if(strstr(rx_data,"led off\r"))
         {
                SET_GPIO_BIT_PORTD(2);                      //Make Led Low
                Transmit_String("\nLED is OFF\r\n");
              datapos = 0;
              Clear_Buffer(rx_data);
         }
         Delay(1000);
     }
 }

 /** @breif: Clear Buffer
     * @param: Buffer to be cleared
     * @retVal: None
   */
 void Clear_Buffer(char *str)
 {
     while (*str != '\0')
     {
         *str = 0;
         str++;
     }
 }


 /** @breif: USART1 IRQ
     * @param: None
     * @retVal: None
   */
 void USART1_IRQHandler(void)
 {
     if(USART1-&gt;SR &amp; USART_SR_RXNE)
     {
            rx_data[datapos] = USART1-&gt;DR;
            datapos++;
            if (datapos &gt; 255 )
            {
                datapos = 0;
                Clear_Buffer(rx_data);
            }
   }  
 }

 /** @breif: Initialize setting for NVIC
     * @param: None
     * @retVal: None
   */
 void NVIC_Init()
 {
     NVIC_EnableIRQ(USART1_IRQn);
     NVIC_SetPriority(USART1_IRQn, 0);
 }

 /** @breif: Initialize setting for Usart
     * @param: None
     * @retVal: None
   */

 void USART_Init()
 {
     /*Enable Clock for USART port and USART1 */
     RCC-&gt;APB2ENR |=  RCC_APB2ENR_IOPAEN | RCC_APB2ENR_USART1EN;
     /*Rx,Tx setup GPIOA-&gt;CRH = 0x000004B0*/
     GPIOA-&gt;CRH |= GPIO_CRH_MODE9;          // Tx Mode- 11: Output mode, max speed 50 MHz.
     GPIOA-&gt;CRH |= GPIO_CRH_CNF9_1;         // Tx CNF - 10: Alternate function output Push-pull
     GPIOA-&gt;CRH &amp;= ~(GPIO_CRH_CNF9_0);

     GPIOA-&gt;CRH &amp;= ~(GPIO_CRH_MODE10);  // Rx Mode- 00: Input mode (reset state)
     GPIOA-&gt;CRH |= GPIO_CRH_CNF10_0;    // Rx CNF - 01: Floating input (reset state)*/
     /* Baud rate set 72MHz/115200 */
     USART1-&gt;BRR = SYSCLK/BAUD;
     /*Enable Rx, Enable Tx, Enable USART*/
     USART1-&gt;CR1 = USART_CR1_RE | USART_CR1_TE | USART_CR1_UE;
     USART1-&gt;CR1 |= USART_CR1_RXNEIE;  //enable rx interrupt
 }


  /** @breif: Transmit a String
     * @param: the string to be transmitted
     * @retVal: None
   */
 void Transmit_String(char *str)
 {
     while(*str != '\0')
     {
         Transmit_Char(*str);
         str++;
     }
 }

 /** @breif: Transmit a character
     * @param: the character to be transmitted
     * @retVal: None
   */

void Transmit_Char(char data)
{
    while (!(USART1-&gt;SR &amp; USART_SR_TXE));
    USART1-&gt;DR = data;
}


/** @breif: For wait and doing nothing i.e for delay
     * @param: delaya time
     * @retVal: None
   */


    void Delay(int ms)
    {
        int i,j; 
        for (i = 0; i &lt; ms; ++i) {
            for (j = 0; j &lt; 1000; ++j);
            }
    }


 /** @breif: Initalize GPIO For Led
     * @param: None
     * @retVal: None
   */


    void Led_Init()
    {
        LED_PORT_EN();                                                              //Enable RCC for Led Port
        CNF_SET_PORTD(LED_CNF_BIT1,LED_CNF_BIT2);           //SET CNF       General purpose output push-pull
        MODE_SET_PORTD(LED_MODE_BIT1,LED_MODE_BIT2);    //SET MODE  Output mode, max speed 50 MHz. 
    }


 /** @breif: Blink Led Placed in PORT D Pin 2
     * @param: Delay for each state(ON/OFF)
     * @retVal: None
   */


    void Blink_Led(int ms)
    {
        RESET_GPIO_BIT_PORTD(2);                        //Make Led High
        Delay(ms);                                                  //wait
        SET_GPIO_BIT_PORTD(2);                          //Make Led Low
        Delay(ms);                                                  //wait
    }