CAN Communication between two controllers

Hi,

I am trying to make two boards talking to each other using CAN port channel 0.One controller is transmitting on the channel 0 and receiving transmiited message on the 2nd controller CAN channel 0.Callback for CAN TX event occurs and I am able to see transmitted data on CAN analyser.But RX event in the same callback function does not occur.It occured only once.

1.In configuration.xml,have setup mailbox 0 for transmission and Mailbox 1 receiving data.I tried changing "mailbox 0-3 group mask" from 0x1FFFFFFF to same as "receive mailbox 1 ID ",RX event does not invoke. 

Followed r_can HAL module guide: r11an0065eu0101 revision 1.01

CAN File :CAN.zip

2.Also when I am in debug mode,and pause the debugging ,I get this    window due to which I dont know which line current execution is going on. I am not able to undertand this.

Happy to know anything I am missing for above two issues.

Cheers

  • Hello Forum,

    RX event in the callback function is occurring now,I change the operation mode as EXTERNAL LOOPBACK.I am able to see rx buffer with data loaded in it,But when I connect CAN HI or CAN Lo pin of second board on oscilloscope,It doesnot show any data(pulses),Just first board shows CAN port output.It means data transmitted from CAN port of board-1 is not actually received by CAN port board-2.

    Any thoughts please.I am stuck thinking what to try to be able to see data on 2nd board.
  • In reply to Kirti:

    The second board should have a receiver very similar to your first board.
    You should set the CAN MODE of both boards to CAN_MODE_NORMAL.

    Remember, for a CAN transmit to be successful, it must be ACKED by another node, otherwise the sender will just keep trying to resend and you'll see continuous traffic.

    lc
  • In reply to larry_c_not_Renesas:

    Hi,
    Thanks for the reply .
    May I ask an example on how to ACK by another node.I have same receiver for second board as on the first board.
    I am loading both the board with same software and debugger is connected to first board.
  • In reply to Kirti:

    The ACK is automatic, provided by the other board CAN adapter when properly connected and the bus is terminated. It also needs to be in CAN_MODE_NORMAL.
  • In reply to larry_c_not_Renesas:

    Hi,
    Was able to receive transmitted data only once.This is how I have done hardware conection,CAN channel 0 Port of both the boards connected to each other with twisted CAN_hi ,CAN_low wire .
    Set the both the board with CAN_MODE_NORMAL.
    With the debugger connected on 1st board,transmitted 8-byte data on the bus,then stopped debug session and connected debugger to 2nd board ,started debug session ,could see receive event occured.(Is this correct method to receive on the 2nd board ?)
    I tried repeating same process.But it wasjust transmitting.
  • In reply to Kirti:

    Add some printfs to both ends vs debugger.
    Is ground on can bus connected between boards?
    50o term between canl and canh?
    Is packet on wire sent once or repeatedly.
    CaN ids set both nodes?
    Filter set on receiver - all is ok.
    Good luck
  • In reply to larry_c_not_Renesas:

    Do you mean to use two separate debugger on both ends ?
    packet on wire is sent repeatedly.
    rest of things are ok
  • In reply to Kirti:

    I meant instead of using the debugger, use printfs to verify packet sent and received.

    If the packet is sent out almost continuously then it is NOT being acked by the receiver. Something is wrong with the network. You need canh, canl, and ground - 3 wires and 50 ohms resistor between canh and canl, on one end or the other or on the cable. This sounds electrical.