This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

printf, uart0 and libuarte ?

Dear Members,

I want to use print for debugging with uart0 and libuarte,

I can only dislpay 1 character, what should I change ?

Thanks

Code :

#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)
	#define GETCHAR_PROTOTYPE int __io_getchar(int ch)
	
#else
  #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
	#define GETCHAR_PROTOTYPE int fgetc(int ch, FILE *f)	
	
#endif /* __GNUC__ */

/**
  * @brief  Retargets the C library printf function to the USART.
  * @param  None
  * @retval None
  */
PUTCHAR_PROTOTYPE  
{
	   
    /* Place your implementation of fputc here */
    /* e.g. write a character to the USART */
	
    nrf_libuarte_async_tx(&libuarte, (uint8_t *)&ch, 2);
	  
    return ch;
}	

.
.
.
               uint32_t t;
             t =  nrf_systick_val_get();
			 printf("Systick : %u\r\n",t);

Related