FlexCAN transmit not working

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

FlexCAN transmit not working

Jump to solution
4,777 Views
ArunkumarV
Contributor II

Hi Team,

I am trying use the FlexCAN and facing issue on sending.

Using the example - sk32146 FlexCAN from the project examples, and using the hardware S32K146_EVB board with 12 V power supply. From external device (Analyzer) able to get the data, Rx working fine as per the example LED toggle happen for the demo, packet formed accordingly.

But facing the issue on the Tx, running continually in debug mode, no data in the Analyzer. Probed the controller CAN_1 Tx pin using scope and no output. 

help me to solve the issue, if any debug or configurations need to be checked?

thanks 

 

Tags (2)
0 Kudos
1 Solution
4,735 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Do you have two S32K146EVB? Try to flash one as MASTER and another as SLAVE(change the /*#define MASTER*/
 #define SLAVE).

Will these two board work?

I don't have CAN Analyzer or oscilloscope on hand, so can not test or measure the waveform.

Does your CAN Analyzer support CAN FD? If not, please change the program disable CAN FD.

Enable flexible data rate.pngenableFD = false.png

View solution in original post

13 Replies
4,761 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi ArunkumarV,

Assuming you are using can_pal_s32k146 example in S32K1xx SDK RTM v4.0.2 with S32K146EVB.

description can_pal_s32k146 RTM4.0.2.png

According the the description.txt, please open example documentation(CAL PAL notice the Application description and Hardware Wiring

CAN PAL RTM4.0.2 can_pal_s32k146.pngcan_pal_s32k146 MASTER SLAVE button.pngcan_pal_s32k146 Pins.png

Did you press SW2(PTC12) or SW3(PTC13) buttons? 
Would you please point out where is the CAN_1 Tx pin? That example select PTE5 as CAN0_TX.


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
4,752 Views
ArunkumarV
Contributor II

Hi Robin,

Thanks for the reply.

I am using evaluation board S32K146EVB, and the example is FlexCAN encrypted s32k146.

For CAN_0 only, by pressing buttons (PTC 12 and 13) triggers the send function but no output in CAN analyzer.
 
Note: Didn't using the encrypted function, its a simple send. and no issue with the function or doesn't show no errors.
Debug running without any errors
 
From your query do i need to use can_pal? What is the difference?
 
Thanks

0 Kudos
4,747 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

If you don't use the encrypted function, please test the can_pal example.

About the FlexCAN encrypted s32k146, please refer to file:///C:/NXP/S32DS.3.4/S32DS/software/S32SDK_S32K1XX_RTM_4.0.2/doc/html_S32K146/flexcan_encrypted_s32k146_group.html

0 Kudos
4,742 Views
ArunkumarV
Contributor II

Hi Robin,

I tried with the CAN_PAL example, facing the same issue.

By sending the proper frame from CAN Analyzer able to see the LED ON/OFF (RED/GREEN), getting the proper wave in scope.

When pressing the button (tried with both button and checked the HW its good) seeing the continuous output in the scope, but the example code written as single send while pressing the button.

Kindly check the attached scope output and help me to solve the issue.

Thanks.

0 Kudos
4,736 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Do you have two S32K146EVB? Try to flash one as MASTER and another as SLAVE(change the /*#define MASTER*/
 #define SLAVE).

Will these two board work?

I don't have CAN Analyzer or oscilloscope on hand, so can not test or measure the waveform.

Does your CAN Analyzer support CAN FD? If not, please change the program disable CAN FD.

Enable flexible data rate.pngenableFD = false.png

4,694 Views
ArunkumarV
Contributor II

Hi Robin,

Facing some issue when changing the configuration for CAN 1.

With the same example (can_pal) changing the CAN instant from 'Zero' to 'one'. its not working.

1. Changed the CAN peripheral to CAN 1.

2. Added the PIN mux setting to CAN 1, PTE 12 and 13. 

3. Connecting the RX and TX to the external CAN transceiver.

is any other additional configuration required for CAN1?

is both the peripherals are same or different in communication?

Kindly help me to set the CAN 1 configuration.

Thanks in advance.

CAN_1_settings.png

CAN_GPIO_SETTING.png

  

0 Kudos
4,687 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

2. Added the PIN mux setting to CAN 1, PTE 12 and 13   PTA12 and PTA13?

Please refer to CAN1 not working in S32K144

Here is the difference:

FlexCAN instances and features.png

4,646 Views
ArunkumarV
Contributor II

Hi Robin,

Thanks for your support, and both the CAN working fine.

Thanks for the Link.

Best,

Arunkumar.V

0 Kudos
4,643 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

You are welcome!
I am glad to hear that it works now.

0 Kudos
4,627 Views
ArunkumarV
Contributor II

Hi Robin,

I tried with the FlexCAN for the CAN 0 and 1, its working fine. 

But parallelly using the 2 uart's in FreeRTOS, facing some issue.

so, trying to configure the CAN with interrupt and call back (same as LPUART example), didn't find any example for CAN interrupt.

configured interrupt and callback not working. seems missing some API calls.

Kindly provide some example for the interrupt configurations and API's.

Thanks in Advance.

0 Kudos
4,622 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

For new topics, please create a new question. Thank you for your understanding.

0 Kudos
4,685 Views
ArunkumarV
Contributor II

Hi Robin,

sorry its a typo.

Port is PTA 12 and 13 for CAN 1, not PTE. its my mistake.

Thanks for the link, will check and get back to you.

 

 

0 Kudos
4,719 Views
ArunkumarV
Contributor II

Hi Robin,

Thanks for pointing the right configuration, it works well after changing the FD.

 

0 Kudos