[imx8mp] use FLEXCAN2 controller by M7

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

[imx8mp] use FLEXCAN2 controller by M7

ソリューションへジャンプ
382件の閲覧回数
schwammal
Contributor I

Hello everyone,

I am new here and I got my hands on an imx8mp µC.
On the µC I want to run an application which needs two CANs.
For this µC are CAN demo implementations available, which I am able to run on my Hardware.

To run one of this examples on FLEXCAN2 instead of FLEXCAN1 the board configuration has to change.
In particular I added the PIN and Clock config for FLEXCAN2.

Currently the initialization for FLEXCAN1 is running fine, but the initialization of FLEXCAN2 is stuck while disabling the FLEXCAN Module. 

Within the Demo Code is a init for an specific GPIO pin.
/* GPIO5_IO05 is used to control CAN1_STBY which is ebaled active high */
gpio_pin_config_t config = {kGPIO_DigitalOutput, 1, kGPIO_NoIntmode};
GPIO_PinInit(GPIO5, 5U, &config);

I do not set an GPIO for CAN2 and I think there is my issue.
Does anyone know where I can find the information which GPIO I have to use for CAN2?

Thanks for your help in advance.

Greetings
schwammal

ラベル(1)
0 件の賞賛
返信
1 解決策
359件の閲覧回数
AldoG
NXP TechSupport
NXP TechSupport

Hello,

it is actually a bit difficult to use FlexCAN2 on the EVK, as the pins used for this one are shared with PDM and also there is a switch that need to be enabled in order for it to actually be selected.

AldoG_0-1719333130590.png

So, it is not enough to just mux the FlexCAN correctly but to set this switch as well, to see an example of such implementation one could refer to the Linux Device tree:
https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/arch/arm64/boot/dts/freescale/imx8mp-evk.dts#L422
https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/arch/arm64/boot/dts/freescale/imx8mp-evk.dts#L107...
https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/arch/arm64/boot/dts/freescale/imx8mp-evk.dts#L109...

Best regards/Saludos,
Aldo.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
360件の閲覧回数
AldoG
NXP TechSupport
NXP TechSupport

Hello,

it is actually a bit difficult to use FlexCAN2 on the EVK, as the pins used for this one are shared with PDM and also there is a switch that need to be enabled in order for it to actually be selected.

AldoG_0-1719333130590.png

So, it is not enough to just mux the FlexCAN correctly but to set this switch as well, to see an example of such implementation one could refer to the Linux Device tree:
https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/arch/arm64/boot/dts/freescale/imx8mp-evk.dts#L422
https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/arch/arm64/boot/dts/freescale/imx8mp-evk.dts#L107...
https://github.com/nxp-imx/linux-imx/blob/lf-6.6.y/arch/arm64/boot/dts/freescale/imx8mp-evk.dts#L109...

Best regards/Saludos,
Aldo.

0 件の賞賛
返信
323件の閲覧回数
schwammal
Contributor I

Hi Aldo,

thanks for this information.
From the Files you have shared I assume, that I have to set the MX8MP_IOMUXC_SAI2_MCLK__GPIO4_IO27 to high to switch for CAN2.

The initialization is still not working properly, but I will talk to my colleagues about it bevor posting an update.

 

Best regards
schwammal