MQX FlexCAN

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,401件の閲覧回数
finncarlsvi
Contributor III

Hello,

I'm trying to run the MQX FlexCAN example but the program stops after displaying the Node:

*********FLEXCAN TEST PROGRAM.*********

   Message format: Standard (11 bit id)

   Message buffer 9 used for Rx.

   Message buffer 13 used for Tx.

   Interrupt Mode: Enabled

   Operation Mode: TX and RX --> Normal

***************************************

NODE is 1

I tracked down the issue. The program waits indefinitely at the line:

mqx/examples/can/flexcan/fsl_flexcan_test.c

(Line 133) result = flexcan_init(instance, &flexcan1_data, TRUE);

which is calling

mqx/source/io/can/flexcan/fsl_flexcan_driver.c

(Line 363) result = flexcan_hal_init(instance, data);

which in turn is calling

mqx/source/io/can/flexcan/fsl_flexcan_hal.c

(Line 222) while (!(flexcan_reg_ptr->MCR & CAN_MCR_LPM_ACK_MASK)) {}

I have atached the last file (mqx/source/io/can/flexcan/fsl_flexcan_hal.c)

Thank you for any help to shed some light on the subject. It's probably a simple fix, but after reading about CAN and FlexCAN, I'm still not understanding what is happening.

/ Finn

タグ(2)
0 件の賞賛
1 解決策
989件の閲覧回数
finncarlsvi
Contributor III

Fixed it, apparently the can_clk_sel was set to disable the FlexCAN clock in the CCM_CSCMR2 register (page 776 of the IMX6SX reference manual).

I fixed the issue by activating the clock before initializing can:

*reg &= !(0x3FC)

*reg |= 0x100

Edit: The address to the register is 0x420C4020

元の投稿で解決策を見る

0 件の賞賛
5 返答(返信)
989件の閲覧回数
alejandrolozan1
NXP Employee
NXP Employee

Hi,

Which device are you using? a Kinetis, Vybrid device?

Best Regards,

Alejandro

0 件の賞賛
990件の閲覧回数
finncarlsvi
Contributor III

Fixed it, apparently the can_clk_sel was set to disable the FlexCAN clock in the CCM_CSCMR2 register (page 776 of the IMX6SX reference manual).

I fixed the issue by activating the clock before initializing can:

*reg &= !(0x3FC)

*reg |= 0x100

Edit: The address to the register is 0x420C4020

0 件の賞賛
988件の閲覧回数
finncarlsvi
Contributor III

Hi Alejandro,

I was using the Nit6_SoloX from Boundary Devices, which uses the 6SoloX SoC. I asked them, too, but got no response, so I am now running the SabreSD without any CAN issues.

Cheers

Finn

0 件の賞賛
989件の閲覧回数
alejandrolozan1
NXP Employee
NXP Employee

That means your problem is solved? If so,it would be great if you share your solution.

/Alejandro

0 件の賞賛
988件の閲覧回数
finncarlsvi
Contributor III

No, I never really solved the problem. Boundary Devices didn't get back to me to try and help solve the issue, so I switched boards to the Freescale SabreSD.

0 件の賞賛