Serial1 7O1 status

Hello, I would like to ask what is the current status of the 7O1(7E1 seems to have the same behavior) Serial1 mode. I am running this simple loop-back test, which I expect it to print the “hello\n” string on each loop iteration, but it does not (never gets in the while loop). Furthermore, I found that the Serial1.available() > 0 condition is necessary, because it would return negative values, thus printing junk chars in the while loop.

#include "application.h"
#include "stdarg.h"

void setup() {
    Serial.begin();
    // SERIAL_8N1 works properly
    Serial1.begin(19200, SERIAL_7O1);

    while (!Serial1) {
        delay(500);
    }
    while (!Serial) {
        delay(500);
    }  
}

void loop() {
    
    static uint32_t msLastTime = 0;
    if (millis() - msLastTime > 1000) {
        msLastTime = millis();
        Serial1.println("hello");     // Write to Serial1
    }
    
    while (Serial1.available() > 0) {
        char c = Serial1.read();
        Serial.printlnf("%d, %c: available buffer %d\n", c, c, Serial1.available());    // Write to USB
        delay(100);
    }

    delay(800);
}

That's an issue that was already reported (see comment thread there)
https://github.com/particle-iot/device-os/issues/1737

You can open a new one for the 7x1 issue you found and reference #1737 in yours too to get some tracktion on the whole UART story.

There are only two allowed options on Gen 3 devices for serial at this time:

Pre-defined Serial configurations available:

  • SERIAL_8N1 - 8 data bits, no parity, 1 stop bit (default)
  • SERIAL_8E1 - 8 data bits, even parity, 1 stop bit

Other options, including odd parity, and 7 and 9 bit modes, are not available on the Boron.

Thank you all, for your quick responses.