2381850_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2381850_en-US

2381850_en-US

S32K344's rx interrupt can't work

Hi,

    I am working on S32K344's UART. We use this chip's UART0/UART1/UART8, and every UART connect to a RS485 chip and pull out A/B pin to external circuit. I connect UART1 RS485's A to UART8' RS485's A, and UART1 RS485's B to UART8' RS485's B. I set UART1 RS485's DE/RE=1, and UART8 RS485's DE/RE=0. I try to send data from UART1 to UART8, and I observe there is waveform in LPUART1_TX and LPUART8_RX in scope. That means, data has been sent from UART1 to UART8. But there is no rx interrupt in UART8, so the uart8's rx procedure can't run. During Debug, I can see the UART8 CTRL's RE=1/RIE=1 , but STAT's RDRF=0. I switch to UART8 sending and UART1's receiving, but the phenomeno is same. Could you help to check where is the problem? I attach the project. Thanks.

Communication & Control(I3C | I2C | SPI | FlexCAN | Ethernet | FlexIO)S32K344's rx interrupt can't work

Hi Julián,

Thank you for your reply. Yes, other interrups, such CAN, PIT is OK. Now I comments out all code in callback(that means tx and rx interrupt won't run the rx function in callback), but the code still can't run out of the check receiver status loop and can't get RDRF flag set(see red rectangle in interrupt.png). I don't use Rx FIFO, so, when data is received, the RDRF ought to become 1. But it dosen't. I send char 'R'(ASCII=0x01010010) and 'Q'(ASCII=0x01010001) from UART1 and measure the the UART1's TXD and UART8's RXD, it seems the waveform is correct. Is there any other possible reason to cause this issue?

I also attach my SDK version.

Re: S32K344's rx interrupt can't work

Hi @Jimmybai,

I imagine other interrupts work with no issue? (PIT, CAN, etc). Are you pinning breakpoints inside the callback to confirm if interrupt is firing? 

From your code, I can see you are using both Lpuart_Uart_Ip_SyncReceive & Lpuart_Uart_Ip_AsyncReceive. SyncReceive uses polling, while AsyncReceive function enables reception and immediately leaves function. The application has to get the receive status to know when the receive is complete. After receiving is completed (defined number of bytes received), you need to call AsyncReceive again to start new reception.

However, inside the callback, instead of calling AsyncReceive again, use the Lpuart_Uart_Ip_SyncReceive function for blocking reception. You never re-arm UART's reception. 

There are some examples in our community you can refer to: 

Best regards,
Julián

Re: S32K344's rx interrupt can't work

I wonder why my attachment is missing. re-attach it.

タグ(1)
評価なし
バージョン履歴
最終更新日:
昨日
更新者: