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
解決済! 解決策の投稿を見る。
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.
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.
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.
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.
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