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.
7 years, 3 months ago.
Using MODSERIAL with a different Uart
I'm trying to use MODSERIAL to redirect the printf function down a serial port on my NUCLEO F401RE. My code with the straightforward serial works, but when I use the MODSERIAL to declare my uart, I get a message down the STM USB interface saying: "MODSERIAL must have a defined UART to function".
Code looks like this:
MODSERIAL uart(PC_6, PC_7, "modser"); int main() { uart.claim(); // capture <stdout> uart.printf("goes to thru the MODSERIAL library\r\n"); printf("so does this!\r\n"); // after the last one, not preempting it. }
1 Answer
7 years, 3 months ago.
Could you please show where the object "pc" is defined? I don't know much about this libary, but it looks like your modserial object is defined as "uart", but there is another object called "pc".