This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Interrupt in the middle of serial transmission?

Hi,

This is a followup from another issue (link) which helped with. 

The suggestion to modify nrf_serial.c fixed the previous problem, and you can see that the TE (transmit enable) signal goes high for the full duration of the message, and goes low only after the full message successfully transmits. 

However, there is a strange gap in the middle of the transmitted message. I am guessing it is an interrupt, but it is a pretty long one (1.3 ms). Note, this does not happen every single time I transmit a message, only sometimes. How can I make sure the full message transmits uninterrupted? 

Also, just checking, but what adverse consequences might result from blocking interrupts for the length of one message? I expect the max message length would be about this long, about 6ms to transmit, certainly less than 10ms. 

Thanks!

Parents
  • Hi 

    Do you know if you are using the UART or UARTE peripheral under the hood?

    If easyDMA is enabled you will be using the UARTE peripheral. 

    If you are using the legacy UART peripheral then the UART transmission can be interrupted by other system interrupts, but 1.3ms is a very long time to be interrupted. Do you know of any interrupt sources in your application that could be this long?

    Interrupting everything else for 6-10ms is not ideal, and it will definitely cause issues if you are running a SoftDevice stack on the side. Hopefully we can figure out what is causing this gap in the communication. 

    Best regards
    Torbjørn

  • Thanks so much for this extra information, I was able to find out what was causing this gap and remove it! It was silly, a debug print statement (NRF_LOG_RAW_INFO) immediately following the serial_write call. It took so long because it looped through the entire message in order to print it. Thank you for your help!

Reply Children
Related