3 years, 4 months ago.


This question is relevant to any project trying to bridge a platform's built in USB to UART controller with a second on board UART.


In my case, I'm trying to type AT style commands on a computer connected by USB to a NXP FRDM microcontroller that exposes UART0 (hardwired to USB) as well as UART1 on pins PTC3(RX) and PTC4(TX) connected to a LoRa IC:

FRDM-KL25Z Platform document
RN2483 IC device datasheet

Missing text output from second connected UART

#include "mbed.h"

Serial Conn(USBTX, USBRX);
Serial Lora(PTC4, PTC3);

int main() {
    Conn.baud(57600); // 57600 baud is specified in the
    Lora.baud(57600); // Microchip RN2483 datasheet
    Conn.printf("RN2483 Communication!\r\n"); // This works
    Lora.printf("sys get ver\r\n"); // This fails? No text returned.

    // Try passing characters
    while(1) {
        if(Conn.readable()) {
        if(Lora.readable()) {


This seems logically correct, and providing the 'PTC[34]' parameters to a RN2483 mbed library correctly communicates with the IC's UART and prints characters in my serial console. So why isn't anything appearing in my serial console when I manually configure (and avoid the RN2483 lib) two serial connections?


This problem was solved by properly capturing line ending characters and remapping to CR+LF which is what the IC device expects to terminate all command sequences. I may post more information (like a program) later.

1 Answer

2 years, 7 months ago.

Serial.printf works a bit weird. This is how I did it.

#include "mbed.h"
Serial lora(D8,D2);
Serial pc(USBTX,USBRX);
int main()

    char str[64] = "sys get ver\r\n\0";
    int i=0;
    while(str[i]!='\0') {
    while(1) {
        if(lora.readable()) {