Skip to content

Serial Flush blocks forever but not only at programm start #678

@WMuellSika

Description

@WMuellSika

Hi there

I have a similar issue to #597, but not at the start of my program.

In my code, there is a function which looks like this:

void SlaveWaterCOM::send() {

    digitalWrite(2, HIGH);

    Serial1.write(outbuffer.dataarray, 28);
    
    Serial1.flush();

    digitalWrite(2, LOW);
}

The function communicates via the Serial1 over a MAX3075, and therefore it needs an enablepin for the driver.

In my program, this is the only point I use the Serial1.write or the Serial1.flush command.

Sadly, the program sometimes hangs at the Serial. Flush() command.

I tracked the issue down to the Sercom->USART.INTFLAG.bit.TXC flag, which seems to never be written.

Has anyone a clue why this could be?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions