CAN Transmission generating Reception Interrupt

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

CAN Transmission generating Reception Interrupt

1,361 Views
dhanushkumar_n
Contributor I

Hi ,

I have been developing code for CAN driver upon the Base SDK  Code for my project ,I have configured my Reception through an interrupt and transmitting data outside through normal transfer function ,but when ever I send the data out of CAN I am receiving back again the same message as an interrupt to the Message buffer I configured for different Message ID ,and also whenever I send data to controller (Using PCAN) it is being received by only single MB(MB 2)which is configured for different Message ID .request to help me solving this .

Note: Configured for individual Mask ,Baud : 500K and Max MB 24 apart from Default Configuration .

CAN.C  and CAN.h file attached below.

Labels (1)
0 Kudos
10 Replies

1,218 Views
dhanushkumar_n
Contributor I

Hi,

I have configured to a Global filter ,i have found that CAN is having problem in syncing to the bus while operating only in RTOS Mode , CAN is absolutely working fine in normal mode ,

i have found that inside API FLEXCAN_Init ESR1 register value must be updated to value (262272),which indicates CAN synchronised to CAN bus and Bus state as IDLE,but in RTOS mode ESR1 value is absolutely ZERO(0). and DB1 register is also not updating for the same synchronisation issue.

i'm presuming this might be the issue of clock synchronisation.

Thank you . 

0 Kudos

1,218 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Dhanush,

Are you configuring the CAN module after or before the scheduler is running? I will suggest to configure it before the scheduler starts.

Best Regards,

Alexis Andalon

0 Kudos

1,218 Views
dhanushkumar_n
Contributor I

Hi ,

Yes I am initialising it before the start of scheduler,

And I found while debugging comparing with the normal CAN driver code and freertos CAN driver code ,ESR1 and DBG1 register is not being updated after it leaves the freezemode in RTOs but updated in Normal driver code ,if you are willing can we connect through WebEx or skype call ?

Get Outlook for Android<https://aka.ms/ghei36>

L&T Technology Services Ltd

www.LTTS.com

L&T Technology Services Limited (LTTS) is committed to safeguard your data privacy. For more information to view our commitment towards data privacy under GDPR, please visit the privacy policy on our website www.Ltts.com. This Email may contain confidential or privileged information for the intended recipient (s). If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.

0 Kudos

1,219 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Dhanush,

Could be possible to provide a project where I can test this issue?

Best Regards,

Alexis Andalon

0 Kudos

1,219 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Dhanush,

Can you let me know which device are you using?

Best Regards,

Alexis Andalon

0 Kudos

1,219 Views
dhanushkumar_n
Contributor I

Hi,

I am using MIMXRT1020 EVK board .

Get Outlook for Android<https://aka.ms/ghei36>

0 Kudos

1,219 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Dhanush, 

In the files you sent, there aren't the Flexcan configurations but I think this could be to two of the next reasons:

In the FLEXCAN_GetDefaultConfig(&flexcanConfig) there are two fields that could cause this kind of behavior to be sure that is as the following ones:

flexcanConfig.enableLoopBack = false;
flexcanConfig.disableSelfReception = true;

Best Regards,

Alexis Andalon

0 Kudos

1,219 Views
dhanushkumar_n
Contributor I

Hi ,

Thank you for your kind response ,

I have disabled transmit and I am trying only for reception ,

i have configured for CAN individual Mask ,

configured Message buffer 2 for ID 0X01,MB3 for ID 0X02,MB4 for ID 0X03 but when ever i send message (using P-CAN)i am receiving it from MB2 irrespective of Message ID .

Attached P-CAN image for your reference .

I presume it may be because of Masking issue ?

0 Kudos

1,219 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hello Dhanush,

Can you let me know how are you configuring the individual and global filters?

Best Regards,

Alexis Andalon

0 Kudos

1,219 Views
dhanushkumar_n
Contributor I

Hi,

I have configured to a Global filter ,i have found that CAN is having problem in syncing to the bus while operating only in RTOS Mode , CAN is absolutely working fine in normal mode ,

i have found that inside API FLEXCAN_Init ESR1 register value must be updated to value (262272),which indicates CAN synchronised to CAN bus and Bus state as IDLE,but in RTOS mode ESR1 value is absolutely ZERO(0). and DB1 register is also not updating for the same synchronisation issue.

i'm presuming this might be the issue of clock synchronisation.

Thank you .

0 Kudos