Skip to main content
shaktishekhar789
Associate III
February 26, 2013
Question

STM32W108xx UART implementation

  • February 26, 2013
  • 23 replies
  • 3604 views
Posted on February 26, 2013 at 10:10

Hi 

I want to show the output(i.e. sended data) on tera term terminal. How to setup tera term for that.(I am using UART for serial communication in which i am sending data from one port and receiving from other one.) Please reply me asap.

    This topic has been closed for replies.

    23 replies

    Tesla DeLorean
    Guru
    March 1, 2013
    Posted on March 01, 2013 at 15:34

    No idea, good luck with your project.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    kavithanathan08
    Associate
    April 25, 2013
    Posted on April 25, 2013 at 14:50

    Hi,

    I am currently using STM32w108CB microcontroller for my project. the board which i am using is developped by us. I wrote a serial communication program and was trying to view the transmitted data in a hyperterminal window. But I could not see any data in the hyperterminal window. It could also be the problem with the board. So, I tried to display the printf (''Hello world \n'') in the serial window of keil using semihosting. But I did not see anything in the UART1 window. Is there a way to display the string (hello world) in the UART window only by simulation before connecting the board?

    I tried the following method to display the printf(''Hello world \n'') in the UART window.

    #ifdef __GNUC__

      /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf set to 'Yes') calls __io_putchar() */

      #define PUTCHAR_PROTOTYPE int __io_putchar(int ch)

      #else

      #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)

      #endif /* __GNUC__ */

    PUTCHAR_PROTOTYPE

    {

      /* Place your implementation of fputc here */

      /* e.g. write a character to the UART */

      UART_SendData(SC1_UART, (uint8_t) ch);

      /* Loop until transmit data register is empty */

      while (UART_GetFlagStatus(SC1_UART, UART_FLAG_TXE) == RESET)

      { }

      return ch;

    }

    When it enters the

    UART_GetFlagStatus(SC1_UART, UART_FLAG_TXE) == RESET) it continuously executing this statement indefinitely.

    Hope you could help me with some usuful suggestions.

    Tesla DeLorean
    Guru
    April 25, 2013
    Posted on April 25, 2013 at 15:38

    Sounds like the clocks aren't enabled for the peripheral. Absent initialization code hard to know.

    Do the firmware examples work?

    STM32W108xx_StdPeriph_Lib_V1.0.1\Projects\STM32W108xx_StdPeriph_Examples\SC\UART\UART_Printf

    Remember you really should front test TXE before stuffing data in the register.
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..