CAN mailboax doesnot read

Hi,

I am using CAN driver on r_can,connected two custom S5D9 kit connected as CAN_H to CAN_H,CAN_L to CAN_L (CAN high,CAN low :outputs of transciever MCP2562),I have checked that the impedance matching resistance is correct,i.e when both kits connected to each other,resistance between CAN_H and CAN_L is 60 ohm.I have reffered this application project https://www.renesas.com/us/en/software/D6001427.html as a guide,

I am transmitting message correctly ,verified that flag CAN_EVENT_TX_COMPLETE set in callback function based on switch action,when I try to read the message mailbox,api->read() in the same callback doesnot invoked.

I have read https://renesasrulz.com/synergy/f/synergy---forum/8510/driver-can-mailbox-group-mask thread and I tried changing group mask,read() in callback doesnot invoked.

setting in configuration.xml :-

7506.synergy_cfg.txt
Thread "CAN"
    Symbol: CAN
    Name: CAN
    Stack size (bytes): 1024
    Priority: 3
    Auto start: Enabled
    Time slicing interval (ticks): 1
    
    Instance "g_can0 CAN Driver on r_can"
      Name: g_can0
      Channel: 0
      Baud Rate Prescaler: 5
      Time Segment 1: 15 Time Quanta
      Time Segment 2: 8 Time Quanta
      Synchronization Jump Width: 4 Time Quanta
      Clock Source: CAN MCLK
      Callback: CAN_callback
      Overwrite/Overrrun Mode: Overwrite Mode
      Standard or Extended ID Mode: Standard ID Mode
      Number of Mailboxes: 32 Mailboxes
      Mailbox 0 ID: 0
      Mailbox 1 ID: 0x7FF
      Mailbox 2 ID: 2
      Mailbox 3 ID: 3
      Mailbox 4 ID: 4
      Mailbox 5 ID: 5
      Mailbox 6 ID: 6
      Mailbox 7 ID: 7
      Mailbox 8 ID: 8
      Mailbox 9 ID: 9
      Mailbox 10 ID: 10
      Mailbox 11 ID: 11
      Mailbox 12 ID: 12
      Mailbox 13 ID: 13
      Mailbox 14 ID: 14
      Mailbox 15 ID: 15
      Mailbox 16 ID: 16
      Mailbox 17 ID: 17
      Mailbox 18 ID: 18
      Mailbox 19 ID: 19
      Mailbox 20 ID: 20
      Mailbox 21 ID: 21
      Mailbox 22 ID: 22
      Mailbox 23 ID: 23
      Mailbox 24 ID: 24
      Mailbox 25 ID: 25
      Mailbox 26 ID: 26
      Mailbox 27 ID: 27
      Mailbox 28 ID: 28
      Mailbox 29 ID: 29
      Mailbox 30 ID: 30
      Mailbox 31 ID: 31
      Mailbox 0 Type: Transmit Mailbox
      Mailbox 1 Type: Receive Mailbox
      Mailbox 2 Type: Receive Mailbox
      Mailbox 3 Type: Receive Mailbox
      Mailbox 4 Type: Receive Mailbox
      Mailbox 5 Type: Receive Mailbox
      Mailbox 6 Type: Receive Mailbox
      Mailbox 7 Type: Receive Mailbox
      Mailbox 8 Type: Receive Mailbox
      Mailbox 9 Type: Receive Mailbox
      Mailbox 10 Type: Receive Mailbox
      Mailbox 11 Type: Receive Mailbox
      Mailbox 12 Type: Receive Mailbox
      Mailbox 13 Type: Receive Mailbox
      Mailbox 14 Type: Receive Mailbox
      Mailbox 15 Type: Receive Mailbox
      Mailbox 16 Type: Receive Mailbox
      Mailbox 17 Type: Receive Mailbox
      Mailbox 18 Type: Receive Mailbox
      Mailbox 19 Type: Receive Mailbox
      Mailbox 20 Type: Receive Mailbox
      Mailbox 21 Type: Receive Mailbox
      Mailbox 22 Type: Receive Mailbox
      Mailbox 23 Type: Receive Mailbox
      Mailbox 24 Type: Receive Mailbox
      Mailbox 25 Type: Receive Mailbox
      Mailbox 26 Type: Receive Mailbox
      Mailbox 27 Type: Receive Mailbox
      Mailbox 28 Type: Receive Mailbox
      Mailbox 29 Type: Receive Mailbox
      Mailbox 30 Type: Receive Mailbox
      Mailbox 31 Type: Receive Mailbox
      Mailbox 0 Frame Type: Remote Mailbox
      Mailbox 1 Frame Type: Data Mailbox
      Mailbox 2 Frame Type: Data Mailbox
      Mailbox 3 Frame Type: Data Mailbox
      Mailbox 4 Frame Type: Data Mailbox
      Mailbox 5 Frame Type: Data Mailbox
      Mailbox 6 Frame Type: Data Mailbox
      Mailbox 7 Frame Type: Data Mailbox
      Mailbox 8 Frame Type: Data Mailbox
      Mailbox 9 Frame Type: Data Mailbox
      Mailbox 10 Frame Type: Data Mailbox
      Mailbox 11 Frame Type: Data Mailbox
      Mailbox 12 Frame Type: Data Mailbox
      Mailbox 13 Frame Type: Data Mailbox
      Mailbox 14 Frame Type: Data Mailbox
      Mailbox 15 Frame Type: Data Mailbox
      Mailbox 16 Frame Type: Data Mailbox
      Mailbox 17 Frame Type: Data Mailbox
      Mailbox 18 Frame Type: Data Mailbox
      Mailbox 19 Frame Type: Data Mailbox
      Mailbox 20 Frame Type: Data Mailbox
      Mailbox 21 Frame Type: Data Mailbox
      Mailbox 22 Frame Type: Data Mailbox
      Mailbox 23 Frame Type: Data Mailbox
      Mailbox 24 Frame Type: Data Mailbox
      Mailbox 25 Frame Type: Data Mailbox
      Mailbox 26 Frame Type: Data Mailbox
      Mailbox 27 Frame Type: Data Mailbox
      Mailbox 28 Frame Type: Data Mailbox
      Mailbox 29 Frame Type: Data Mailbox
      Mailbox 30 Frame Type: Data Mailbox
      Mailbox 31 Frame Type: Data Mailbox
      Mailbox 0-3 Group Mask: 0x1FFFFFFF
      Mailbox 4-7 Group Mask: 0x1FFFFFFF
      Mailbox 8-11 Group Mask: 0x1FFFFFFF
      Mailbox 12-15 Group Mask: 0x1FFFFFFF
      Mailbox 16-19 Group Mask: 0x1FFFFFFF
      Mailbox 20-23 Group Mask: 0x1FFFFFFF
      Mailbox 24-27 Group Mask: 0x1FFFFFFF
      Mailbox 28-31 Group Mask: 0x1FFFFFFF
      Error Interrupt Priority: Priority 4
      Receive Mailbox Interrupt Priority: Priority 4
      Transmit Mailbox Interrupt Priority: Priority 4

