7 years, 3 months ago.

UART rx pin should be low during enabling RxIrq

Hi,

I have come across this problem, and solved it, but I think there might be a fix fix in a more simple way. My app on Nucleo-F767ZI did hang when I enabled RxIrq on UART7_RX (PE_7), but only if it is not held at "0" upfront during enabling the interrupt (dmx_uart.attach(NULL, Serial::RxIrq);). And I needed to keep it "0" up to 0.25 seconds after enabling the interrupt. Then all works fine. However the rx signal will be there all of the time, as it comes from an external (dmx512) source. So I "fixed" it by added an AND gate, one input pin to an DigitalOut, the other to the signal, the output to the rx pin PE_7, so I can force it to low level. It then needs to be low up to 0.25 sec after enabling the interrupt.

    dmx_rx_gate = 0;
    dmx_uart.attach(callback(this, &DMX512::dmx_rx_interrupt), Serial::RxIrq);
    wait(0.5); // Wait at least 0.25 sec, but better 0.5 sec to be safe!
    dmx_rx_gate = 1;

After this fix, all worked fine.

What could be the cause?

Kind regards, Jack.

So it hangs if you permanently connect it to '1'? That is weird, and really broken if that indeed happens, since '1' is the idle state. When it hangs, does it call the RxIRQ permanently?

posted by Erik - 15 Dec 2016
Be the first to answer this question.