Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
8 years ago.
how can i change or better configure STDIO output to other UART output source in Mbed ?
i find 3 defines #define STDIO_UART_TX #define STDIO_UART_RX and #define STDIO_UART in peripheralnames.h. and i make adaption to these 3 defines to the right pins from the UART which i expect to print out the STDIO. but just i experted that does not work. i actaully think i must give some UART input and output physical address to stdin and stdout like for example stdin = & uart_in; stdout=&uart_out or call some function that provide the service to me. that should be in my opinion the right way. but i didn´t find some. do anyone know how i can achieve that in mbed environment? thanks a lot!
1 Answer
8 years ago.
Hi Rui,
So the easiest way to do this using mbed is to use the Serial API here
here you can declare the object and supply it with your desired pins to output to. There are also lots of other functions you can use with it. If you want to use it with the USB over serial see below. If not put in your own 'tx' and 'rx'.
One of the Serial connections goes via the mbed USB port, allowing you to easily communicate with your host PC.
Hello World!
Let me know if this helps :)
Regards,
Andrea, team mbed
hello Andrea! thanks for your answer. but i think you might misunderstand my question. what i meant is to find a solution to affect the output canal of stdio library function printf() not some redefined public class function. what you suggested may be an alternative solution to replace the stdio library printf() function call allover the project and define a Serial class instance. it must have a simple solution not more as to change some defines or some assignment to achieve this goal. please reconsider this! and give me a feedback whether this is possible or not? thanks.
posted by 26 Oct 2016