Q2: CAN transmission in a proper way?

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

Q2: CAN transmission in a proper way?

996 Views
gmk1
Contributor III

I have custom made LPC54618 board & I want to communicate with x number of other CAN devices.
I have used MCAN_TransferSendBlocking() function till now which worked until number of devices are less.
I certainly moved to MCAN_TransferSendNonBlocking() for better transmission but it is not working properly.
It stays in that function forever. Does anybody has working solution?

Thanks...

Labels (3)
0 Kudos
5 Replies

903 Views
frank_m
Senior Contributor III
I have used MCAN_TransferSendBlocking() function till now which worked until number of devices are less.

It is not clear to me what you mean, especiall with "number of devices are less".

Check that your bus is not in "error passive" state.

Perhaps you have a termination issue. Can you see bus traffic with a scope ?

I think a blocking send is quite a bad idea on a non-synchronous and non-deterministic bus like CAN.

0 Kudos

903 Views
gmk1
Contributor III

Hi frank, device in the sense BMS. This is the scenario, when 3 BMSs are communicating successfully on a CAN line, if I add one more BMS to the same line, one of the communicating BMS will stop communicating (while at the same time) the newly added BMS will communicate successfully. 

I surely know that Blocking send is very bad idea because I want 20 BMSs to communicate on the same bus (which will somehow will not work at some point of time).

I'm unable to get non-blocking send work properly. Can you help me in this regard?

0 Kudos

903 Views
frank_m
Senior Contributor III
...if I add one more BMS to the same line, one of the communicating BMS will stop communicating (while at the same time) the newly added BMS will communicate successfully.

This does not sound like a physical issue with the bus.

Not sure what you mean with "BMS". But I suggest to read the manual of this device. Has it any limitations in regard to identical devices on one bus ?

My company, for example, works a lot with CANopen devices (sensors). Some older devices had DIP switches for ID selection. limiting the number of devices on the bus (CANopen uses IDs similar to addresses).

You BMS device firmware might be buggy. I would suggest to record the CAN bus traffic in a fail scenario, and evaluate the trace.

0 Kudos

903 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Friend,

As you know that the CAN packet has priority, the lower the target ID(identification)  in the CAN packet is, the higher priority the CAN packet has. in other words, the ID with 0x00 in packet has the highest priority. Based on the CAN arbitration rule, the CAN packet with the lower ID sends firstly.

So pls decrease the target ID number in a multiple CAN nodes environment.

Hope it can help you

BR

XiangJun Rong

0 Kudos

903 Views
gmk1
Contributor III

hi xiangjun.rong

thanks for the reply.

there is no problem with ID priority.

it is a problem function MCAN_TransferSendNonBlocking() itself or maybe i'm not using it properly.

so share code if you have any working code of CAN transmission (not the one in sdk example). 

0 Kudos