Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
WMuellSika opened this issue Aug 31, 2022 · 0 comments
Open

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

WMuellSika opened this issue Aug 31, 2022 · 0 comments

Comments

@WMuellSika
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant