UART receive is not working in STM8S
Problem get solved by commenting HSI

#include &lt;iostm8s003f3.h&gt;
#include &lt;intrinsics.h&gt;
#include &lt;stdio.h&gt;

void InitialiseSystemClock()
{
 CLK_ICKR = 0;                       //  Reset the Internal Clock Register.
 //CLK_ICKR_HSIEN = 1;                 //  Enable the HSI.
 CLK_ECKR = 0;                       //  Disable the external clock.
 //while (CLK_ICKR_HSIRDY == 0);       //  Wait for the HSI to be ready for     use.
CLK_CKDIVR = 0;                     //  Ensure the clocks are running at full speed.
CLK_PCKENR1 = 0xff;                 //  Enable all peripheral clocks.
CLK_PCKENR2 = 0xff;                 //  Ditto.
CLK_CCOR = 0;                       //  Turn off CCO.
CLK_HSITRIMR = 0;                   //  Turn off any HSIU trimming.
CLK_SWIMCCR = 0;                    //  Set SWIM to run at clock / 2.
CLK_SWR = 0xe1;                     //  Use HSI as the clock source.
CLK_SWCR = 0;                       //  Reset the clock switch control register.
CLK_SWCR_SWEN = 1;                  //  Enable switching.
while (CLK_SWCR_SWBSY != 0);        //  Pause while the clock switch isbusy.
}


while rest of the program is same.

Could anybody explain me this. It worked but i don't know how and why?