CAN files:

0042.files.zip

 

happy to accept suggestion..

 

  • Are you trying to read the CAN message that you just transmitted on the SAME board? The CAN logic generally prevents that as you don't really want to read in every message you send. You should be able to read it on the second board. If you don't have a CAN bus analyzer, maybe a scope or logic analyzer would help you look at CAN_L to see if you see the data. If that's ok, then use a debugger on the second board to see if the receive FIFO has anything in it.
    If that's OK, the something is wrong with your code - filter setup, read, etc.

    Good luck,
    Larry
  • Or you can use external loopback mode to read in the message you just transmitted. You don't have to do any wiring changes - CAN always sees the message it is transmitting as part of the arbitration protocol.
  • In reply to larry_c_not_Renesas:

    Hi laryy,

    Thanks for your support.
    Can I ask your support on how to use external loopback mode.I am using standard mode(11 bit ID).
  • In reply to Kirti:

    Sure. Take a look at Section 3 in this document - www.renesas.com/.../r11an0065eu0101-synergy-can-hal-mod-guide.pdf

    Table 3 shows the different CAN modes - you want CAN_MODE_LOOPBACK_EXTERNAL.

    You may be able to set it from the GUI - but if not you'll have to set the mode via an API call in your code.

    Read that section well - it explains a lot of details on how the adapter and filters work, including that the CAN hardware will automatically filter out messages that are sent from the same adapter.

    Good luck
  • Hello Kirti,

    Has Larry answered all your questions? Can we close this case?

    Kind regards,
  • In reply to larry_c_not_Renesas:

    Hi Larry,

    Thanks for the support.

    I just included another instance of CAN channel in same thread ,modified callback function.Now I can read the tansmitted message from CAN channel 0 to Channel 1.
  • In reply to Sergey Sokol:

    Hi Sergey Sokol,

    Yes ,Larry has answered my question.Thanks