> But if only 1 of the them is initialized, the initialized one can not receive the frames from itself
That's normal. A device on a CAN bus can only transmit a message if there is a different device on the same CAN bus that can receive that message, check it and send back the "ACK" bit. That device does not have to have filters set up to receive that message - it only has to be enabled (and at the right baud rate and so on). In the normal case, which is in a CAR, the first device that powers up will keep repeating the first packet (without signalling an error) until the SECOND device powers up and can send the ACK.
> theprogagation delay is 60ns. The baudrate is 1MHz. fsys/2=125MHz.
> PRESDIV = 4, RJW =0 ,PSEG1=7, PSEG2 =7,PROPSEG = 7.
So that's 125 MHz / 5 / 25. Good. that's exactly 1MHz.
If you are setting up a CAN bus you have to do all of the arithmetic to prove that the design is correct. You can't just plug things together and pick a baud-rate like you can with RS-232. CAN isn't like that.
Freescale (now NXP) has a good App Note on this topic. Search for and read AN1798.
Quickly analysing your delays, your Quanta are 25MHz or 40ns. PROPSEG is "7" so the value is "8". So your system is set up for an absolute maximum propagation delay of 8*40 or 320ns. That's the delay from the transmitter, out through its transceiver, then through any EMC-related hardware that you may have (capacitors slowing the signal down), then through that delay-thing, then through the Receiver's transceiver and into the receiver. Then the Ack has to travel in the reverse path back to the Transmitter, so double it. Is that less than 320ns worst case?
> But if I set the CANCTRL[RJW] = 3, the CAN communication becomes normal. Why?
Read AN1798.
Why did you choose "1" in the first place? There are special cases related to signal noise patterns and clocking where you might want to set SJW that low. It is more normal to set it "as high as you can", which is to set it to "3" unless PSEG1 or PSEG2 are less than 3, in which case SJW has to be limited to those values.
And then after doing all the maths, you should always connect an oscilloscope to the CAN bus and make sure the signals look like you expect them to, with the delays you expect. I had an interesting case where someone on another forum posted a picture of some very droopy CAN signals and their schematic and I was able to say "if those capacitors that are meant to be 330pF are actually 330nF then that will explain your problems" which turned out to be the case.
And if it isn't working (Antonio) then that's the FIRST thing you should do.
Tom