CAN is BUSY

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAN is BUSY

Jump to solution
2,023 Views
ZzzzzZzzzz
Contributor III

I used the S32K118EVB_64 development board and used the CAN function, but found that the function of receiving and sending could not be realized.I used the can_pal_s32k118 routine and found that the send status of CAN  returning BUSY.In LOOKBACK mode, it can send and receive,but they are always BUSY in normal mode,and the CAN_H and CAN_L connections of CAN are correct, May I ask what is the reason?

0 Kudos
1 Solution
1,950 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I meant the situation when SBC is in Forced Normal mode then its V2 supply is active and CAN transceiver enabled. Then with bus disconnected V2 is 5V and RX pin high. in this case FlexCAN is able to communicate.
If you see V2 unpowered and RX low, even if SBC is powered by 12V most probably it is not in default Forced Normal mode. it is enough to run demo SBC example to leave this mode.
So either control SBC over SPI or try t
o reset the UJA1169 Transceiver to Default Mode. You need to follow next procedure:

Connect the SBC transceiver in next configuration with the board S32K118EVB-Q64 power off :
• pin RSTN from SBC is held LOW
• CANH(J13.1) is pulled up to VBAT(J11.2)
• CANL(J13.2) is pulled down to GND(J13.4)
Now Power on the board with external supply 12V (J16) with the connections above in place after power on cycle disconnect the configuration above and connect for normal can communication and should work. 

BR, Petr

View solution in original post

0 Kudos
13 Replies
2,017 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

check value of ESR/ECR registers if any error are detected. There could be various root causes, like pin setting, active transceiver, bit timing setting etc.
Be sure board is powered by 12V to have SBC powered. By default SBC CAN transceiver should be active if you did not program SBC anyhow.

BR, Petr

0 Kudos
2,008 Views
ZzzzzZzzzz
Contributor III
In ESR1, it is suggested that FlexCAN is not synchronized to the CAN bus. What might be the cause of this?
0 Kudos
2,006 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

pin setup, or transceiver issue (not active). FlexCAN must see 1 on RX pin to see bus idle and be able to synchronize.

BR, Petr

0 Kudos
2,002 Views
ZzzzzZzzzz
Contributor III

Hi,
The pins I use are PTE4 and PTE5,here are the configuration instructions.Can you help me see what the problem is?

ZzzzzZzzzz_0-1684846965369.png

 

ZzzzzZzzzz_1-1684846973358.png

 

ZzzzzZzzzz_2-1684847023415.png

I didn't use the FIFO and CANFD functions.

ZzzzzZzzzz_3-1684847119829.png

About the transceiver, how to judge it is active state, I just measured that its power supply is 5V, and the RX pin of MCU is always 0,the measured value at the front end of the transceiver is 0,I don't know how to make it become 1.

 

 

0 Kudos
1,984 Views
ZzzzzZzzzz
Contributor III

Hi,

I don't have SPI at the moment.

A 12V power supply has been connected to the J16. I measure RX pin low, V2 is 0V.

I remember you told me before that when RX pin is high, the bus will be synchronized. But now you say RX pin is high when it is not synchronized. Is there something wrong with my understanding?

In addition, I am a little confused. Even if the transceiver is not normal, there should be a signal at the input end of the transceiver, or I understand wrong.

0 Kudos
1,951 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I meant the situation when SBC is in Forced Normal mode then its V2 supply is active and CAN transceiver enabled. Then with bus disconnected V2 is 5V and RX pin high. in this case FlexCAN is able to communicate.
If you see V2 unpowered and RX low, even if SBC is powered by 12V most probably it is not in default Forced Normal mode. it is enough to run demo SBC example to leave this mode.
So either control SBC over SPI or try t
o reset the UJA1169 Transceiver to Default Mode. You need to follow next procedure:

Connect the SBC transceiver in next configuration with the board S32K118EVB-Q64 power off :
• pin RSTN from SBC is held LOW
• CANH(J13.1) is pulled up to VBAT(J11.2)
• CANL(J13.2) is pulled down to GND(J13.4)
Now Power on the board with external supply 12V (J16) with the connections above in place after power on cycle disconnect the configuration above and connect for normal can communication and should work. 

BR, Petr

0 Kudos
1,886 Views
ZzzzzZzzzz
Contributor III

Hi,

My problem has been solved. Thank you very much for your help!

 

0 Kudos
1,909 Views
ZzzzzZzzzz
Contributor III

Hi,

I only have a development board here, but I am not sure whether my DEMO software is correct. Can you give me a correct DEMO software.

0 Kudos
1,997 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you can read SBC's register using SPI to know status. 
Do you have external 12V connected to J16? If SBC is in Forced Normal mode then its V2 supply is active and CAN transceiver enabled. With bus disconnected V2 is 5V and RX pin high.
If not you can configure SBC via SPI or try to rest it to Forced Normal mode. read SBC datasheet or example description for this.

BR, Petr

0 Kudos
1,962 Views
ZzzzzZzzzz
Contributor III

Hi,

I would like to know how software in general results in CAN status being BUSY and not being able to sync to the bus.  Otherwise,does the bus fail after initialization? I read in the documentation that it starts synchronizing the bus after initialization.

0 Kudos
1,955 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the FlexCAN module is leaving from Freeze mode to Normal mode at the end of initialization. At that time teh module is trying to synchronize to the bus by waiting for 11 successive recessive bits on bus (recessive bit means level 1 on RX pin). If the RX pin is held low by disabled transceiver, FlexCAN cannot be synchronized and no message will be transmitted/received.

In SW you can prepare message for transmission, but it never happens in this case and function returns BUSY when called again.

BR, Petr

0 Kudos
1,951 Views
ZzzzzZzzzz
Contributor III

Hi,

I have some new progress. By looking at the register, I found that it had been synchronized to the BUS after initialization, but when sending the data, an error occurred, resulting in the BUS OFF state with BIT0ERR, as shown below:

ZzzzzZzzzz_0-1684918416432.png

By Step into , I find that an error has occurred in this function:

ZzzzzZzzzz_1-1684918446662.png

 

When executing to 1, there are no errors, but when executing to 2, the error shown in the first figure occurs.

ZzzzzZzzzz_3-1684918544863.png

According to the FlexCAN transmit process of S32K1xx Series Reference Manual document, I haven't found any problem at present. Could you give me some suggestions?

 

 

0 Kudos
1,977 Views
ZzzzzZzzzz
Contributor III

Hi,

 There are some mistakes, but I don't understand. Can you help me to look at it? Below are the registers of ESR1, ECR and ESR2.

ZzzzzZzzzz_0-1684842892367.png

The PIN configuration uses PTE4 and PTE5, and MUX selects the CAN function.

The baud rate is set at 500Kbit, uses a 40MHz crystal oscillator clock, and carries out 4 frequency division, below is the baud rate configuration.

ZzzzzZzzzz_1-1684843280330.png

The 12V power supply is normal.

I see that the CAN transceiver of the development board is powered by 5V, which is also normal after measurement.

ZzzzzZzzzz_2-1684843482911.png

I don't know how to change SBC, so it should be in the default state.

As for active transceiver, I don't understand. Is it working properly.

In LOOKBACK mode, I can send and receive data normally, but I cannot send and receive data normally in Normal mode. TX pin of MCU is always high level and RX pin is always low level.

 

 

 

 

0 Kudos