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?
Solved! Go to Solution.
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 to 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
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
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
Hi,
The pins I use are PTE4 and PTE5,here are the configuration instructions.Can you help me see what the problem is?
I didn't use the FIFO and CANFD functions.
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.
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.
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 to 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
Hi,
My problem has been solved. Thank you very much for your help!
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.
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
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.
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
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:
By Step into , I find that an error has occurred in this function:
When executing to 1, there are no errors, but when executing to 2, the error shown in the first figure occurs.
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?
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.
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.
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.
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.